[FFmpeg-devel] [PATCH] avformat/mpegts: add skip_unknown_pmt option
wm4
nfxjfg at googlemail.com
Fri May 18 12:50:19 EEST 2018
On Thu, 17 May 2018 17:21:42 -0700
Aman Gupta <aman at tmm1.net> wrote:
> On Thu, May 17, 2018 at 5:04 PM, Aman Gupta <ffmpeg at tmm1.net> wrote:
>
> > From: Aman Gupta <aman at tmm1.net>
> >
> > Some filtered mpegts streams may erroneously include PMTs for programs
> > that are not advertised in the PAT. This confuses ffmpeg and most
> > players because multiple audio/video streams are created and it is
> > unclear which ones actually contain data.
> >
> > See for example https://tmm1.s3.amazonaws.com/unknown-pmts.ts
> >
> > Before:
> >
> > Input #0, mpegts, from 'unknown-pmts.ts':
> > Duration: 00:00:10.11, start: 80741.189700, bitrate: 9655 kb/s
> > Program 4
> > Stream #0:2[0x41]: Video: mpeg2video (Main) ([2][0][0][0] /
> > 0x0002), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9],
> > Closed Captions, 11063 kb/s, 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc
> > Stream #0:3[0x44](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz,
> > 5.1(side), fltp, 384 kb/s
> > Stream #0:4[0x45](spa): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz,
> > stereo, fltp, 128 kb/s
> > No Program
> > Stream #0:0[0x31]: Video: mpeg2video ([2][0][0][0] / 0x0002),
> > none(tv), 90k tbr, 90k tbn, 90k tbc
> > Stream #0:1[0x34](eng): Audio: ac3 (AC-3 / 0x332D4341), 0
> > channels, fltp
> > Stream #0:5[0x51]: Video: mpeg2video ([2][0][0][0] / 0x0002),
> > none, 90k tbr, 90k tbn
> > Stream #0:6[0x54](eng): Audio: ac3 (AC-3 / 0x332D4341), 0 channels
> >
> > With skip_unknown_pmt=1:
> >
> > Input #0, mpegts, from 'unknown-pmts.ts':
> > Duration: 00:00:10.11, start: 80741.189700, bitrate: 9655 kb/s
> > Program 4
> > Stream #0:0[0x41]: Video: mpeg2video (Main) ([2][0][0][0] /
> > 0x0002), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9],
> > Closed Captions, 11063 kb/s, 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc
> > Stream #0:1[0x44](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz,
> > 5.1(side), fltp, 384 kb/s
> > Stream #0:2[0x45](spa): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz,
> > stereo, fltp, 128 kb/s
> >
> > Signed-off-by: Aman Gupta <aman at tmm1.net>
> > ---
> > doc/demuxers.texi | 3 +++
> > libavformat/mpegts.c | 5 +++++
> > 2 files changed, 8 insertions(+)
> >
> > diff --git a/doc/demuxers.texi b/doc/demuxers.texi
> > index e7c2abce57..1d2ee5bf37 100644
> > --- a/doc/demuxers.texi
> > +++ b/doc/demuxers.texi
> > @@ -538,6 +538,9 @@ This demuxer accepts the following options:
> > Set size limit for looking up a new synchronization. Default value is
> > 65536.
> >
> > + at item skip_unknown_pmt
> > +Skip PMTs for programs not defined in the PAT. Default value is 0.
> >
>
> Maybe it's worth turning this option on by default?
Sounds reasonable, but I don't know too much about TS.
> We could also add debug/verbose logging when these PMTs are skipped,
> but since it would happen every time the PMT is received it could become
> very noisy.
Just make it a higher log level.
More information about the ffmpeg-devel
mailing list