Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
a79aafd0
Commit
a79aafd0
authored
May 09, 2016
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
movenc: Add a test for VFR with b-frames, with a duration change at a fragment end
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
e1eb0fc9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
1 deletion
+42
-1
movenc.c
libavformat/tests/movenc.c
+34
-1
movenc
tests/ref/fate/movenc
+8
-0
No files found.
libavformat/tests/movenc.c
View file @
a79aafd0
...
...
@@ -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
);
}
}
...
...
@@ -709,6 +716,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
;
...
...
tests/ref/fate/movenc
View file @
a79aafd0
...
...
@@ -125,3 +125,11 @@ write_data len 1500, time 9666667, type sync atom moof
write_data len 664, time nopts, type unknown atom -
write_data len 148, time nopts, type trailer atom -
03766894d839e5fcb1edb88498d812f7 5687 large_frag
write_data len 1255, time nopts, type header atom ftyp
write_data len 508, time -33333, type sync atom moof
write_data len 372, time 800000, type boundary atom moof
write_data len 328, time 1266667, type boundary atom moof
write_data len 476, time 1566667, type sync atom moof
write_data len 340, time 2233333, type boundary atom moof
write_data len 262, time nopts, type trailer atom -
a4280bdc23af2c4334ec2da3fa946d3a 3541 vfr-noduration-interleave
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment