Ticket #399 (open defect)

Opened 22 months ago

Last modified 6 months ago

ffmpeg showing incorrect pts

Reported by: takis Owned by: michael
Priority: normal Component: FFmpeg
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

When using tstools' tsreport tool ( http://code.google.com/p/tstools/) I got this list of PTS:
126000, 129750, 133500, 137250, 141000, 144750, 148500, 152250, 156000, 126000, 159750, 163500, 167250

When using FFmpeg's filter showinfo the PTS timestamps are totally different:
0, 41667, 83333, 125000, 166667, 208333, 250000, 291667, 333333, 375000, 416667, 458333

When playing the video using libavcodec/libavformat, the timestamps are the same as the ones tsreport shows.

ffmpeg -y -vf showinfo -i seekbug01min.ts -f rawvideo /dev/null
ffmpeg version N-31914-g47219e1, Copyright (c) 2000-2011 the FFmpeg developers

built on Aug 16 2011 14:53:24 with gcc 4.5.2
configuration: --enable-avfilter --enable-frei0r --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-nonfree --enable-pic --enable-pthreads --enable-shared --enable-version3 --enable-x11grab --disable-optimizations
libavutil 51. 12. 0 / 51. 12. 0
libavcodec 53. 10. 0 / 53. 10. 0
libavformat 53. 7. 0 / 53. 7. 0
libavdevice 53. 3. 0 / 53. 3. 0
libavfilter 2. 31. 1 / 2. 31. 1
libswscale 2. 0. 0 / 2. 0. 0
libpostproc 51. 2. 0 / 51. 2. 0

[mpegts @ 0x1176460] Continuity Check Failed

Last message repeated 3 times

Input #0, mpegts, from 'seekbug01min.ts':

Duration: 00:00:00.45, start: 1.400000, bitrate: 178 kb/s
Program 1

Metadata:

service_name : Big Buck Bunny
service_provider: FFmpeg

Stream #0.0[0x100]: Video: h264 (Constrained Baseline), yuv420p, 320x180 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 90k tbn, 48 tbc
Stream #0.1[0x101](und): Audio: mp2, 48000 Hz, stereo, s16, 64 kb/s

[buffer @ 0x117ae40] w:320 h:180 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:
Output #0, rawvideo, to '/dev/null':

Metadata:

encoder : Lavf53.7.0
Stream #0.0: Video: rawvideo, yuv420p, 320x180 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 24 tbc

Stream mapping:

Stream #0.0 -> #0.0

Press [q] to stop, ? for help
[mpegts @ 0x1176460] Continuity Check Failed

Last message repeated 1 times

[showinfo @ 0x117d780] n:0 pts:0 pts_time:0.000000 pos:564 fmt:yuv420p sar:1/1 s:320x180 i:P iskey:1 type:I checksum:603776523 plane_checksum:[3225751762 3029265045 3029265045 0]
[showinfo @ 0x117d780] n:1 pts:41667 pts_time:0.041667 pos:1504 fmt:yuv420p sar:1/1 s:320x180 i:P iskey:0 type:P checksum:603776523 plane_checksum:[3225751762 3029265045 3029265045 0]
[showinfo @ 0x117d780] n:2 pts:83333 pts_time:0.083333 pos:1692 fmt:yuv420p sar:1/1 s:320x180 i:P iskey:0 type:P checksum:603776523 plane_checksum:[3225751762 3029265045 3029265045 0]
[showinfo @ 0x117d780] n:3 pts:125000 pts_time:0.125000 pos:1880 fmt:yuv420p sar:1/1 s:320x180 i:P iskey:0 type:P checksum:603776523 plane_checksum:[3225751762 3029265045 3029265045 0]
[showinfo @ 0x117d780] n:4 pts:166667 pts_time:0.166667 pos:2068 fmt:yuv420p sar:1/1 s:320x180 i:P iskey:0 type:P checksum:321782142 plane_checksum:[966806382 2886587449 591323577 0]
[showinfo @ 0x117d780] n:5 pts:208333 pts_time:0.208333 pos:2632 fmt:yuv420p sar:1/1 s:320x180 i:P iskey:0 type:P checksum:1010078484 plane_checksum:[3458918426 414630700 4286638000 0]
[showinfo @ 0x117d780] n:6 pts:250000 pts_time:0.250000 pos:3196 fmt:yuv420p sar:1/1 s:320x180 i:P iskey:0 type:P checksum:1804330054 plane_checksum:[2996844705 2498675835 1603397403 0]
[showinfo @ 0x117d780] n:7 pts:291667 pts_time:0.291667 pos:3572 fmt:yuv420p sar:1/1 s:320x180 i:P iskey:0 type:P checksum:3219605500 plane_checksum:[916690920 1286459717 3285966513 0]
[showinfo @ 0x117d780] n:8 pts:333333 pts_time:0.333333 pos:4136 fmt:yuv420p sar:1/1 s:320x180 i:P iskey:0 type:P checksum:867321723 plane_checksum:[1520540519 419613641 1910038573 0]
[showinfo @ 0x117d780] n:9 pts:375000 pts_time:0.375000 pos:7708 fmt:yuv420p sar:1/1 s:320x180 i:P iskey:0 type:P checksum:3041545686 plane_checksum:[3034423407 2837631021 3697466652 0]
[showinfo @ 0x117d780] n:10 pts:416667 pts_time:0.416667 pos:8648 fmt:yuv420p sar:1/1 s:320x180 i:P iskey:0 type:P checksum:3795962486 plane_checksum:[2808617211 234344642 3924811946 0]
[showinfo @ 0x117d780] n:11 pts:458333 pts_time:0.458333 pos:9400 fmt:yuv420p sar:1/1 s:320x180 i:P iskey:0 type:P checksum:14086197 plane_checksum:[2486256520 483773749 3300581225 0]
frame= 12 fps= 0 q=0.0 Lsize= 0kB time=00:00:00.50 bitrate= 0.0kbits/s
video:1012kB audio:0kB global headers:0kB muxing overhead -100.000000%

