• Timo Teräs's avatar
    avformat/movenc: support writing iTunes cover image · 9af71b32
    Timo Teräs authored
    Fixes https://trac.ffmpeg.org/ticket/2798
    
    This makes movenc handle AV_DISPOSITION_ATTACHED_PIC and write
    the associated pictures in iTunes cover atom. This corresponds
    to how 'mov' demuxer parses and exposes the cover images when
    reading.
    
    Most of the existing track handling loops properly ignore
    these 'virtual streams' as MOVTrack->entry is never incremented
    for them. However, additional tests are added as needed to ignore
    them.
    
    Tested to produce valid output with:
      ffmpeg -i movie.mp4 -i thumb.jpg -disposition:v:1 attached_pic \
             -map 0 -map 1 -c copy movie-with-cover.mp4
    
    The cover image is also copied correctly with:
      ffmpeg -i movie-with-cover.mp4 -map 0 -c copy out.mp4
    
    AtomicParseley says that the attached_pic stream is properly
    not visible in the main tracks of the file.
    Signed-off-by: 's avatarTimo Teräs <timo.teras@iki.fi>
    9af71b32
movenc.h 7.51 KB