繁体   English   中英

基于 FFMPEG H.265 C++ 的编码器:avcodec_open2 失败

[英]FFMPEG H.265 C++ based encoder: avcodec_open2 fails

当我将编解码器 ID 设置为“AV_CODEC_ID_H264”时,我基于 FFMPEG 的 c 代码会正确生成 h.264 编码的视频文件。 当我将其更改为“AV_CODEC_ID_HEVC”时,我会从这些特定的代码行中获得此输出。

ret = avcodec_open2(c, codec, &opt);
    av_dict_free(&opt);
    if (ret < 0) {
        fprintf(stderr, "Could not open video codec: %s\n", av_err2str(ret));
        exit(1);
    }
[hevc_mf @ 000001F604B62F00] could not find any MFT for the given media type
[hevc_mf @ 000001F604B62F00] could not create MFT
Could not open video codec: Function not implemented

我有 FFMPEG 4.1 版本。 我假设 H.265 编解码器是此版本的一部分。 缺少什么?

我做了一些更多的研究,我让它起作用了。 HEVC 编码器不是标准 FFMPEG 构建的一部分。 我通过调整构建脚本重建了它,包括 x264 和 x265 外部库。 我会为自己记录下来以备将来参考。 DLL 必须不包含属于 x265 的函数,出于某种原因,我认为这是标准 FFMPEG 构建的一部分。

x265 [info]: HEVC encoder version 3.5+10-82786fccc
x265 [info]: build info [Windows][MSVC 1929][64 bit] 10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main 10 profile, Level-2 (Main tier)
x265 [info]: Thread pool created using 8 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 1 / wpp(5 rows)
x265 [warning]: Source height < 720p; disabling lookahead-slices
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 3
x265 [info]: Keyframe min / max / scenecut / bias  : 1 / 12 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / off / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 2 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : ABR-400 kbps / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 early-skip rskip mode=1 signhide tmvp
x265 [info]: tools: b-intra strong-intra-smoothing deblock sao
Output #0, hevc, to 'output.mov':
  Stream #0:0: Video: hevc, yuv420p, 352x288, q=2-31, 400 kb/s, 25 tbn

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM