Opened 12 years ago

Last modified 12 years ago

#1719 open defect

MPEG-TS demuxer : don't parse a PAT (and clear programs) if its version number is the same as the previous one

Reported by: Aurélien Nephtali Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mpegts demuxer pat pmt
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

ffmpeg -i euronews_long_pmt_over_pat.ts
ffmpeg version N-44162-gfc15f58 Copyright (c) 2000-2012 the FFmpeg developers   
  built on Sep  5 2012 12:24:04 with gcc 4.7 (Debian 4.7.1-2)
  configuration: --prefix=/home/aurelien/local --enable-postproc --enable-nonfree --enable-gpl --enable-libopencore-amrnb --enable-libfaac --enable-libmp3lame --enable-shared --enable-libxvid --enable-libx264 --extra-cflags=-I/home/aurelien/local/include --extra-ldflags=-L/home/aurelien/local/lib --enable-version3 --disable-optimizations --enable-libfreetype --disable-stripping --enable-libaacplus --enable-libfaac
  libavutil      51. 70.100 / 51. 70.100
  libavcodec     54. 55.100 / 54. 55.100
  libavformat    54. 25.104 / 54. 25.104
  libavdevice    54.  2.100 / 54.  2.100
  libavfilter     3. 15.103 /  3. 15.103
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[mpegts @ 0x1b61240] probed stream 1 failed
[mpegts @ 0x1b61240] max_analyze_duration 5000000 reached at 5016000
[mpegts @ 0x1b61240] Could not find codec parameters for stream 1 (Unknown: none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x1b61240] PES packet size mismatch
    Last message repeated 9 times
Input #0, mpegts, from '/home/dump/euronews_long_pmt_over_pat.ts':
  Duration: 00:02:59.27, start: 10770.595789, bitrate: 4407 kb/s
  Program 8202
    Metadata:
      service_name    : ARM_1
      service_provider: GlobeCast   
[...]  
  No Program
    Stream #0:0[0x8c6]: Audio: mp2, 48000 Hz, mono, s16, 64 kb/s
    Stream #0:1[0x300]: Unknown: none
    Stream #0:2[0x8ad]: Video: mpeg2video (Main), yuv420p, 720x576 [SAR 64:45 DAR 16:9], 3240 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:3[0x8c1]: Audio: mp2, 48000 Hz, mono, s16, 64 kb/s
    Stream #0:4[0x8bf]: Audio: mp2, 48000 Hz, mono, s16, 64 kb/s
    Stream #0:5[0x8c0]: Audio: mp2, 48000 Hz, mono, s16, 64 kb/s
    Stream #0:6[0x8bd]: Audio: mp2, 48000 Hz, mono, s16, 64 kb/s
    Stream #0:7[0x8be]: Audio: mp2, 48000 Hz, mono, s16, 64 kb/s
    Stream #0:8[0x8bb]: Audio: mp2, 48000 Hz, mono, s16, 64 kb/s
    Stream #0:9[0x8ba]: Audio: mp2, 48000 Hz, mono, s16, 64 kb/s
    Stream #0:10[0x8bc]: Audio: mp2, 48000 Hz, mono, s16, 64 kb/s
    Stream #0:11[0x8b9]: Audio: mp2, 48000 Hz, mono, s16, 64 kb/s
    Stream #0:12[0x8b8]: Audio: mp2, 48000 Hz, mono, s16, 64 kb/s
    Stream #0:13[0x8b7]: Audio: mp2, 48000 Hz, mono, s16, 64 kb/s

The stream looks like :
[PAT]
[PAT]
[PAT]
[PMT_first packet]
[PAT]
[PAT]
[PAT]
[PMT_last_packet]
[etc...]

In pat_cb(), clear_programs() is called unconditionally so the when the second half of the PMT is received it will be discarded.
The attached patch fixes that.

The sample is on the ffmpeg ftp : euronews_long_pmt_over_pat.ts

Attachments (1)

mpegts_fix_long_pmt.diff (1.3 KB ) - added by Aurélien Nephtali 12 years ago.

Download all attachments as: .zip

Change History (6)

by Aurélien Nephtali, 12 years ago

Attachment: mpegts_fix_long_pmt.diff added

comment:1 by Michael Niedermayer, 12 years ago

Reproduced by developer: set
Status: newopen

If i understand the spec correctly, the PAT can be in multiple sections and each would have matching versions so stoping with an equal version would break such huge PATs. Also with concatenation theres a 1 in 32 chance the version will be the same, similar can happen with seeking if the reference version isnt reset. I thus think a PAT with matching version should not be discarded and this problem be solved differently

comment:2 by Aurélien Nephtali, 12 years ago

Agreed (however the demuxer does not support tables with multiple sections anyway).

comment:3 by Michael Niedermayer, 12 years ago

does someone have a testcase with multiple section PAT ?

comment:4 by Aurélien Nephtali, 12 years ago

I only have samples with a very long section, not multiple.
Actually I never saw tables with multiple sections (except EIT).

comment:5 by Michael Niedermayer, 12 years ago

then maybe we can ignore the multiple section issue and just issue a warning. The issue with the data changing while version does not remains though

Note: See TracTickets for help on using tickets.