[Libav-user] How to handle dynamically changing streams / parameters / codecs?

Andrea3000 andrea3000 at email.it
Sat Nov 3 10:25:37 CET 2012


Hi all,

I'm developing an application for playing media contents thanks to FFmpeg API.
Those media contents come from a custom input which is handled with FFmpeg's custom I/O callbacks and it works fine.

The problem I need to address is that the media stream can sometimes dynamically change the number of video and/or audio streams, the stream parameters (such as bitrate)
and it can also change audio and/or video codecs.

When such a change is going to happen, the custom input (through read_packet) provides the remaining packets of the stream before the change, than notify me of the presence of a change and than continues to feed the decoder with new packets coming from the stream after the change.
So I know exaclty when this discontinuity occurs but I don't know how to handle it.

What do I need to update in the FFmpeg structure to handle the change? Only AVFormatContext?
Is there a way to handle it?

Thank you
Regards

Andrea


More information about the Libav-user mailing list