Opened 13 years ago
Last modified 4 months ago
#2084 new defect
Wrong duration in program streams with timestamp discontinuity
| Reported by: | Carl Eugen Hoyos | Owned by: | |
|---|---|---|---|
| Priority: | normal | Component: | undetermined |
| Version: | git-master | Keywords: | mpegps |
| Cc: | kasper93@gmail.com, underground78@gmail.com | Blocked By: | |
| Blocking: | Reproduced by developer: | no | |
| Analyzed by developer: | no |
Description
A user provided a 2.9 G DVD rip that shows a duration of "00:00:01.06" and a bitrate of "-2147483 kb/s" with ffmpeg -i. The reason is a timestamp discontinuity approximately 1 sec before the end of the stream. I cut the sample to only contain the last seconds, and the duration is also wrong, the bitrate is shown as 0kb/s.
$ ffmpeg -i negative-bitrate-sample.mpg
ffmpeg version N-48311-gc36302a Copyright (c) 2000-2012 the FFmpeg developers
built on Dec 30 2012 19:01:34 with gcc 4.7 (SUSE Linux)
configuration: --enable-gpl --enable-avresample
libavutil 52. 13.100 / 52. 13.100
libavcodec 54. 81.100 / 54. 81.100
libavformat 54. 50.104 / 54. 50.104
libavdevice 54. 3.102 / 54. 3.102
libavfilter 3. 30.102 / 3. 30.102
libswscale 2. 1.103 / 2. 1.103
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
[mpeg @ 0x1ed7540] max_analyze_duration 5000000 reached at 5000000
Input #0, mpeg, from 'negative-bitrate-sample.mpg':
Duration: 00:00:01.06, start: 0.287267, bitrate: -2147483 kb/s
Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Stream #0:2[0x23]: Subtitle: dvd_subtitle
At least one output file must be specified
$ ffmpeg -probesize 2147483647 -analyzeduration 2147483647 -i ../MPlayer/negative-bitrate-sample.mpg
ffmpeg version N-48311-gc36302a Copyright (c) 2000-2012 the FFmpeg developers
built on Dec 30 2012 19:01:34 with gcc 4.7 (SUSE Linux)
configuration: --enable-gpl --enable-avresample
libavutil 52. 13.100 / 52. 13.100
libavcodec 54. 81.100 / 54. 81.100
libavformat 54. 50.104 / 54. 50.104
libavdevice 54. 3.102 / 54. 3.102
libavfilter 3. 30.102 / 3. 30.102
libswscale 2. 1.103 / 2. 1.103
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
[mpeg @ 0x17c0720] max_analyze_duration 2147483647 reached at 2147520000
Input #0, mpeg, from '../MPlayer/negative-bitrate-sample.mpg':
Duration: 00:00:01.06, start: 0.287267, bitrate: -2147483 kb/s
Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Stream #0:2[0x23]: Subtitle: dvd_subtitle
Stream #0:3[0x21]: Subtitle: dvd_subtitle
Stream #0:4[0x20]: Subtitle: dvd_subtitle
Stream #0:5[0x22]: Subtitle: dvd_subtitle
At least one output file must be specified
$ ffmpeg -i negative-bitrate-sample_cut.mpg
ffmpeg version N-48311-gc36302a Copyright (c) 2000-2012 the FFmpeg developers
built on Dec 30 2012 19:01:34 with gcc 4.7 (SUSE Linux)
configuration: --enable-gpl --enable-avresample
libavutil 52. 13.100 / 52. 13.100
libavcodec 54. 81.100 / 54. 81.100
libavformat 54. 50.104 / 54. 50.104
libavdevice 54. 3.102 / 54. 3.102
libavfilter 3. 30.102 / 3. 30.102
libswscale 2. 1.103 / 2. 1.103
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
[mpeg2video @ 0x2b72f80] mpeg_decode_postinit() failure
Last message repeated 4 times
[mpeg @ 0x2b6c540] DTS discontinuity in stream 1: packet 76 with DTS 343638654, packet 77 with DTS 8589956846
[mpeg @ 0x2b6c540] DTS discontinuity in stream 0: packet 104 with DTS 343641534, packet 105 with DTS 8589960446
Input #0, mpeg, from 'negative-bitrate-sample_cut.mpg':
Duration: 25:27:10.12, start: 3814.943267, bitrate: 0 kb/s
Stream #0:0[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:2[0x20]: Subtitle: dvd_subtitle
Stream #0:3[0x21]: Subtitle: dvd_subtitle
Stream #0:4[0x22]: Subtitle: dvd_subtitle
Stream #0:5[0x23]: Subtitle: dvd_subtitle
At least one output file must be specified
Attachments (1)
Change History (6)
by , 13 years ago
| Attachment: | negative-bitrate-sample_cut.mpg added |
|---|
comment:1 by , 13 years ago
comment:2 by , 13 years ago
| Cc: | added |
|---|
comment:3 by , 13 years ago
| Cc: | added |
|---|
comment:4 by , 12 years ago
| Summary: | Wrong duration and negative bitrate in mpeg stream with timestamp discontinuity → Wrong duration in program streams with timestamp discontinuity |
|---|
comment:5 by , 4 months ago
This just happened to me when trying to read a BD playlist.
It is composed of two m2ts files, one containing the entire movie, and the second one being just 0.5 seconds long. ffprobe gave me a length of 25 hours.
I had to use the main m2ts file as input to fix it, and it was not a big deal, but it can become a problem if the playlist is actually composed of "real" m2ts files with a discontinuity between them.



