<div dir="ltr"><span style="font-size:12.8px">I want to re-mux a incoming h264 stream. But how could I pick the correct AVOutputFormat for the AVFormatContext?</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Currently I used:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div><span style="white-space:pre-wrap">    </span>AVOutputFormat* fmt = av_guess_format(NULL, "xxx.avi", NULL);</div><div><br></div><div><span style="white-space:pre-wrap"> </span>// Open the context</div><div><span style="white-space:pre-wrap">      </span>//---------------------------------------------------------------------</div><div><span style="white-space:pre-wrap">  </span>outFormatCtx = ffmpeg::avformat_alloc_context();</div><div><br></div><div><span style="white-space:pre-wrap">        </span>//Set the output format</div><div><span style="white-space:pre-wrap">  </span>//----------------------------------------------------------------------</div><div><span style="white-space:pre-wrap"> </span>outFormatCtx->oformat = fmt;</div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">And everything works fine.</div><div style="font-size:12.8px">However, if I change the first line to:</div><div style="font-size:12.8px">av_guess_format("h264",NULL, NULL); </div><div style="font-size:12.8px">the recorded stream cannot be played because of bad header/tailer.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Is there a more smart way of picking the correct AVOutputFormat to be used?</div></div>