AMD HEVC encoder is missing the Main10 profile which is for 10 bit but for some reason (complicated and convoluted but it's on the internet) Main10 is more efficient, even for 8 bit, when encoding.
AMD HEVC Main10 Profile
-
-
Vouk
November 30, 2023 at 6:14 AM Approved the thread. -
- Official Post
I don't see this profile here:
ffmpeg version 549430e Copyright (c) 2000-2023 the FFmpeg developers
built with Microsoft (R) C/C++ Optimizing Compiler Version 19.36.32532 for x64
configuration: --toolchain=msvc --extra-cflags='-MDd -I../build/include' --extra-ldflags='-LIBPATH:../build/lib' --prefix=../build --extra-libs=Ole32.lib --extra-libs=Advapi32.lib --disable-doc --pkg-config-flags=--static --disable-shared --enable-static --enable-runtime-cpudetect --enable-w32threads --enable-gpl --enable-libvpl --enable-libsvtav1 --enable-libsnappy --enable-libmp3lame --enable-libzimg --enable-libvorbis --enable-libopus --enable-libx264 --enable-libx265 --enable-libfdk-aac
libavutil 58. 2.100 / 58. 2.100
libavcodec 60. 3.100 / 60. 3.100
libavformat 60. 3.100 / 60. 3.100
libavdevice 60. 1.100 / 60. 1.100
libavfilter 9. 3.100 / 9. 3.100
libswscale 7. 1.100 / 7. 1.100
libswresample 4. 10.100 / 4. 10.100
libpostproc 57. 1.100 / 57. 1.100
Encoder hevc_amf [AMD AMF HEVC encoder]:
General capabilities: dr1 delay hardware
Threading capabilities: none
Supported hardware devices: d3d11va d3d11va dxva2 dxva2
Supported pixel formats: nv12 yuv420p d3d11 dxva2_vld
hevc_amf AVOptions:
-usage <int> E..V....... Set the encoding usage (from 0 to 3) (default transcoding)
transcoding 0 E..V.......
ultralowlatency 1 E..V.......
lowlatency 2 E..V.......
webcam 3 E..V.......
-profile <int> E..V....... Set the profile (default main) (from 1 to 1) (default main)
main 1 E..V.......
-profile_tier <int> E..V....... Set the profile tier (default main) (from 0 to 1) (default main)
main 0 E..V.......
high 1 E..V.......
-level <int> E..V....... Set the encoding level (default auto) (from 0 to 186) (default auto)
auto 0 E..V.......
1.0 30 E..V.......
2.0 60 E..V.......
2.1 63 E..V.......
3.0 90 E..V.......
3.1 93 E..V.......
4.0 120 E..V.......
4.1 123 E..V.......
5.0 150 E..V.......
5.1 153 E..V.......
5.2 156 E..V.......
6.0 180 E..V.......
6.1 183 E..V.......
6.2 186 E..V.......
-quality <int> E..V....... Set the encoding quality (from 0 to 10) (default speed)
balanced 5 E..V.......
speed 10 E..V.......
quality 0 E..V.......
-rc <int> E..V....... Set the rate control mode (from -1 to 3) (default -1)
cqp 0 E..V....... Constant Quantization Parameter
cbr 3 E..V....... Constant Bitrate
vbr_peak 2 E..V....... Peak Contrained Variable Bitrate
vbr_latency 1 E..V....... Latency Constrained Variable Bitrate
-header_insertion_mode <int> E..V....... Set header insertion mode (from 0 to 2) (default none)
none 0 E..V.......
gop 1 E..V.......
idr 2 E..V.......
-gops_per_idr <int> E..V....... GOPs per IDR 0-no IDR will be inserted (from 0 to INT_MAX) (default 1)
-preanalysis <boolean> E..V....... Enable preanalysis (default false)
-vbaq <boolean> E..V....... Enable VBAQ (default false)
-enforce_hrd <boolean> E..V....... Enforce HRD (default false)
-filler_data <boolean> E..V....... Filler Data Enable (default false)
-max_au_size <int> E..V....... Maximum Access Unit Size for rate control (in bits) (from 0 to INT_MAX) (default 0)
-min_qp_i <int> E..V....... min quantization parameter for I-frame (from -1 to 51) (default -1)
-max_qp_i <int> E..V....... max quantization parameter for I-frame (from -1 to 51) (default -1)
-min_qp_p <int> E..V....... min quantization parameter for P-frame (from -1 to 51) (default -1)
-max_qp_p <int> E..V....... max quantization parameter for P-frame (from -1 to 51) (default -1)
-qp_p <int> E..V....... quantization parameter for P-frame (from -1 to 51) (default -1)
-qp_i <int> E..V....... quantization parameter for I-frame (from -1 to 51) (default -1)
-skip_frame <boolean> E..V....... Rate Control Based Frame Skip (default false)
-me_half_pel <boolean> E..V....... Enable ME Half Pixel (default true)
-me_quarter_pel <boolean> E..V....... Enable ME Quarter Pixel (default true)
-aud <boolean> E..V....... Inserts AU Delimiter NAL unit (default false)
-log_to_dbg <boolean> E..V....... Enable AMF logging to debug output (default false) -
This is what I get, I'm using Jellyfin FFmpeg 6.0.1-1 (but I think it's on 6.0 as well):
./ffmpeg -h encoder=hevc_amf
ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 12-win32 (GCC)
configuration: --prefix=/opt/ffmpeg --arch=x86_64 --target-os=mingw32 --cross-prefix=x86_64-w64-mingw32- --pkg-config=pkg-config --pkg-config-flags=--static --extra-version=Jellyfin --disable-ffplay --disable-debug --disable-doc --disable-sdl2 --disable-ptx-compression --disable-w32threads --enable-pthreads --enable-shared --enable-lto --enable-gpl --enable-version3 --enable-schannel --enable-iconv --enable-libxml2 --enable-zlib --enable-lzma --enable-gmp --enable-chromaprint --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libwebp --enable-libvpx --enable-libzimg --enable-libx264 --enable-libx265 --enable-libsvtav1 --enable-libdav1d --enable-libfdk-aac --enable-opencl --enable-dxva2 --enable-d3d11va --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
libavutil 58. 2.100 / 58. 2.100
libavcodec 60. 3.100 / 60. 3.100
libavformat 60. 3.100 / 60. 3.100
libavdevice 60. 1.100 / 60. 1.100
libavfilter 9. 3.100 / 9. 3.100
libswscale 7. 1.100 / 7. 1.100
libswresample 4. 10.100 / 4. 10.100
libpostproc 57. 1.100 / 57. 1.100
Encoder hevc_amf [AMD AMF HEVC encoder]:
General capabilities: dr1 delay hardware
Threading capabilities: none
Supported hardware devices: d3d11va d3d11va dxva2 dxva2
Supported pixel formats: nv12 yuv420p p010le bgra bgr0 d3d11 dxva2_vld
hevc_amf AVOptions:
-usage <int> E..V....... Encoder Usage (from 0 to 5) (default transcoding)
transcoding 0 E..V....... Transcoding, video editing
ultralowlatency 1 E..V....... Video game streaming
lowlatency 2 E..V....... Video collaboration, RDP
webcam 3 E..V....... Video conferencing
highquality 4 E..V....... High-quality encoding
llhighquality 5 E..V....... High-quality encoding (low latency)
-profile <int> E..V....... Profile (from 1 to 2) (default main)
main 1 E..V.......
main10 2 E..V.......
-profile_tier <int> E..V....... Profile Tier (from 0 to 1) (default main)
main 0 E..V.......
high 1 E..V.......
-level <int> E..V....... Profile Level (from 0 to 186) (default auto)
auto 0 E..V.......
1.0 30 E..V.......
2.0 60 E..V.......
2.1 63 E..V.......
3.0 90 E..V.......
3.1 93 E..V.......
4.0 120 E..V.......
4.1 123 E..V.......
5.0 150 E..V.......
5.1 153 E..V.......
5.2 156 E..V.......
6.0 180 E..V.......
6.1 183 E..V.......
6.2 186 E..V.......
-quality <int> E..V....... Quality Preset (from 0 to 10) (default speed)
speed 10 E..V....... Prefer Speed
balanced 5 E..V....... Balanced
quality 0 E..V....... Prefer Quality
-rc <int> E..V....... Rate Control Method (from -1 to 3) (default -1)
cqp 0 E..V....... Constant Quantization Parameter
cbr 3 E..V....... Constant Bitrate
vbr_peak 2 E..V....... Peak Contrained Variable Bitrate
vbr_latency 1 E..V....... Latency Constrained Variable Bitrate
-header_insertion_mode <int> E..V....... Set header insertion mode (from 0 to 2) (default none)
none 0 E..V.......
gop 1 E..V.......
idr 2 E..V.......
-gops_per_idr <int> E..V....... GOPs per IDR 0-no IDR will be inserted (from 0 to INT_MAX) (default 1)
-preanalysis <boolean> E..V....... Enable Pre-Encode/Analysis for rate rontrol (2-Pass) (default false)
-vbaq <boolean> E..V....... Enable VBAQ (default false)
-hmqb <boolean> E..V....... Enable High Motion Quality Boost (default false)
-enforce_hrd <boolean> E..V....... Enforce HRD (default false)
-filler_data <boolean> E..V....... Filler Data Enable (default false)
-max_au_size <int> E..V....... Maximum Access Unit Size for rate control (in bits) (from 0 to INT_MAX) (default 0)
-min_qp_i <int> E..V....... Min Quantization Parameter for I-frame (from -1 to 51) (default -1)
-max_qp_i <int> E..V....... Max Quantization Parameter for I-frame (from -1 to 51) (default -1)
-min_qp_p <int> E..V....... Min Quantization Parameter for P-frame (from -1 to 51) (default -1)
-max_qp_p <int> E..V....... Max Quantization Parameter for P-frame (from -1 to 51) (default -1)
-qp_p <int> E..V....... Quantization Parameter for P-frame (from -1 to 51) (default -1)
-qp_i <int> E..V....... Quantization Parameter for I-frame (from -1 to 51) (default -1)
-skip_frame <boolean> E..V....... Rate Control Based Frame Skip (default false)
-me_half_pel <boolean> E..V....... Enable ME Half Pixel (default true)
-me_quarter_pel <boolean> E..V....... Enable ME Quarter Pixel (default true)
-aud <boolean> E..V....... Inserts AU Delimiter NAL unit (default false)
-log_to_dbg <boolean> E..V....... Enable AMF logging to debug output (default false)It seems your AMF is outdated.
https://github.com/Vouk/voukoder-ffmpeg
I don't know why but it doesn't have some of the options normal FFmpeg has had for at least a year. -
- Official Post
This has to be manually updated and maintained here: https://github.com/Vouk/voukoder/…s/hevc_amf.json
I don't have an AMD GPU for testing. They promised to send me testing equipment, but unfortunately they never did.
Feel free to update the AMF files, it's an open project.
-
The place your FFmpeg (https://github.com/Vouk/voukoder-ffmpeg) gets AMF from (https://github.com/GPUOpen-LibrariesAndSDKs/AMF) says "Version 1.4.21: AMD Radeon Software Adrenalin Edition 21.10.1 (21.30.25.01) or newer. Added PSNR/SSIM score feedback, new QVBR rate control mode and LTR mode for encoders, added HDR support for HEVC encoder and color converter, new EncoderLatency sample app."
Your FFmpeg says that it is on the latest version of AMF but it clearly isn't. I downloaded your FFmpeg and it was clearly out of date. That's part of the problem.
They added Main10 on December 3rd, 2021. I'm looking through your FFmpeg Github workflows and if I can figure it out I'll make a PR.
It's strange, the static build I downloaded from https://github.com/Vouk/voukoder-ffmpeg/releases has ffmpeg-win64-static-release\include\AMF\ and all the files match the GitHub master branch https://github.com/GPUOpen-LibrariesAndSDKs/AMF but the FFmpeg still shows no main10 and errors out when attempting -profile main10 even though the exact same command in Jellyfin FFmpeg works. I think the FFmpeg build is somehow using an older version of AMF even though ffmpeg-win64-static-release\include\AMF\ has the latest files.
-
The only thing to add is that your latest build of FFmpeg and the latest version of Voukoder remain with an outdated version of AMF.