summaryrefslogtreecommitdiff
path: root/libavformat/movenc.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2018-04-14 21:32:11 +0300
committerRostislav Pehlivanov <atomnuker@gmail.com>2018-04-17 20:11:34 +0100
commit9af71b326fda1c6f32a26d465f7740110113e759 (patch)
treede5e0070bb38cd301e3f56791655e4ea463d2e7f /libavformat/movenc.h
parentc663dce031b3973e37c83ae1818f1484e1cf482c (diff)
avformat/movenc: support writing iTunes cover image
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: Timo Teräs <timo.teras@iki.fi>
Diffstat (limited to 'libavformat/movenc.h')
-rw-r--r--libavformat/movenc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/movenc.h b/libavformat/movenc.h
index ca2a9c9722..c9b4072fb9 100644
--- a/libavformat/movenc.h
+++ b/libavformat/movenc.h
@@ -132,6 +132,7 @@ typedef struct MOVTrack {
uint32_t default_size;
HintSampleQueue sample_queue;
+ AVPacket cover_image;
AVIOContext *mdat_buf;
int64_t data_offset;