[FFmpeg-devel] [PATCH v3 0/5] AMV muxing and adpcm_ima_amv encoding support

Zane van Iperen zane at zanevaniperen.com
Tue Nov 3 13:41:40 EET 2020


Adds support for encoding to adpcm_ima_amv and muxing to AMV.

Things to note:
- AMV is a hard-coded (and broken) subset of AVI. It's not worth sullying the
  existing AVI muxer with its filth.
- The muxer is extremely pedantic about its streams, this is to
  not break certain software players.
- The sizes of certain tags are deliberately set to 0 as some players break
  when they're set correctly. Ditto with some header fields.
- Players can be **very** sensitive to the frame order and sizes.
  - Frames must be strictly interleaved as V-A, any V-V or A-A will
    cause crashes.
  - Variable audio frame sizes cause crashes.
  - If audio is shorter than video, it's padded with silence.
  - If video is shorter than audio, the most recent frame is repeated.

v3: [2]
 - Use ffio_fill()

v2: [1]
 - Unref allocated audio frame
 - Check return value of av_packet_ref()
 - Remove unnecessary initialisations
 - Add deinit() function

[1]: https://ffmpeg.org/pipermail/ffmpeg-devel/2020-November/271837.html
[2]: https://ffmpeg.org/pipermail/ffmpeg-devel/2020-November/271882.html

Zane van Iperen (5):
  avcodec/adpcm_ima_amv: restrict to 1 channel
  avcodec/adpcm_ima_amv: handle odd sample counts
  avcodec/adpcm_ima_amv: document header format
  avcodec: add adpcm_ima_amv encoder
  avformat: add amv muxer

 MAINTAINERS                  |   1 +
 doc/general_contents.texi    |   2 +-
 libavcodec/adpcm.c           |  40 +++-
 libavcodec/adpcmenc.c        |  58 ++++-
 libavcodec/allcodecs.c       |   1 +
 libavcodec/utils.c           |   3 +-
 libavformat/Makefile         |   1 +
 libavformat/allformats.c     |   1 +
 libavformat/amvenc.c         | 413 +++++++++++++++++++++++++++++++++++
 tests/ref/fate/adpcm-ima-amv | 312 +++++++++++++-------------
 10 files changed, 671 insertions(+), 161 deletions(-)
 create mode 100644 libavformat/amvenc.c

-- 
2.28.0




More information about the ffmpeg-devel mailing list