Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#2186 closed defect (fixed)

program detection in transport stream broken

Reported by: hugo Owned by:
Priority: important Component: avformat
Version: git-master Keywords: mpegts regression
Cc: Hendrik Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description (last modified by Carl Eugen Hoyos)

im using a multicast stream as input of ffmpeg, running on Centos 6.3

10.5 version from rpmfusion can identify the programs on the stream , but newer versions do not .
i test even 10.6 version from rpmfusion and 1.1.1 from sources , with same result:

this is the command used :
# /usr/bin/ffmpeg -i 'udp://@230.20.20.21:32960?overrun_nonfatal=1' -bsf h264_mp4toannexb -map 0:p:304:0 -c:v libx264 -preset medium -g 25 -s 1280x720 -r 30000/1001 -filter:v yadif -b:v 2000k -bt 200k -map 0:p:304:1 -c:a aac -ac 2 -ar 44100 -ab 128k -vol 200 -strict -2 -f mpegts test.ts

result with version 10.5 :

ffmpeg version 0.10.5 Copyright (c) 2000-2012 the FFmpeg developers built on Oct  7 2012 19:01:46 with gcc 4.4.6 20110731 (Red Hat 4.4.6-3)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-libass --enable-libcdio --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
  libavutil      51. 35.100 / 51. 35.100
  libavcodec     53. 61.100 / 53. 61.100
  libavformat    53. 32.100 / 53. 32.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 61.100 /  2. 61.100
  libswscale      2.  1.100 /  2.  2.100
  libswresample   0.  6.100 /  0. 17.102
  libpostproc    52.  0.100 / 52.  2.100



Input #0, mpegts, from 'udp://@230.20.20.21:32960?overrun_nonfatal=1':
  Duration: N/A, start: 27641.679322, bitrate: 704 kb/s
  Program 304
    Metadata:
      service_name    : Cinecanal HD
      service_provider:
    Stream #0:11[0x580]: Video: h264 ([27][0][0][0] / 0x001B), 29.97 tbr, 90k tbn
    Stream #0:13[0x581]: Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz, 5.1(side), s16, 384 kb/s
    Stream #0:14[0xbc2](spa): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Stream #0:15[0xbc3](spa): Unknown: none ([130][0][0][0] / 0x0082)
  Program 305
    Metadata:
      service_name    : Universal HD
      service_provider:
    Stream #0:5[0xa00]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 89.91 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:6[0x9d8](spa): Audio: ac3 ([6][0][0][0] / 0x0006), 0 channels, s16
    Stream #0:7[0x9da](eng): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz, stereo, s16, 128 kb/s
    Stream #0:8[0x9ee](spa): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Stream #0:9[0x9ed](eng): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Stream #0:10[0x9ef](spa): Unknown: none ([130][0][0][0] / 0x0082)
  Program 203
    Metadata:
      service_name    : HBO Plus MP-4
      service_provider:
    Stream #0:0[0xa94]: Video: h264 ([27][0][0][0] / 0x001B), 50 tbr, 90k tbn, 180k tbc
    Stream #0:1[0xa95](eng): Audio: ac3 (AC-3 / 0x332D4341), 0 channels, s16
    Stream #0:2[0xa96](spa): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, s16, 192 kb/s
    Stream #0:3[0xa97](spa): Unknown: none ([130][0][0][0] / 0x0082)
    Stream #0:4[0xa98](spa): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
  Program 301
    Metadata:
      service_name    : TV Publica HD
      service_provider:
    Stream #0:16[0x102]: Video: h264 ([27][0][0][0] / 0x001B), 50 tbr, 90k tbn
    Stream #0:12[0x103]: Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, s16

###################
same command , but with the newly 1.1.1 compiled from source :
###################

ffmpeg version N-49198-g70270f2 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jan 23 2013 16:19:29 with gcc 4.4.6 (GCC) 20120305 (Red Hat 4.4.6-4)
  configuration: --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx --enable-libass --enable-bzlib --enable-zlib --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libvo-aacenc --enable-libxvid --disable-ffplay --enable-shared --enable-gpl --enable-postproc --enable-nonfree --enable-avfilter --enable-pthreads --extra-cflags=-fPIC --arch=x86_64
  libavutil      52. 15.100 / 52. 15.100
  libavcodec     54. 90.100 / 54. 90.100
  libavformat    54. 61.103 / 54. 61.103
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 33.100 /  3. 33.100
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100

