[FFmpeg-devel] [PATCH v2] avformat/movenc: properly handle cover image codecs

Michael Niedermayer michael at niedermayer.cc
Sat Jun 2 01:46:30 EEST 2018

On Fri, Jun 01, 2018 at 02:24:39AM +0300, Timo Teräs wrote:
> Find codec tag for attached images using appropriate list of
> supported image formats.
> This fixes writing the cover image to m4v/m4a and other container
> formats that do not allow these codecs as a track.
> Signed-off-by: Timo Teräs <timo.teras at iki.fi>
> ---
> This replaces the previous patch:
>  PATCH] [RFC] avformat/movenc: support covert images for ipod muxer
> It appears that query_codec() is used only to figure out which stream
> to select as the default copy stream. Fixing it properly for movenc
> attached pictures is difficult, as the stream disposition would need
> to be passed through the call stack. Additionally, it would make sense
> to rewrite the selection logic open_output_file() to not use APIC
> special tag and be based on the input/output dispositions.
> So this just adds proper handling of the codecs in mov_init() phase
> which fixes most of the usability issues.
> Please backport to 4.0 stable branch too.
> Changes in v2:
>  - map the codec to the actual covr image tag value and
>    use that when writing the cover image instead of doing
>    a new switch over the codec
>  libavformat/movenc.c | 30 ++++++++++++------------------
>  1 file changed, 12 insertions(+), 18 deletions(-)

this seems to break:
./ffmpeg -i GF9720Repeal20the20Eighth20with20Helen20Linehan.m4a -t 1 test.mov

[mov @ 0x2f45140] Could not find tag for codec h264 in stream #0, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:1 -- 

input can be found here: https://guiltyfeminist.libsyn.com/97-repeal-the-eighth-with-helen-linehan

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180602/f9622b5a/attachment.sig>

More information about the ffmpeg-devel mailing list