How to encode H.264 video using FFmpeg C API and then open the output with a media player?

后端 未结 2 1264
忘掉有多难
忘掉有多难 2021-02-10 00:51

I\'m trying to encode a H.264 video with the FFMPEG C API. I have successfully compiled and executed the decoding/encoding example provided by FFMPEG.

The problem I\'m f

2条回答
  •  情话喂你
    2021-02-10 01:16

    Your problem probably is not encoding itself but the fact that you output raw H.264 stream (I suppose you used AnnexB format) without any muxing. Most of players expect H.264 in some container (like MKV, MP4 or FLV) and do not support playing of raw H.264 streams. For players using DirectShow filters (like MPC-HC / WMP) it also needs raw H.264 AnnexB demuxer before decoder. Try to mux this output to MKV with MKVToolnix and test resulting file.

提交回复
热议问题