Input #0, mpegts, from 'udp://@230.20.20.21:32960?overrun_nonfatal=1':
  Duration: N/A, start: 27971.116400, bitrate: 576 kb/s
  Program 304
    Metadata:
      service_name    : Cinecanal HD
      service_provider:
  Program 305
    Metadata:
      service_name    : Universal HD
      service_provider:
  Program 203
    Metadata:
      service_name    : HBO Plus MP-4
      service_provider:
    Stream #0:0[0xa94]: Video: h264 ([27][0][0][0] / 0x001B), 50 tbr, 90k tbn, 180k tbc
    Stream #0:1[0xa95](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:2[0xa96](spa): Audio: ac3 (AC-3 / 0x332D4341), 0 channels, fltp
    Stream #0:3[0xa97](spa): Unknown: none ([130][0][0][0] / 0x0082)
    Stream #0:4[0xa98](spa): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
  Program 301
    Metadata:
      service_name    : TV Publica HD
      service_provider:
  No Program
    Stream #0:5[0x580]: Video: h264 ([27][0][0][0] / 0x001B), 29.97 tbr, 90k tbn
    Stream #0:6[0x581]: Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz, 5.1(side), fltp, 384 kb/s
    Stream #0:7[0xbc2](spa): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Stream #0:8[0xbc3](spa): Unknown: none ([130][0][0][0] / 0x0082)
    Stream #0:9[0xa00]: Video: h264 ([27][0][0][0] / 0x001B), 29.97 tbr, 90k tbn
    Stream #0:10[0x9d8](spa): Audio: ac3 ([6][0][0][0] / 0x0006), 0 channels
    Stream #0:11[0x9da](eng): Audio: ac3 ([6][0][0][0] / 0x0006), 0 channels
    Stream #0:12[0x9ee](spa): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Stream #0:13[0x9ed](eng): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Stream #0:14[0x9ef](spa): Unknown: none ([130][0][0][0] / 0x0082)
    Stream #0:15[0x102]: Video: h264 ([27][0][0][0] / 0x001B), 50 tbr, 90k tbn
    Stream #0:16[0x103]: Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp
Stream map '0:p:304:0' matches no streams.

i even try to select the streams from #0x580 as example , gave me an error. trying to select with 0:0 select video stream ramdomly .

of course i like to use the newer version , works better transcoding and use less cpu , but i cant to select the right stream

Change History (7)

comment:1 by Carl Eugen Hoyos, 11 years ago

Component: undeterminedavformat
Description: modified (diff)
Keywords: mpegts regression added; stream map selection removed
Priority: normalimportant
Reproduced by developer: set
Status: newopen
Summary: udp stream input differences between 10.5 and newersprogram detection in transport stream broken
Version: unspecifiedgit-master

Regression since 4c41fc8.

Until this is fixed, you can use version 1.0.3.

comment:2 by Hendrik, 11 years ago

I have another sample file which has this problem, reverting 4c41fc8 fixes it, Michaels patch on the ML however does not.

I tried cutting a small sample out of it, but that sample did not reproduce the problem anymore.
If anyone is interested in the 1.2gb file, i can make it available.

For the record, here are ffmpeg outputs, from "ffmpeg -v 9 -loglevel 99 -i file.ts"

Broken (git master)

ffmpeg version N-49608-g2b20397 Copyright (c) 2000-2013 the FFmpeg developers
  built on Feb  5 2013 17:52:45 with gcc 4.7.2 (GCC)
  configuration: --enable-gpl
  libavutil      52. 17.101 / 52. 17.101
  libavcodec     54. 91.100 / 54. 91.100
  libavformat    54. 61.104 / 54. 61.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 35.101 /  3. 35.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set libav* logging level) with argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set libav* logging level) with argument '99'.
Reading option '-i' ... matched as input file with argument 'd:/Downloads/Pirunpelto.ts'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set libav* logging level) with argument 9.
Successfully parsed a group of options.
Parsing a group of options: input file d:/Downloads/Pirunpelto.ts.
Successfully parsed a group of options.
Opening an input file: d:/Downloads/Pirunpelto.ts.
[mpegts @ 02F69BC0] Format mpegts probed with size=2048 and score=100
[mpegts @ 02F69BC0] stream=0 stream_type=3 pid=44 prog_reg_desc=
[mpegts @ 02F69BC0] stream=1 stream_type=2 pid=45 prog_reg_desc=
[mpegts @ 02F69BC0] File position before avformat_find_stream_info() is 0
[mpegts @ 02F69BC0] max_analyze_duration 5000000 reached at 5016000 microseconds
[mpegts @ 02F69BC0] stream=2 stream_type=0 pid=47 prog_reg_desc=
[mpegts @ 02F69BC0] probing stream 2 pp:2500
[mpegts @ 02F69BC0] Probe with size=672, packets=1 detected mp3 with score=1
[mpegts @ 02F69BC0] probing stream 2 pp:2499
[mpegts @ 02F69BC0] Probe with size=1344, packets=2 detected mp3 with score=1
[mpegts @ 02F69BC0] probing stream 2 pp:2498
[mpegts @ 02F69BC0] probing stream 2 pp:2497
[mpegts @ 02F69BC0] Probe with size=2688, packets=4 detected mp3 with score=51
[mpegts @ 02F69BC0] probed stream 2
[mpegts @ 02F69BC0] stream=3 stream_type=6 pid=46 prog_reg_desc=
[mpegts @ 02F69BC0] stream=2 stream_type=3 pid=47 prog_reg_desc=
[mpegts @ 02F69BC0] PES packet size mismatch
[mpegts @ 02F69BC0] File position after avformat_find_stream_info() is 0
Input #0, mpegts, from 'd:/Downloads/Pirunpelto.ts':
  Duration: 00:55:58.32, start: 17274.978278, bitrate: 3212 kb/s
  Program 1 
    Stream #0:1[0x45], 112, 1/90000: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 1/50, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:3[0x46](fin), 0, 1/90000: Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Stream #0:2[0x47](eng), 0, 1/90000: Audio: mp3 ([3][0][0][0] / 0x0003), 0 channels
  No Program
    Stream #0:0[0x44](fin), 211, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 224 kb/s
