diff options
author | Matthieu Bouron <matthieu.bouron@stupeflix.com> | 2016-06-23 22:20:10 +0200 |
---|---|---|
committer | Matthieu Bouron <matthieu.bouron@stupeflix.com> | 2016-06-23 22:20:10 +0200 |
commit | c60d328e676770596c40931567feee8efc7ef670 (patch) | |
tree | f4fce9768e97d3e4c33618589e4b19b4c139e0d4 /libavformat/tests | |
parent | b1e1da52fe2e7320363fdaa0cdd276847e25bf53 (diff) | |
parent | a79aafd0b4d37eda6f15dc68e6509d4e815290c9 (diff) | |
download | ffmpeg-streaming-c60d328e676770596c40931567feee8efc7ef670.zip ffmpeg-streaming-c60d328e676770596c40931567feee8efc7ef670.tar.gz |
Merge commit 'a79aafd0b4d37eda6f15dc68e6509d4e815290c9'
* commit 'a79aafd0b4d37eda6f15dc68e6509d4e815290c9':
movenc: Add a test for VFR with b-frames, with a duration change at a fragment end
Merged-by: Matthieu Bouron <matthieu.bouron@stupeflix.com>
Diffstat (limited to 'libavformat/tests')
-rw-r--r-- | libavformat/tests/movenc.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/libavformat/tests/movenc.c b/libavformat/tests/movenc.c index e994912..41cd4fc 100644 --- a/libavformat/tests/movenc.c +++ b/libavformat/tests/movenc.c @@ -70,6 +70,8 @@ int skip_write; int skip_write_audio; int clear_duration; int force_iobuf_size; +int do_interleave; +int fake_pkt_duration; int num_warnings; @@ -283,6 +285,8 @@ static void mux_frames(int n) } if (!bframes) pkt.pts = pkt.dts; + if (fake_pkt_duration) + pkt.duration = fake_pkt_duration; frames++; } @@ -295,7 +299,10 @@ static void mux_frames(int n) continue; if (skip_write_audio && pkt.stream_index == 1) continue; - av_write_frame(ctx, &pkt); + if (do_interleave) + av_interleaved_write_frame(ctx, &pkt); + else + av_write_frame(ctx, &pkt); } } @@ -713,6 +720,32 @@ int main(int argc, char **argv) close_out(); force_iobuf_size = 0; + // Test VFR content with bframes with interleaving. + // Here, using av_interleaved_write_frame allows the muxer to get the + // fragment end durations right. We always set the packet duration to + // the expected, but we simulate dropped frames at one point. + do_interleave = 1; + init_out("vfr-noduration-interleave"); + av_dict_set(&opts, "movflags", "frag_keyframe+delay_moov", 0); + av_dict_set(&opts, "frag_duration", "650000", 0); + init_fps(1, 1, 30); + mux_frames(gop_size/2); + // Pretend that the packet duration is the normal, even if + // we actually skip a bunch of frames. (I.e., simulate that + // we don't know of the framedrop in advance.) + fake_pkt_duration = duration; + duration *= 10; + mux_frames(1); + fake_pkt_duration = 0; + duration /= 10; + mux_frames(gop_size/2 - 1); + mux_gops(1); + finish(); + close_out(); + clear_duration = 0; + do_interleave = 0; + + av_free(md5); return check_faults > 0 ? 1 : 0; |