[Libav-user] Generic compatibility check for AVCodecParameters

Romain Beauxis romain.beauxis at gmail.com
Sat Jul 18 21:11:26 EEST 2020


Hi all!

I'm working on a DSL backend for ffmpeg/libav that allows users to build
streams using generic programming language primitives and am now
integrating support for stream copy using AVPackets.

The way the language is structured, sources decode files whose content is
then passed packet by packet down to the encoders.

My problem is that, once I have started the streaming loop with one file, I
need a way to know if the next file in the playlist will be compatible with
the output stream as configured.

Since stream copies are using AVCodecParameters for their initialization, I
suppose that the way to do it is to check on the AVCodecParameters from the
next file as returned by the library.

However, AVCodecParameters structure has a lot of entries, some
seemingly codec-specific and etc.

Apart from doing the usual suspect sanity checks, sample/frame format,
sample/frame rate, etc, is there any kind of generic utility that can be
used to check if two given AVCodecParameters are mutually compatible to mux
in the same output stream? I have looked at the API but haven't found one
such..

Thanks for y'all help!
Romain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20200718/8e58465f/attachment.html>


More information about the Libav-user mailing list