@@ -1216,6 +1216,17 @@ static int dash_init(AVFormatContext *s)
if (os->segment_type == SEGMENT_TYPE_MP4) {
if (c->streaming)
+ // Explanation for why certain movflags are used for streaming:
+ // frag_every_frame :- Every frame should be moof fragment, so
+ // the data from current frame can be streamed without
+ // waiting for the completion of the entire segment.
+ // skip_sidx :- The SIDX atom for each moof will result in a
+ // significant bitrate overhead. Hence disabling it here.
+ // skip_trailer :- Writing mp4 trailer means that a list of all
+ // fragment's information is stored, which results continuous
+ // growth in memory usage as more fragments are muxed.
+ // Disabling trailer results in deterministic memory usage.
+ // Anyways trailer is unnecessary of fmp4 segment.
av_dict_set(&opts, "movflags", "frag_every_frame+dash+delay_moov+skip_sidx+skip_trailer", 0);
else
av_dict_set(&opts, "movflags", "frag_custom+dash+delay_moov", 0);