1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-18 03:19:31 +02:00
FFmpeg/tests/ref/fate/h264-twofields-packet
Sasi Inguva 93db5e3fc4 lavf/mov.c: offset index timestamps by the minimum pts to make first pts zero
If the videos starts with B frame, then the minimum composition time
as computed by stts + ctts will be non-zero. Hence we need to shift
the DTS, so that the first pts is zero. This was the intention of that
code-block. However it was subtracting by the wrong amount.

For example, for one of the videos in the bug nonFormatted.mp4 we have

stts:
sample_count  duration
960           1001

ctts:
sample_count  duration
1             3003
2             0
1             3003
....

The resulting composition times are :  3003, 1001, 2002, 6006, ...

The minimum composition time or PTS is 1001, which should be used to
offset DTS. However the code block was wrongly using ctts[0] which is
3003. Hence the PTS was negative. This change computes the minimum pts
encountered while fixing the index, and then subtracts it from all the
timestamps after the edit list fixes are applied.

Samples files available from:

https://bugs.chromium.org/p/chromium/issues/detail?id=721451
https://bugs.chromium.org/p/chromium/issues/detail?id=723537

fate-suite/h264/twofields_packet.mp4 is a similar file starting with 2
B frames. Before this change the PTS of first two B-frames was -6006
and -3003, and I am guessing one of them got dropped when being decoded
and remuxed  to the framecrc before, and now it is not being dropped.

Signed-off-by: Sasi Inguva <isasi@google.com>
2017-06-09 18:13:33 +02:00

36 lines
1.8 KiB
Plaintext

#tb 0: 1001/30000
#media_type 0: video
#codec_id 0: rawvideo
#dimensions 0: 1920x1080
#sar 0: 1/1
0, 0, 0, 1, 3110400, 0x48e39acd
0, 1, 1, 1, 3110400, 0x40d65f69
0, 2, 2, 1, 3110400, 0xdcbc50bf
0, 3, 3, 1, 3110400, 0x73a2276a
0, 4, 4, 1, 3110400, 0x84a2b3c6
0, 5, 5, 1, 3110400, 0x7cf3b570
0, 6, 6, 1, 3110400, 0xa2d1e03a
0, 7, 7, 1, 3110400, 0x03220fb1
0, 8, 8, 1, 3110400, 0x89cd526a
0, 9, 9, 1, 3110400, 0xbb4b7531
0, 10, 10, 1, 3110400, 0x0a69f053
0, 11, 11, 1, 3110400, 0x0187994b
0, 12, 12, 1, 3110400, 0x26ed49fa
0, 13, 13, 1, 3110400, 0xbe8966d4
0, 14, 14, 1, 3110400, 0x248d203c
0, 15, 15, 1, 3110400, 0x3139c754
0, 16, 16, 1, 3110400, 0xf22380c4
0, 17, 17, 1, 3110400, 0x3e00dcc1
0, 18, 18, 1, 3110400, 0x8cbe2483
0, 19, 19, 1, 3110400, 0x6951cd63
0, 20, 20, 1, 3110400, 0x36aca4c5
0, 21, 21, 1, 3110400, 0x4d4f6fbe
0, 22, 22, 1, 3110400, 0x997247aa
0, 23, 23, 1, 3110400, 0x0fd40e06
0, 24, 24, 1, 3110400, 0xa10d2d67
0, 25, 25, 1, 3110400, 0x87c481da
0, 26, 26, 1, 3110400, 0xe3dca3cd
0, 27, 27, 1, 3110400, 0x5f77b078
0, 28, 28, 1, 3110400, 0xf1ddd098
0, 29, 29, 1, 3110400, 0xedcd1754