No description
Find a file
Aman Gupta c343eabfb7 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>
(cherry picked from commit 9152c1e495)
2018-05-18 19:16:35 -07:00
compat compat: remove in-tree NVidia headers 2018-02-27 16:22:12 +01:00
doc doc/APIchanges: Fix typos in hashes 2018-04-20 01:53:41 +02:00
ffbuild Merge commit '17b6c7efb4' 2017-11-12 01:02:02 -03:00
fftools ffplay: Fix realloc_texture when input texture is NULL. 2018-05-01 21:21:02 +02:00
libavcodec avcodec/mediacodecdec: add workaround for buggy amlogic mpeg2 decoder 2018-05-18 19:16:34 -07:00
libavdevice avdevice/decklink_dec: unref packets on avpacket_queue_put error 2018-05-01 21:22:33 +02:00
libavfilter lavf/qsv: clone the frame which may be managed by framework 2018-04-23 22:56:18 +01:00
libavformat avformat/mpegts: parse sections with multiple tables 2018-05-18 19:16:35 -07:00
libavresample avresample: remove deprecated attribute from the AVAudioResampleContext struct 2018-01-09 10:56:53 -03:00
libavutil hwcontext_vaapi: Fix compilation with libva versions < 1.4.0 2018-04-27 23:42:07 +01:00
libpostproc Bump minor versions for branching release/4.0 2018-04-16 12:35:12 +02:00
libswresample swresample/arm: remove unintentional relocation. 2018-04-20 01:53:41 +02:00
libswscale Bump minor versions for branching release/4.0 2018-04-16 12:35:12 +02:00
presets presets: remove moldering iPod presets 2014-06-17 16:15:04 -08:00
tests avcodec/xwddec: fix palette alpha 2018-05-16 22:50:18 +02:00
tools lav*,tests: remove several register_all calls 2018-04-02 03:26:22 +01:00
.gitattributes fate: add SCC test 2017-01-27 17:06:42 +01:00
.gitignore Remove the ffserver program 2018-01-06 18:31:37 +00:00
.travis.yml Merge commit '4809781586' 2017-10-28 15:08:31 -03:00
Changelog Changelog: replace <next> by 4.0 2018-04-20 01:55:05 +02:00
configure configure: fix configure check for lilv-0 2018-05-13 19:18:48 +03:00
CONTRIBUTING.md Add CONTRIBUTING.md 2016-09-18 10:02:13 +01:00
COPYING.GPLv2
COPYING.GPLv3
COPYING.LGPLv2.1
COPYING.LGPLv3
CREDITS
INSTALL.md
LICENSE.md Merge commit '4fef648d10' 2017-03-15 22:07:47 +01:00
MAINTAINERS MAINTAINERS: add myself to documentation section 2018-04-13 09:40:27 -08: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 Update bunch of versions to 4.0 2018-04-16 12:42:29 +02:00
RELEASE_NOTES add release notes based on release 3.4 2018-04-16 12:41:03 +02:00

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.