Skip to content

Commit b02493e

Browse files
committed
movenc: force video timebase to be 0.1ms precisse at least.
The timebases before where only guranteed to be 1/fps precisse and could cause AV sync errors on low fps Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
1 parent 5e6439a commit b02493e

22 files changed

+65
-63
lines changed

libavformat/movenc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3522,6 +3522,8 @@ static int mov_write_header(AVFormatContext *s)
35223522
track->height = track->tag>>24 == 'n' ? 486 : 576;
35233523
}
35243524
track->timescale = st->codec->time_base.den;
3525+
while(track->timescale < 10000)
3526+
track->timescale *= 2;
35253527
if (track->mode == MODE_MOV && track->timescale > 100000)
35263528
av_log(s, AV_LOG_WARNING,
35273529
"WARNING codec timebase is very high. If duration is too long,\n"

tests/ref/fate/vsynth1-avui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
6094fe77d3a4c49cae45a3de088bdb1a *tests/data/fate/vsynth1-avui.mov
1+
853dad3a1248614c6d61c2f9dc2a999c *tests/data/fate/vsynth1-avui.mov
22
42624907 tests/data/fate/vsynth1-avui.mov
33
c5ccac874dbf808e9088bc3107860042 *tests/data/fate/vsynth1-avui.out.rawvideo
44
stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 7603200/ 7603200

tests/ref/fate/vsynth1-dnxhd-1080i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
fac7cbb7541f485ec3b1a7a24dbdca8f *tests/data/fate/vsynth1-dnxhd-1080i.mov
1+
9a4781b0a052d9efaafbaf8893db9632 *tests/data/fate/vsynth1-dnxhd-1080i.mov
22
3031911 tests/data/fate/vsynth1-dnxhd-1080i.mov
33
e55bf857297ba4d911a9d17a984b125d *tests/data/fate/vsynth1-dnxhd-1080i.out.rawvideo
44
stddev: 6.29 PSNR: 32.15 MAXDIFF: 64 bytes: 7603200/ 760320

tests/ref/fate/vsynth1-mpeg4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1283a1904765c40b7602402867a86c4f *tests/data/fate/vsynth1-mpeg4.mp4
1+
a2acdf772bf7b7641079d8a03ea03ccf *tests/data/fate/vsynth1-mpeg4.mp4
22
540024 tests/data/fate/vsynth1-mpeg4.mp4
33
f80ec173d37f2f91add031e95579a220 *tests/data/fate/vsynth1-mpeg4.out.rawvideo
44
stddev: 7.97 PSNR: 30.10 MAXDIFF: 105 bytes: 7603200/ 7603200

tests/ref/fate/vsynth1-prores

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
31159cc9d1693bc66ad7a3083c48bcc4 *tests/data/fate/vsynth1-prores.mov
1+
17a598a8cc6b899c79e3c69b9679e08d *tests/data/fate/vsynth1-prores.mov
22
5022811 tests/data/fate/vsynth1-prores.mov
33
a2e2d1d45341a94ff994d1d92629f778 *tests/data/fate/vsynth1-prores.out.rawvideo
44
stddev: 2.47 PSNR: 40.27 MAXDIFF: 31 bytes: 7603200/ 7603200
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
e7a7e17a40df5d1296cea05d55bd5724 *tests/data/fate/vsynth1-prores_kostya.mov
1+
504b53c891d5bd917d5cf5190c312a20 *tests/data/fate/vsynth1-prores_kostya.mov
22
3858901 tests/data/fate/vsynth1-prores_kostya.mov
33
0a4153637d0cc0a88a8bcbf04cfaf8c6 *tests/data/fate/vsynth1-prores_kostya.out.rawvideo
44
stddev: 3.17 PSNR: 38.09 MAXDIFF: 39 bytes: 7603200/ 7603200

tests/ref/fate/vsynth1-qtrle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
9c6ee876369fceac1ff2478a0225bc9b *tests/data/fate/vsynth1-qtrle.mov
1+
f66efb8a1fd455ef31de540df9a81909 *tests/data/fate/vsynth1-qtrle.mov
22
15263148 tests/data/fate/vsynth1-qtrle.mov
33
93695a27c24a61105076ca7b1f010bbd *tests/data/fate/vsynth1-qtrle.out.rawvideo
44
stddev: 3.42 PSNR: 37.44 MAXDIFF: 48 bytes: 7603200/ 7603200

tests/ref/fate/vsynth1-qtrlegray

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
dfb185e38b3557eca0ead72d57ca48f8 *tests/data/fate/vsynth1-qtrlegray.mov
1+
a9f365910ce1eb0ccbc05b68ca7cfafb *tests/data/fate/vsynth1-qtrlegray.mov
22
5113284 tests/data/fate/vsynth1-qtrlegray.mov
33
29def4aed035ed65d3a89f7d382fccbe *tests/data/fate/vsynth1-qtrlegray.out.rawvideo
44
stddev: 25.95 PSNR: 19.85 MAXDIFF: 122 bytes: 7603200/ 7603200

tests/ref/fate/vsynth1-svq1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
4654e7af0d4aa58c3db1eb145e278038 *tests/data/fate/vsynth1-svq1.mov
1+
f2930c19bd18eb03c1f984a72cdb67c8 *tests/data/fate/vsynth1-svq1.mov
22
1334223 tests/data/fate/vsynth1-svq1.mov
33
9cc35c54b2c77d36bd7e308b393c1f81 *tests/data/fate/vsynth1-svq1.out.rawvideo
44
stddev: 9.58 PSNR: 28.50 MAXDIFF: 210 bytes: 7603200/ 7603200

tests/ref/fate/vsynth2-avui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
4b05ddf2d099b9189978032a18b376ea *tests/data/fate/vsynth2-avui.mov
1+
d6ed112daf14e73ea50f1c32ecc6d4ce *tests/data/fate/vsynth2-avui.mov
22
42624907 tests/data/fate/vsynth2-avui.mov
33
dde5895817ad9d219f79a52d0bdfb001 *tests/data/fate/vsynth2-avui.out.rawvideo
44
stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 7603200/ 7603200

0 commit comments

Comments
 (0)