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