Opened 11 years ago

Closed 10 years ago

#2471 closed defect (invalid)

FFMpeg unable to determine video length with streams outside of programs

Reported by: Nathan Bollom Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mpegts
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
FFMpeg is unable to determine the length of a mpegts stream when there are streams detected outside of programs.

It seems that having 1 tiny section of the stream that has these streams outside of programs can causes the whole stream to be effected.

I have split a 8.39gb stream with the problem into 31.5mb chucks and was able to find a specific chuck with the problem (all the other chunks reported fine).

I have attached the effected part, but can provide other parts if necessary.

How to reproduce:

ffmpeg -i part.ts 
ffmpeg version 1.2 Copyright (c) 2000-2013 the FFmpeg developers
  built on Mar 31 2013 21:55:33 with Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libfreetype --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
  libavutil      52. 18.100 / 52. 18.100
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.104 / 54. 63.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 42.103 /  3. 42.103
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[mpegts @ 0x7fe31c022800] max_analyze_duration 5000000 reached at 5000000 microseconds
[mpegts @ 0x7fe31c022800] Could not find codec parameters for stream 3 (Unknown: none ([11][0][0][0] / 0x000B)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[NULL @ 0x7fe31c04ec00] start time is not set in estimate_timings_from_pts
[mpegts @ 0x7fe31c022800] PES packet size mismatch
Input #0, mpegts, from 'part.ts':
  Duration: N/A, start: 38349.680033, bitrate: N/A
  Program 544 
  Program 545 
  Program 546 
  Program 547 
  Program 548 
  Program 550 
  Program 551 
  Program 1057 
    Stream #0:5[0x207]: Video: mpeg2video ([2][0][0][0] / 0x0002), 90k tbn
    Stream #0:6[0x2d0](eng): Audio: mp3 ([4][0][0][0] / 0x0004), 0 channels
    Stream #0:4[0x247](eng): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Stream #0:7[0x901]: Unknown: none ([11][0][0][0] / 0x000B)
  Program 1058 
  Program 1059 
  Program 1060 
  No Program
    Stream #0:0[0x200]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x28a](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 256 kb/s
    Stream #0:2[0x240](eng): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Stream #0:3[0x1388]: Unknown: none ([11][0][0][0] / 0x000B)
At least one output file must be specified

The original file reports as:

ffmpeg -i 750283017.ts 

ffmpeg version 1.2 Copyright (c) 2000-2013 the FFmpeg developers
  built on Mar 31 2013 21:55:33 with Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libfreetype --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
  libavutil      52. 18.100 / 52. 18.100
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.104 / 54. 63.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 42.103 /  3. 42.103
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[mpegts @ 0x7ff2d9022800] max_analyze_duration 5000000 reached at 5016000 microseconds
[mpegts @ 0x7ff2d9022800] Could not find codec parameters for stream 3 (Unknown: none ([11][0][0][0] / 0x000B)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[NULL @ 0x7ff2d904ec00] start time is not set in estimate_timings_from_pts
[mpegts @ 0x7ff2d9022800] PES packet size mismatch
Input #0, mpegts, from '750283017.ts':
  Duration: N/A, start: 37526.825144, bitrate: N/A
  Program 544 
  Program 545 
  Program 546 
  Program 547 
  Program 548 
  Program 550 
  Program 551 
  Program 1057 
    Stream #0:5[0x207]: Video: mpeg2video ([2][0][0][0] / 0x0002), 90k tbn
    Stream #0:6[0x2d0](eng): Audio: mp3 ([4][0][0][0] / 0x0004), 0 channels
    Stream #0:4[0x247](eng): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Stream #0:7[0x901]: Unknown: none ([11][0][0][0] / 0x000B)
  Program 1058 
  Program 1059 
  Program 1060 
  No Program
    Stream #0:0[0x200]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x28a](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 256 kb/s
    Stream #0:2[0x240](eng): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Stream #0:3[0x1388]: Unknown: none ([11][0][0][0] / 0x000B)
At least one output file must be specified

Attachments (1)

small-part.ts (2.3 MB ) - added by Nathan Bollom 11 years ago.
A small chuck of the problem part of the file. It does not show the same issue but the attachment system doesn't allow me to attach a big enough file

Change History (7)

by Nathan Bollom, 11 years ago

Attachment: small-part.ts added

A small chuck of the problem part of the file. It does not show the same issue but the attachment system doesn't allow me to attach a big enough file

comment:1 by Carl Eugen Hoyos, 11 years ago

Component: FFmpegavformat
Keywords: mpegts added; No Program removed

This depends at the moment on ticket #2441.

However, please upload a sample that allows to reproduce your original problem to http://www1.datafilehost.com/
Is this also reproducible with current git head?

comment:2 by Nathan Bollom, 11 years ago

File is uploaded: http://www1.datafilehost.com/d/eea09fa6

Output from head version:

ffmpeg -i part.ts 
ffmpeg version N-52165-gfe1de12 Copyright (c) 2000-2013 the FFmpeg developers
  built on Apr 17 2013 09:23:20 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
  configuration: 
  libavutil      52. 26.100 / 52. 26.100
  libavcodec     55.  2.100 / 55.  2.100
  libavformat    55.  2.100 / 55.  2.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 56.101 /  3. 56.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
[mpegts @ 0x7fda6b00f200] max_analyze_duration 5000000 reached at 5000000 microseconds
[mpegts @ 0x7fda6b00f200] Could not find codec parameters for stream 3 (Unknown: none ([11][0][0][0] / 0x000B)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[NULL @ 0x7fda6b024800] start time is not set in estimate_timings_from_pts
[mpegts @ 0x7fda6b00f200] PES packet size mismatch
Input #0, mpegts, from 'part.ts':
  Duration: N/A, start: 38349.680033, bitrate: N/A
  Program 544 
  Program 545 
  Program 546 
  Program 547 
  Program 548 
  Program 550 
  Program 551 
  Program 1057 
    Stream #0:5[0x207]: Video: mpeg2video ([2][0][0][0] / 0x0002), 90k tbn
    Stream #0:6[0x2d0](eng): Audio: mp3 ([4][0][0][0] / 0x0004), 0 channels
    Stream #0:4[0x247](eng): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Stream #0:7[0x901]: Unknown: none ([11][0][0][0] / 0x000B)
  Program 1058 
  Program 1059 
  Program 1060 
  No Program
    Stream #0:0[0x200]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x28a](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 256 kb/s
    Stream #0:2[0x240](eng): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Stream #0:3[0x1388]: Unknown: none ([11][0][0][0] / 0x000B)
At least one output file must be specified

comment:3 by Carl Eugen Hoyos, 11 years ago

Version: 1.2git-master

I wonder if there is a bug:
FFmpeg reports "max_analyze_duration reached" and raising the value fixes the issue:

$ ffmpeg -probesize 12M -analyzeduration 21M -i part.ts
ffmpeg version N-52167-gb8edf91 Copyright (c) 2000-2013 the FFmpeg developers
  built on Apr 17 2013 09:23:10 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack
  libavutil      52. 26.100 / 52. 26.100
  libavcodec     55.  2.100 / 55.  2.100
  libavformat    55.  2.100 / 55.  2.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 56.101 /  3. 56.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
[mp1 @ 0x400b840] Header missing
    Last message repeated 5 times
[mpeg2video @ 0x400c280] Invalid frame dimensions 0x0.
[mp1 @ 0x400b840] Header missing
    Last message repeated 1 times
[mpeg2video @ 0x400c280] Invalid frame dimensions 0x0.
[mp1 @ 0x400b840] Header missing
[mpeg2video @ 0x400c280] Invalid frame dimensions 0x0.
[mp1 @ 0x400b840] Header missing
[mpeg2video @ 0x400c280] Invalid frame dimensions 0x0.
[mp1 @ 0x400b840] Header missing
    Last message repeated 1 times
[mpeg2video @ 0x400c280] Invalid frame dimensions 0x0.
[mp1 @ 0x400b840] Header missing
[mpeg2video @ 0x400c280] Invalid frame dimensions 0x0.
    Last message repeated 1 times
[mp1 @ 0x400b840] Header missing
    Last message repeated 6 times
[mpeg2video @ 0x400c280] Invalid frame dimensions 0x0.
[mp1 @ 0x400b840] Header missing
    Last message repeated 87 times
[mpegts @ 0x339f220] Stream #3: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x339f220] Stream #7: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x339f220] Could not find codec parameters for stream 3 (Unknown: none ([11][0][0][0] / 0x000B)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x339f220] decoding for stream 4 failed
[mpegts @ 0x339f220] Could not find codec parameters for stream 4 (Audio: mp1 ([6][0][0][0] / 0x0006), 0 channels, s16p): unspecified frame size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x339f220] Could not find codec parameters for stream 7 (Unknown: none ([11][0][0][0] / 0x000B)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[NULL @ 0x33c6260] start time is not set in estimate_timings_from_pts
[NULL @ 0x400d7c0] start time is not set in estimate_timings_from_pts
[mpegts @ 0x339f220] PES packet size mismatch
Input #0, mpegts, from 'part.ts':
  Duration: 00:00:38.38, start: 16149.369244, bitrate: 6557 kb/s
  Program 544
  Program 545
  Program 546
  Program 547
  Program 548
  Program 550
  Program 551
  Program 1057
    Stream #0:5[0x207]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:6[0x2d0](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 256 kb/s
    Stream #0:4[0x247](eng): Audio: mp1 ([6][0][0][0] / 0x0006), 0 channels, s16p
    Stream #0:7[0x901]: Unknown: none ([11][0][0][0] / 0x000B)
  Program 1058
  Program 1059
  Program 1060
  No Program
    Stream #0:0[0x200]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x28a](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 256 kb/s
    Stream #0:2[0x240](eng): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Stream #0:3[0x1388]: Unknown: none ([11][0][0][0] / 0x000B)
At least one output file must be specified

The teletext streams are empty afaict, so misdetecting them is no bug imo.

in reply to:  3 ; comment:4 by Carl Eugen Hoyos, 10 years ago

Replying to cehoyos:

The teletext streams are empty afaict, so misdetecting them is no bug imo.

Both programs contain a teletext stream with subtitles.

in reply to:  4 comment:5 by Carl Eugen Hoyos, 10 years ago

Replying to cehoyos:

Replying to cehoyos:

The teletext streams are empty afaict, so misdetecting them is no bug imo.

Both programs contain a teletext stream with subtitles, see ticket #3766.

comment:6 by Carl Eugen Hoyos, 10 years ago

Resolution: invalid
Status: newclosed

If I cut the sample in a 10M and a 20M segment, both segments show the whole scene for one of the two programs. Afaict, this indicates that two independent transport streams were concatenated, I don't think "duration" makes sense for such a file.
Please reopen if you think my analysis is wrong.

Note: See TracTickets for help on using tickets.