The negative bitrate is not shown anymore, the duration is still incorrect, ticket #2894 probably describes the same issue.
$ ffmpeg -i negative-bitrate-sample.mpg -f null - ffmpeg version N-55734-g9e477a3 Copyright (c) 2000-2013 the FFmpeg developers built on Aug 23 2013 19:36:08 with gcc 4.7 (SUSE Linux) configuration: --enable-gpl --disable-indev=jack libavutil 52. 42.100 / 52. 42.100 libavcodec 55. 29.100 / 55. 29.100 libavformat 55. 14.102 / 55. 14.102 libavdevice 55. 3.100 / 55. 3.100 libavfilter 3. 82.102 / 3. 82.102 libswscale 2. 5.100 / 2. 5.100 libswresample 0. 17.103 / 0. 17.103 libpostproc 52. 3.100 / 52. 3.100 Input #0, mpeg, from 'negative-bitrate-sample.mpg': Duration: 00:00:01.06, start: 0.287267, bitrate: N/A Stream #0:0[0x1bf]: Data: dvd_nav_packet Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [SAR 64:45 DAR 16:9], max. 8400 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc Stream #0:2[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s Stream #0:3[0x23]: Subtitle: dvd_subtitle Output #0, null, to 'pipe:': Metadata: encoder : Lavf55.14.102 Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 25 tbc Stream #0:1: Audio: pcm_s16le, 48000 Hz, 5.1(side), s16, 4608 kb/s Stream mapping: Stream #0:1 -> #0:0 (mpeg2video -> rawvideo) Stream #0:2 -> #0:1 (ac3 -> pcm_s16le) Press [q] to stop, [?] for help [mpeg2video @ 0x3142ee0] warning: first frame is no keyframe [null @ 0x3142340] Encoder did not produce proper pts, making some up. [mpeg2video @ 0x3142ee0] warning: first frame is no keyframe [mpeg @ 0x3140880] New subtitle stream 0:4 at pos:20676622 and DTS:27.2873s [mpeg @ 0x3140880] New subtitle stream 0:5 at pos:82606094 and DTS:106.967s [mpeg @ 0x3140880] New subtitle stream 0:6 at pos:82792462 and DTS:107.127s frame=95478 fps=1922 q=0.0 Lsize=N/A time=01:03:39.12 bitrate=N/A video:8951kB audio:2148228kB subtitle:0 global headers:0kB muxing overhead -100.000001%