MPTS support for MPEG-TS demuxer

Started by HankF, May 21, 2019, 10:09:09 AM

Previous topic - Next topic

HankF

Hi,

The current implementation of the MPEG-TS demuxer works perfectly!  :D
It works even when multiple programs exists (several PMT found) and just only one program is active in the stream (that's when the pids of other programs are removed).
So, no improvements are required in the current implementation to improve the demuxer.  ;)

However, for the User Interface we lack a simple Menu Entry (or any other method) for selecting the PROGRAM when more than one exists. That's when the input file it's a MPTS stream and not a SPTS.  :(

I suggest to implement a simple solution to select one of the multiple programs inside the input stream. A simple PID for the PMT can be sufficient. But, if you can provide a Menu List with the name of the programs then it will be perfect.  :o

Thank you for this good tool.
Regards.

eumagga0x2a

Without a major redesign of the core parts of the application, such a selection could happen only before the stream is indexed. Once the *.idx2 file has been created, Avidemux would see just one video track. Even for that, patches welcome.

HankF

Hi,

I don't propose to make huge redesign. I do some tests, and the demuxer can parse ANY file, even if some pids are missing. It gets the FIRST found video pid and then parse (and gets) the audio of pids of that program. So, what I suggest it's a simple method (even a simple command-line parameter) to ENFORCE to select one specific program.

If you check the code:
https://github.com/mean00/avidemux2/blob/200e2d65f2348cbf09697f52b83536ba4272a172/avidemux_plugins/ADM_demuxers/MpegTS/ADM_tsPatPmt.cpp#L128

Then you will see that when parsing the PAT of the TS File, the first video in the loop is selected (line #136). I only request to add some solution to enforce some specific video track inside this loop.

Regards.

eumagga0x2a

Even though you linked to and older version of the file (the current one lives in the ffmpeg4x branch), you were at the right spot, so you probably could contribute a working implementation  :) (ADM_TS_TRACK struct might need a member to store track description which would be set by TS_scanPmt()).

If we get more than a single promising video track, we could show a dialog listing available options. Whatever choice the user makes, it would be final unless the generated index file is manually removed.