Successfully opened the file.
At least one output file must be specified
[AVIOContext @ 02F72240] Statistics: 2510992 bytes read, 2 seeks

Working (git master with 4c41fc8 reverted)

ffmpeg version N-49609-g8af37e4 Copyright (c) 2000-2013 the FFmpeg developers
  built on Feb  5 2013 17:58:16 with gcc 4.7.2 (GCC)
  configuration: --enable-gpl
  libavutil      52. 17.101 / 52. 17.101
  libavcodec     54. 91.100 / 54. 91.100
  libavformat    54. 61.104 / 54. 61.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 35.101 /  3. 35.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set libav* logging level) with argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set libav* logging level) with argument '99'.
Reading option '-i' ... matched as input file with argument 'd:/Downloads/Pirunpelto.ts'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set libav* logging level) with argument 9.
Successfully parsed a group of options.
Parsing a group of options: input file d:/Downloads/Pirunpelto.ts.
Successfully parsed a group of options.
Opening an input file: d:/Downloads/Pirunpelto.ts.
[mpegts @ 02E79BC0] Format mpegts probed with size=2048 and score=100
[mpegts @ 02E79BC0] stream=0 stream_type=3 pid=44 prog_reg_desc=
[mpegts @ 02E79BC0] stream=1 stream_type=2 pid=45 prog_reg_desc=
[mpegts @ 02E79BC0] File position before avformat_find_stream_info() is 0
[mpegts @ 02E79BC0] max_analyze_duration 5000000 reached at 5016000 microseconds
[mpegts @ 02E79BC0] stream=2 stream_type=0 pid=47 prog_reg_desc=
[mpegts @ 02E79BC0] probing stream 2 pp:2500
[mpegts @ 02E79BC0] Probe with size=672, packets=1 detected mp3 with score=1
[mpegts @ 02E79BC0] probing stream 2 pp:2499
[mpegts @ 02E79BC0] Probe with size=1344, packets=2 detected mp3 with score=1
[mpegts @ 02E79BC0] probing stream 2 pp:2498
[mpegts @ 02E79BC0] probing stream 2 pp:2497
[mpegts @ 02E79BC0] Probe with size=2688, packets=4 detected mp3 with score=51
[mpegts @ 02E79BC0] probed stream 2
[mpegts @ 02E79BC0] stream=3 stream_type=6 pid=46 prog_reg_desc=
[mpegts @ 02E79BC0] stream=2 stream_type=3 pid=47 prog_reg_desc=
[mpegts @ 02E79BC0] PES packet size mismatch
[mpegts @ 02E79BC0] File position after avformat_find_stream_info() is 0
Input #0, mpegts, from 'd:/Downloads/Pirunpelto.ts':
  Duration: 00:55:58.97, start: 17274.978278, bitrate: 3211 kb/s
  Program 1 
    Stream #0:0[0x44](fin), 211, 1/90000: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 224 kb/s
    Stream #0:1[0x45], 112, 1/90000: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 1/50, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:3[0x46](fin), 0, 1/90000: Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Stream #0:2[0x47](eng), 0, 1/90000: Audio: mp3 ([3][0][0][0] / 0x0003), 0 channels
Successfully opened the file.
At least one output file must be specified
[AVIOContext @ 02E82240] Statistics: 2510992 bytes read, 2 seeks

in reply to:  2 comment:3 by Carl Eugen Hoyos, 11 years ago

Cc: Hendrik added

Replying to heleppkes:

I tried cutting a small sample out of it, but that sample did not reproduce the problem anymore.

Iirc, cutting the sample to ~100MB should allow to reproduce the regression.
If not, please consider providing the complete sample.

in reply to:  2 comment:4 by Michael Niedermayer, 11 years ago

Replying to heleppkes:

I have another sample file which has this problem, reverting 4c41fc8 fixes it, Michaels patch on the ML however does not.

I tried cutting a small sample out of it, but that sample did not reproduce the problem anymore.
If anyone is interested in the 1.2gb file, i can make it available.

Iam interrested if a smaller file isnt enough

Thanks

comment:5 by Carl Eugen Hoyos, 11 years ago

Resolution: fixed
Status: openclosed

Michael's patch was committed and backported, if this problem is still reproducible with current git head or a release branch, please provide a sample (not matter the size) and reopen this ticket.

comment:6 by FernetMenta, 11 years ago

unfortunately this fix breaks the idea of detecting pmt changes again. Consider a live tv stream and you have selected an audio track with original language. Next show starts and the audio track disappears. Without player having a chance to detect pmt changes it can't switch tracks.

comment:7 by FernetMenta, 11 years ago

sorry, disregard my comment. the pmt change detection still works.

Note: See TracTickets for help on using tickets.