FFmpeg git repo
Go to file
Aman Gupta 9152c1e495 avformat/mpegts: parse sections with multiple tables
Fixes PMT parsing in some mpegts streams which contain
multiple tables within the PMT pid. Previously, the parser
assumed only one table was present in each packet, and discarded
the rest of the section data after attempting to parse the first
table.

A similar issue was documented in the BeyondTV software[1], which
helped me diagnose the same bug in the ffmpeg mpegts demuxer. I also
tried DVBInspector, libdvbpsi's dvbinfo, and tstools' tsinfo to
help debug. The former two properly read PMTs with multiple tables,
whereas the last has the same bug as ffmpeg.

I've created a minimal sample[2] which contains the combined PMT.
Here's what ffmpeg probe shows before and after this patch:

Before:

    Input #0, mpegts, from 'combined-pmt-tids.ts':
      Duration: 00:00:01.08, start: 4932.966167, bitrate: 741 kb/s
      Program 1
      No Program
        Stream #0:0[0xf9d]: Audio: ac3, 48000 Hz, mono, fltp, 96 kb/s
        Stream #0:1[0xf9b]: Audio: mp3, 0 channels, fltp
        Stream #0:2[0xf9c]: Unknown: none

After:

    Input #0, mpegts, from 'combined-pmt-tids.ts':
      Duration: 00:00:01.11, start: 4932.966167, bitrate: 718 kb/s
      Program 1
        Stream #0:0[0xf9b]: Video: mpeg2video ([2][0][0][0] / 0x0002), none(tv, top first), 29.97 fps, 29.97 tbr, 90k tbn, 90k tbc
        Stream #0:1[0xf9c](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 384 kb/s
        Stream #0:2[0xf9d](spa): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, mono, fltp, 96 kb/s

With the patch, the PMT is parsed correctly so the streams are
created in the correct order, are associated with "Program 1",
and their codecs are set correctly.

[1] http://forums.snapstream.com/vb/showpost.php?p=343816&postcount=201
[2] https://s3.amazonaws.com/tmm1/combined-pmt-tids.ts

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-12 11:50:00 -07:00
compat compat: remove in-tree NVidia headers 2018-02-27 16:22:12 +01:00
doc avfilter: add fftdnoiz filter 2018-05-10 14:44:17 +02:00
ffbuild Merge commit '17b6c7efb471e8ff1b8a7271f6531ba1d52bf69c' 2017-11-12 01:02:02 -03:00
fftools ffprobe: fix SEGV when new streams are added 2018-05-09 12:30:17 -07:00
libavcodec cbs_h264: Add support for mastering display SEI messages 2018-05-10 23:54:01 +01:00
libavdevice lavd/v4l2: Add ARGB and XRGB packed pixel formats 2018-05-10 22:40:57 +02:00
libavfilter avfilter/vf_maskedmerge: add slice threading 2018-05-12 15:46:28 +02:00
libavformat avformat/mpegts: parse sections with multiple tables 2018-05-12 11:50:00 -07:00
libavresample avresample: remove deprecated attribute from the AVAudioResampleContext struct 2018-01-09 10:56:53 -03:00
libavutil hwcontext_vaapi: Add an assert in vaapi_map_from_drm() 2018-05-10 19:52:53 +01:00
libpostproc Bump minor versions after release/4.0 branching 2018-04-16 12:35:12 +02:00
libswresample swresample/arm: rename labels to fix xcode build error 2018-04-28 18:08:52 +02:00
libswscale swscale: add gray14 support 2018-05-05 21:35:31 +02:00
presets
tests avformat/mxfenc: Add Sample width/height/x offset/y offset, Display x offset and F2 offset 2018-05-12 01:08:01 +02:00
tools lav*,tests: remove several register_all calls 2018-04-02 03:26:22 +01:00
.gitattributes
.gitignore Remove the ffserver program 2018-01-06 18:31:37 +00:00
.travis.yml Merge commit '4809781586d1c956005f72946a2aab5915eab350' 2017-10-28 15:08:31 -03:00
CONTRIBUTING.md
COPYING.GPLv2
COPYING.GPLv3
COPYING.LGPLv2.1
COPYING.LGPLv3
CREDITS
Changelog avfilter: add fftdnoiz filter 2018-05-10 14:44:17 +02:00
INSTALL.md
LICENSE.md
MAINTAINERS mpegvideo: remove support for libxvid's RC system 2018-05-05 19:41:30 +01:00
Makefile Revert "lavd: add new API for iterating input and output devices" 2018-03-31 23:26:31 +01:00
README.md Remove the ffserver program 2018-01-06 18:31:37 +00:00
RELEASE RELEASE: update for git after 3.4 branchpoint 2017-10-11 02:46:23 +02:00
configure avfilter: add fftdnoiz filter 2018-05-10 14:44:17 +02:00

README.md

FFmpeg README

FFmpeg is a collection of libraries and tools to process multimedia content such as audio, video, subtitles and related metadata.

Libraries

  • libavcodec provides implementation of a wider range of codecs.
  • libavformat implements streaming protocols, container formats and basic I/O access.
  • libavutil includes hashers, decompressors and miscellaneous utility functions.
  • libavfilter provides a mean to alter decoded Audio and Video through chain of filters.
  • libavdevice provides an abstraction to access capture and playback devices.
  • libswresample implements audio mixing and resampling routines.
  • libswscale implements color conversion and scaling routines.

Tools

  • ffmpeg is a command line toolbox to manipulate, convert and stream multimedia content.
  • ffplay is a minimalistic multimedia player.
  • ffprobe is a simple analysis tool to inspect multimedia content.
  • Additional small tools such as aviocat, ismindex and qt-faststart.

Documentation

The offline documentation is available in the doc/ directory.

The online documentation is available in the main website and in the wiki.

Examples

Coding examples are available in the doc/examples directory.

License

FFmpeg codebase is mainly LGPL-licensed with optional components licensed under GPL. Please refer to the LICENSE file for detailed information.

Contributing

Patches should be submitted to the ffmpeg-devel mailing list using git format-patch or git send-email. Github pull requests should be avoided because they are not part of our review process and will be ignored.