avcodec_find_encoder(AV_CODEC_ID_H264)返回null;
[其他答案说使用现在都已弃用的av_register_all或avcodec_register_all。
我正在使用通过vcpkg安装的ffmpeg:x64-windows 4.2-8
avcodec_register_all现在是自动的,您无需再调用它。
如果avcodec_find_encoder(AV_CODEC_ID_H264)返回null,则表示libavcodec可能不符合h264编码器。您将需要编译libx264,然后在编译ffmpeg时启用它。