Attachments

seekbug01min.ts Download (10.0 KB) - added by takis 22 months ago.
TS file used to illustrate the showinfo problem

Change History

Changed 22 months ago by takis

TS file used to illustrate the showinfo problem

comment:1 Changed 22 months ago by saste

  • Analyzed by developer set
  • Status changed from new to open
  • Reproduced by developer set

This is because ffmpeg applies an euristics for "normalizing" the input timestamps.
You can use the -copyts option for disabling such behavior.

At this point you may note that the timestamp values will still be different from the ffprobe -show_packets output, although the time values are equivalent, that's because ffmpeg.c rescales all the input timestamps to a timebase of 1/1000000.

In conclusion, the observed behavior is the assumed ffmpeg behavior (although maybe counter-intuitive), tell us if you think there is some problem with it.

comment:2 Changed 22 months ago by takis

Frankly, I do find it very confusing, especially as ffplay and ffmpeg show different outputs when showing that same videofilter (showinfo).

ffplay -vf showinfo /srv/files/videos/seekbug01min.ts
ffplay version N-31937-g7c94740, Copyright (c) 2003-2011 the FFmpeg developers

built on Aug 17 2011 11:02:34 with gcc 4.5.2
configuration: --enable-avfilter --enable-frei0r --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-nonfree --enable-pic --enable-pthreads --enable-shared --enable-version3 --enable-x11grab --disable-optimizations
libavutil 51. 12. 0 / 51. 12. 0
libavcodec 53. 10. 0 / 53. 10. 0
libavformat 53. 7. 0 / 53. 7. 0
libavdevice 53. 3. 0 / 53. 3. 0
libavfilter 2. 31. 1 / 2. 31. 1
libswscale 2. 0. 0 / 2. 0. 0
libpostproc 51. 2. 0 / 51. 2. 0

[mpegts @ 0xf16980] Continuity Check Failed

Last message repeated 3 times

Input #0, mpegts, from '/srv/files/videos/seekbug01min.ts':

Duration: 00:00:00.45, start: 1.400000, bitrate: 178 kb/s
Program 1

Metadata:

service_name : Big Buck Bunny
service_provider: FFmpeg

Stream #0.0[0x100]: Video: h264 (Constrained Baseline), yuv420p, 320x180 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 90k tbn, 48 tbc
Stream #0.1[0x101](und): Audio: mp2, 48000 Hz, stereo, s16, 64 kb/s

[mpegts @ 0xf16980] Continuity Check Failed

Last message repeated 1 timesq= 0KB vq= 0KB sq= 0B f=0/0

