Project

General

Profile

Switching audio codecs/formats mid-stream

Added by Mike D 10 months ago

I doubt this is the correct place to ask this, but I'm looking for some help regarding mpeg-ts streams. I have hardware capture that is capable of passing AC3 encoded streams. In my capture software, I am able to detect the change in audio format coming from the source. In my case, it would be a standard set top box providing signal through HDMI. SO my issue is this: If I'm currently tuned to a channel that is currently providing stereo audio, and I'm encoding that into an mpeg-ts stream via ffmpeg libraries, and the audio signal suddenly changes to an AC3 bitstream, can I switch audio codecs in the mpeg transport stream? I've tried to look into this in the past, and I think it involved adding a new stream and updating the PAT version number? I seems to recall it sort of working, at least with VLC playback, but the hardware I was using at the time was actually doing the encoding and it was horribly slow to switch back and forth.

I guess I'm wondering if this is really supported in the standards, and how does normal decoding hardware support something like this? I imagine if I'm watching so IPTV stream like HBO or something, and the signal changes from stereo while in between movies (playing all the ads and stuff) and then switching to AC3 for the movie, then switching back when the movie ends. If the mpeg-ts stream never stops, how does it switch codecs?