无法从ffmpeg示例运行transcode.c

时间:2015-03-30 14:10:34

标签: c++ windows ffmpeg transcoding

每当我尝试运行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 我给出的输出文件是输入文件的副本。

1 个答案:

答案 0 :(得分:0)

你应该将编码器参数传递给avformat_new_stream

    encoder = avcodec_find_encoder(dec_ctx->codec_id);
    out_stream = avformat_new_stream(ofmt_ctx, encoder);
相关问题