From 4f7723cb3b913c577842a5bb088c804ddacac8df Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Mon, 13 Jun 2016 23:47:15 +0300 Subject: movenc: Add an option for skipping writing the mfra/tfra/mfro trailer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When writing a fragmented file, we by default write an index pointing to all the fragments at the end of the file. This causes constantly increasing memory usage during the muxing. For live streams, the index might not be useful at all. A similar fragment index is written (but at the start of the file) if the global_sidx flag is set. If ism_lookahead is set, we need to keep data about the last ism_lookahead+1 fragments. If no fragment index is to be written, we don't need to store information about all fragments, avoiding increasing the memory consumption linearly with the muxing runtime. This fixes out of memory situations with long live mp4 streams. Signed-off-by: Martin Storsjö --- libavformat/movenc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'libavformat/movenc.h') diff --git a/libavformat/movenc.h b/libavformat/movenc.h index 6c922fb5df..f4ed188c38 100644 --- a/libavformat/movenc.h +++ b/libavformat/movenc.h @@ -194,6 +194,7 @@ typedef struct MOVMuxContext { #define FF_MOV_FLAG_FRAG_DISCONT (1 << 12) #define FF_MOV_FLAG_DELAY_MOOV (1 << 13) #define FF_MOV_FLAG_GLOBAL_SIDX (1 << 14) +#define FF_MOV_FLAG_SKIP_TRAILER (1 << 15) int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt); -- cgit v1.2.3