ffmpeg/doc
Aman Gupta 16b4f97b72 avformat/mpegts: add merge_pmt_versions option
This new optional flag makes it easier to deal with mpegts
samples where the PMT is updated and elementary streams move
to different PIDs in the middle of playback.

Previously, new AVStreams were created per PID, and it was up
to the user to figure out which streams had migrated to a new PID
(by iterating over the list of AVProgram and making guesses), and
switch seamlessly to the new AVStream during playback.

Transcoding or remuxing these streams with ffmpeg on the CLI was
also quite painful, and the user would need to extract each set
of PIDs into a separate file and then stitch them back together.

With this new option, the mpegts demuxer will automatically detect
PMT changes and feed data from the new PID to the original AVStream
that was created for the orignal PID. For mpegts samples with
stream_identifier_descriptor available, the unique ID is used to
merge PIDs together. If the stream id is not available, the demuxer
attempts to map PIDs based on their position within the PMT.

With this change, I am able to playback and transcode/remux these
two samples which previously caused issues:

    https://tmm1.s3.amazonaws.com/pmt-version-change.ts
    https://kuroko.fushizen.eu/videos/pid_switch_sample.ts

I also have another longer sample in which the PMT changes
repeatedly and ES streams move to different pids three times
during playback:

    https://tmm1.s3.amazonaws.com/multiple-pmt-change.ts

Demuxing this sample with the new option shows several new log
messages as the PMT changes are handled:

    [mpegts] detected PMT change (program=1, version=3/6, pcr_pid=0xf98/0xfb7)
    [mpegts] re-using existing video stream 0 (pid=0xf98) for new pid=0xfb7
    [mpegts] re-using existing audio stream 1 (pid=0xf99) for new pid=0xfb8
    [mpegts] re-using existing audio stream 2 (pid=0xf9a) for new pid=0xfb9
    [mpegts] detected PMT change (program=1, version=6/3, pcr_pid=0xfb7/0xf98)
    [mpegts] detected PMT change (program=1, version=3/4, pcr_pid=0xf98/0xf9b)
    [mpegts] re-using existing video stream 0 (pid=0xf98) for new pid=0xf9b
    [mpegts] re-using existing audio stream 1 (pid=0xf99) for new pid=0xf9c
    [mpegts] re-using existing audio stream 2 (pid=0xf9a) for new pid=0xf9d
    [mpegts] detected PMT change (program=1, version=4/5, pcr_pid=0xf9b/0xfa9)
    [mpegts] re-using existing video stream 0 (pid=0xf98) for new pid=0xfa9
    [mpegts] re-using existing audio stream 1 (pid=0xf99) for new pid=0xfaa
    [mpegts] re-using existing audio stream 2 (pid=0xf9a) for new pid=0xfab
    [mpegts] detected PMT change (program=1, version=5/6, pcr_pid=0xfa9/0xfb7)

Signed-off-by: Aman Gupta <aman@tmm1.net>
2018-05-18 19:00:29 -07:00
..
doxy
examples doc/examples: add missing ignore files 2018-05-16 00:39:52 +02:00
.gitignore
APIchanges avformat: add fields to AVProgram/AVStream for PMT change tracking 2018-05-18 19:00:29 -07:00
Doxyfile
Makefile
authors.texi
bitstream_filters.texi lavc: Add VP9 metadata bitstream filter 2018-05-02 01:21:40 +01:00
bootstrap.min.css
build_system.txt
codecs.texi docs/codecs: remove dead codec debug options 2018-02-19 14:49:58 -09:00
decoders.texi avcodec/libzvbi-teletextdec: allow -1 subtitle duration and make it the default 2018-05-06 21:57:22 +02:00
default.css
demuxers.texi avformat/mpegts: add merge_pmt_versions option 2018-05-18 19:00:29 -07:00
developer.texi doc/developer: update style guidelines to include for loops with declarations 2018-05-18 02:24:28 +01:00
devices.texi
doxy-wrapper.sh
encoders.texi doc/encoders: list missing options for x265 2018-03-30 14:03:03 -08:00
errno.txt
faq.texi
fate.texi
fate_config.sh.template
ffmpeg-bitstream-filters.texi Remove the ffserver program 2018-01-06 18:31:37 +00:00
ffmpeg-codecs.texi Remove the ffserver program 2018-01-06 18:31:37 +00:00
ffmpeg-devices.texi Remove the ffserver program 2018-01-06 18:31:37 +00:00
ffmpeg-filters.texi Remove the ffserver program 2018-01-06 18:31:37 +00:00
ffmpeg-formats.texi Remove the ffserver program 2018-01-06 18:31:37 +00:00
ffmpeg-protocols.texi Remove the ffserver program 2018-01-06 18:31:37 +00:00
ffmpeg-resampler.texi Remove the ffserver program 2018-01-06 18:31:37 +00:00
ffmpeg-scaler.texi Remove the ffserver program 2018-01-06 18:31:37 +00:00
ffmpeg-utils.texi Remove the ffserver program 2018-01-06 18:31:37 +00:00
ffmpeg.texi doc/ffmpeg - update benchmark option readout details 2018-04-28 22:51:04 +05:30
ffmpeg.txt
ffplay.texi Remove the ffserver program 2018-01-06 18:31:37 +00:00
ffprobe.texi doc: fix incorrect reference to xsd_compliant option 2018-05-12 12:09:20 -07:00
ffprobe.xsd
fftools-common-opts.texi avformat/utils: Stream specifier enhancement 2. 2018-04-13 21:44:28 +02:00
filter_design.txt
filters.texi avfilter/vsrc_testsrc: add pal75bars and pal100bars video filter sources 2018-05-18 15:39:54 +02:00
formats.texi
general.texi Add Sega FILM muxer 2018-04-05 22:04:30 +01:00
git-howto.texi
indevs.texi avdevice: add android_camera indev 2018-02-22 00:29:27 +01:00
issue_tracker.txt Remove the ffserver program 2018-01-06 18:31:37 +00:00
lexicon
libav-merge.txt doc/libav-merge: remove resolved item 2018-04-28 14:15:41 +02:00
libavcodec.texi Remove the ffserver program 2018-01-06 18:31:37 +00:00
libavdevice.texi Remove the ffserver program 2018-01-06 18:31:37 +00:00
libavfilter.texi Remove the ffserver program 2018-01-06 18:31:37 +00:00
libavformat.texi Remove the ffserver program 2018-01-06 18:31:37 +00:00
libavutil.texi Remove the ffserver program 2018-01-06 18:31:37 +00:00
libswresample.texi Remove the ffserver program 2018-01-06 18:31:37 +00:00
libswscale.texi Remove the ffserver program 2018-01-06 18:31:37 +00:00
mailing-list-faq.texi Remove the ffserver program 2018-01-06 18:31:37 +00:00
metadata.texi
mips.txt
multithreading.txt
muxers.texi avformat/dashenc: configuring container format options 2018-05-15 11:13:36 +05:30
nut.texi
optimization.txt
outdevs.texi
patchwork
platform.texi configure: error out on unsupported MSVC versions 2018-05-18 02:22:57 +01:00
print_options.c
protocols.texi Merge commit 'a2fc8dbae85339d1b418d296f2982b6c04c53c57' 2018-03-29 21:56:19 -03:00
rate_distortion.txt
resampler.texi
scaler.texi
snow.txt
style.min.css
swresample.txt
swscale.txt
t2h.init
t2h.pm
tablegen.txt
texi2pod.pl
texidep.pl
undefined.txt
utils.texi
writing_filters.txt lavfi: add new iteration API 2018-03-31 23:26:30 +01:00