Page 1 of 1

demux 2 or more programs from MPEG TS

Posted: 18 Jul 2017 10:41
by amigo421
I'm retrieving the media from USB device and supply this to libvlc using callbacks-based media
however the stream contains a few programs (or channels? which term is a correct? )

any example please how to:
1. enumerate available programs in the single TS (for user's choice)
2. split these for the UI switching
(for the displaying this, I'm using vlc-qt)

THank you

Re: demux 2 or more programs from MPEG TS

Posted: 18 Jul 2017 11:52
by amigo421
seems the lib vlc-qt already has high-level function to select desired program , just a setProgram by PID
so the topic is actual for a first question only:

how to enumerate available PIDs , extract PMT, from existing MPEG TS?

Re: demux 2 or more programs from MPEG TS

Posted: 23 Jul 2017 19:14
by oviano
If the callbacks don't give you access then I'd suggest digging down in the TS code in vlc and have a look to see if it stores the data you need anywhere already. If not maybe you'll end up needing to parse certain parts of the stream yourself. It's a pretty common and well documented format, maybe you need to pre-parse the stream for a short time before passing it to the callbacks, enough time until you've read enough packets to get all the PIDs and data you need.