[Libav-user] detecting format compatibility

Anton Shekhovtsov shekh.anton at gmail.com
Wed Dec 6 18:29:18 EET 2017

2017-12-06 17:50 GMT+02:00 Carl Eugen Hoyos <ceffmpeg at gmail.com>:

> 2017-12-06 14:01 GMT+01:00 Anton Shekhovtsov <shekh.anton at gmail.com>:
> > I am looking for a generic method to detect if specific codec-container
> > combination would "work".
> This is generally not possible with FFmpeg:
> You are expected to know what you try to put into a container.
> This is further complicated by several facts (issues) about FFmpeg:
> General purpose containers (like avi) accept everything.
> Other containers like mpeg-ts and mpeg-ps accept everything
> although a very small number of codecs is actually supported.
> Other containers do support certain codecs but FFmpeg does
> not support writing them.
> > I tested this approach:
> > Prepare writing to memory buffer and execute just avformat_write_header
> and
> > av_write_trailer (no actual packets).
> > If neither function returns an error, assume the formats are compatible.
> >
> > This seems to solve great part of the problem, but there are exceptions:
> > pcm in mp4 is successful (no errors reported)
> This surprises me, the error that is shown here in my tests
> is often reported by users.
> Carl Eugen
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user


> pcm in mp4 is successful (no errors reported)

ffmpeg -i test.avi -c:v mpeg4 -c:a copy test.mp4

In this case (copy pcm from avi) there is no error message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20171206/6c5db803/attachment.html>

More information about the Libav-user mailing list