每当我尝试运行 ffmpeg 示例 transcode.c 时,我都会收到以下错误
[libx264 @ 000000c428ef9260] broken ffmpeg default settings detected
[libx264 @ 000000c428ef9260] use an encoding preset (e.g. -vpre medium)
[libx264 @ 000000c428ef9260] preset usage: -vpre <speed> -vpre <profile>
[libx264 @ 000000c428ef9260] speed presets are listed in x264 --help
[libx264 @ 000000c428ef9260] profile is optional; x264 defaults to high
Cannot open video encoder for stream #0
我在 Visual Studio 窗口中将其作为 C++ 代码运行。我必须进行一些更改才能将其作为 C++ 运行。代码链接在这里 http://pastebin.com/qAf7sbsp 我提供的输出文件是输入文件的拷贝。
最佳答案
你应该将编码器参数传递给 avformat_new_stream
encoder = avcodec_find_encoder(dec_ctx->codec_id);
out_stream = avformat_new_stream(ofmt_ctx, encoder);
关于c++ - 无法从 ffmpeg 示例运行 transcode.c,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29348443/