<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2017-12-06 17:50 GMT+02:00 Carl Eugen Hoyos <span dir="ltr"><<a href="mailto:ceffmpeg@gmail.com" target="_blank">ceffmpeg@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">2017-12-06 14:01 GMT+01:00 Anton Shekhovtsov <<a href="mailto:shekh.anton@gmail.com">shekh.anton@gmail.com</a>>:<br>
<br>
> I am looking for a generic method to detect if specific codec-container<br>
> combination would "work".<br>
<br>
</span>This is generally not possible with FFmpeg:<br>
You are expected to know what you try to put into a container.<br>
This is further complicated by several facts (issues) about FFmpeg:<br>
General purpose containers (like avi) accept everything.<br>
Other containers like mpeg-ts and mpeg-ps accept everything<br>
although a very small number of codecs is actually supported.<br>
Other containers do support certain codecs but FFmpeg does<br>
not support writing them.<br>
<span class="gmail-"><br>
> I tested this approach:<br>
> Prepare writing to memory buffer and execute just avformat_write_header and<br>
> av_write_trailer (no actual packets).<br>
> If neither function returns an error, assume the formats are compatible.<br>
><br>
> This seems to solve great part of the problem, but there are exceptions:<br>
<br>
> pcm in mp4 is successful (no errors reported)<br>
<br>
</span>This surprises me, the error that is shown here in my tests<br>
is often reported by users.<br>
<br>
Carl Eugen<br>
______________________________<wbr>_________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/<wbr>listinfo/libav-user</a><br>
</blockquote></div><br></div><div class="gmail_extra">Thanks.</div><div class="gmail_extra"><br></div><div class="gmail_extra">> pcm in mp4 is successful (no errors reported)<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">ffmpeg -i test.avi -c:v mpeg4 -c:a copy test.mp4<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">In this case (copy pcm from avi) there is no error message.</div></div>