[showinfo @ 0xf8e9e0] n:0 pts:126000 pts_time:1.400000 pos:564 fmt:yuv420p sar:1/1 s:320x180 i:P iskey:1 type:I checksum:2968688214 plane_checksum:[4270850273 3148466867 3148466867 0]
Frame changed from size:320x192 to size:320x180= 4KB sq= 0B f=0/0
[showinfo @ 0x7f54f802b060] n:0 pts:129750 pts_time:1.441667 pos:1504 fmt:yuv420p sar:1/1 s:320x180 i:P iskey:0 type:P checksum:603776523 plane_checksum:[3225751762 3029265045 3029265045 0]
[showinfo @ 0x7f54f802b060] n:1 pts:137250 pts_time:1.525000 pos:1880 fmt:yuv420p sar:1/1 s:320x180 i:P iskey:0 type:P checksum:603776523 plane_checksum:[3225751762 3029265045 3029265045 0]
[showinfo @ 0x7f54f802b060] n:2 pts:141000 pts_time:1.566667 pos:2068 fmt:yuv420p sar:1/1 s:320x180 i:P iskey:0 type:P checksum:321782142 plane_checksum:[966806382 2886587449 591323577 0]
[showinfo @ 0x7f54f802b060] n:3 pts:144750 pts_time:1.608333 pos:2632 fmt:yuv420p sar:1/1 s:320x180 i:P iskey:0 type:P checksum:1010078484 plane_checksum:[3458918426 414630700 4286638000 0]

ffmpeg -y -vf showinfo -i /srv/files/videos/seekbug01min.ts -f rawvideo /dev/null
ffmpeg version N-31937-g7c94740, Copyright (c) 2000-2011 the FFmpeg developers

built on Aug 17 2011 11:02:34 with gcc 4.5.2
configuration: --enable-avfilter --enable-frei0r --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-nonfree --enable-pic --enable-pthreads --enable-shared --enable-version3 --enable-x11grab --disable-optimizations
libavutil 51. 12. 0 / 51. 12. 0
libavcodec 53. 10. 0 / 53. 10. 0
libavformat 53. 7. 0 / 53. 7. 0
libavdevice 53. 3. 0 / 53. 3. 0
libavfilter 2. 31. 1 / 2. 31. 1
libswscale 2. 0. 0 / 2. 0. 0
libpostproc 51. 2. 0 / 51. 2. 0

[mpegts @ 0xed2460] Continuity Check Failed

Last message repeated 3 times

Input #0, mpegts, from '/srv/files/videos/seekbug01min.ts':

Duration: 00:00:00.45, start: 1.400000, bitrate: 178 kb/s
Program 1

Metadata:

service_name : Big Buck Bunny
service_provider: FFmpeg

Stream #0.0[0x100]: Video: h264 (Constrained Baseline), yuv420p, 320x180 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 90k tbn, 48 tbc
Stream #0.1[0x101](und): Audio: mp2, 48000 Hz, stereo, s16, 64 kb/s

[buffer @ 0xed6e60] w:320 h:180 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:
Output #0, rawvideo, to '/dev/null':

Metadata:

encoder : Lavf53.7.0
Stream #0.0: Video: rawvideo, yuv420p, 320x180 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 24 tbc

Stream mapping:

Stream #0.0 -> #0.0

Press [q] to stop, ? for help
[mpegts @ 0xed2460] Continuity Check Failed

Last message repeated 1 times

[showinfo @ 0xed97a0] n:0 pts:0 pts_time:0.000000 pos:564 fmt:yuv420p sar:1/1 s:320x180 i:P iskey:1 type:I checksum:603776523 plane_checksum:[3225751762 3029265045 3029265045 0]
[showinfo @ 0xed97a0] n:1 pts:41667 pts_time:0.041667 pos:1504 fmt:yuv420p sar:1/1 s:320x180 i:P iskey:0 type:P checksum:603776523 plane_checksum:[3225751762 3029265045 3029265045 0]
[showinfo @ 0xed97a0] n:2 pts:83333 pts_time:0.083333 pos:1692 fmt:yuv420p sar:1/1 s:320x180 i:P iskey:0 type:P checksum:603776523 plane_checksum:[3225751762 3029265045 3029265045 0]
[showinfo @ 0xed97a0] n:3 pts:125000 pts_time:0.125000 pos:1880 fmt:yuv420p sar:1/1 s:320x180 i:P iskey:0 type:P checksum:603776523 plane_checksum:[3225751762 3029265045 3029265045 0]

Version 0, edited 22 months ago by takis (next)

comment:3 Changed 6 months ago by michael

With -copyts the showinfo timestamps now match exactly.
Is there some issue remaining (better docs? or other) or does this resolve this ticket ?

Note: See TracTickets for help on using tickets.