簡體   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