Intel-Media-SDK / MediaSDK

The Intel® Media SDK
MIT License
926 stars 457 forks source link

"Selected ratecontrol mode is unsupported" #2970

Open github-wangyong opened 2 years ago

github-wangyong commented 2 years ago

(1) Question: I could not transcode (decode + encode) a h264 mp4 file at encode stage by using "-c:v h264_qsv". my transcode command: "./ffmpeg -v debug -vcodec h264_qsv -i chimei_1280x720_168sec.mp4 -c:v h264_qsv -low_power 1 out.mp4" it will report "Selected ratecontrol mode is unsupported"

(2) Preconditions: (2.1) os: ubuntu 20.04 64bits linux;

(2.2) cpuinfo:
cat /proc/cpuinfo
"model name : Intel(R) Celeron(R) N5105 @ 2.00GHz"

(2.3) vga controller:
lspci -nn | grep -in "vga"
"2:00:02.0 VGA compatible controller [0300]: Intel Corporation Device [8086:4e61] (rev 01)"
[8086:4e61] "4e61" could not be found in "https://dgpu-docs.intel.com/devices/hardware-table.html", so I don't know this "cpu+gpu" could
use "-c:v h264_qsv" (hard encode by using "cpu/gpu"). Is it supported by this "cpu/gpu" according to the "Supported Platforms" section in "https://github.com/intel/media-driver/releases/tag/intel-media-22.4.4".

(2.4) intel media sdk ver:
as toolkit in "https://github.com/Intel-Media-SDK/MediaSDK/releases/tag/intel-mediasdk-22.4.4":
    (2.1.1) libva: 2.15.0;
    (2.1.2) libva-utils: 2.15.0;
    (2.1.3) gmmlib: 22.1.4;
    (2.1.4) intel media driver: 22.4.4;
    (2.1.5) intel media sdk: 22.4.4;
export LIBVA_DRIVERS_PATH=/usr/lib/x86_64-linux-gnu/dri
export LIBVA_DRIVER_NAME=iHD

(3) ffmpeg (official 4.4 ver: "ffmpeg-4.4.tar.xz"): (3.1) ffmpeg compilation command: "./configure --prefix=/path/bin_ffmpeg --enable-static --disable-shared --enable-libdrm --enable-libx264 --enable-libmfx --enable-encoder=h264_qsv --enable-decoder=h264_qsv --enable-ffmpeg --enable-ffprobe --enable-ffplay --enable-sdl2 --enable-nonfree" (3.2) pkg-config: export PKG_CONFIG_PATH=/correct/corresponding/path/lib/pkgconfig/:$PKG_CONFIG_PATH (3.3) ld config path: export LD_LIBRARY_PATH=/correct/corresponding/path/lib/:$LD_LIBRARY_PATH (3.4) "ldd ./ffmpeg", "ldd ./ffprobe", "ldd ./ffplay" ok, "./ffplay in.mp4" (h264 + mp4) ok;

(4) issue: how to solve "Selected ratecontrol mode is unsupported"?

dvrogozh commented 2 years ago

https://ark.intel.com/content/www/us/en/ark/products/212328/intel-celeron-processor-n5105-4m-cache-up-to-2-90-ghz.html - that's Jasperlake GPU.

You are trying to run in low power mode (-low_power 1) which requires HUC FW to be loaded and authenticated which I believe won't be the default case for the vanilla kernel for Jasperlake platform. HUC is loaded by default only starting from DG1 (even TGL won't load HUC by default).

You have 2 options:

  1. Use non-lowpower mode, either remove -low_power 1 option or explicitly set it to 0:
    ./ffmpeg -v debug -vcodec h264_qsv -i chimei_1280x720_168sec.mp4 -c:v h264_qsv -low_power 0 out.mp4
  2. Another option, which I would suggest to avoid unless you absolutely need it, would be to enable HUC loading by the kernel and use your original cmdline. For that you need to add this to Linux kernel boot cmdline: i915.enable_guc=2. You can either adjust grub or do the following. Either way, don't forget to reboot:
    echo "options i915 enable_guc=2" >> /etc/modprobe.d/i915.conf
github-wangyong commented 2 years ago

@dvrogozh, Thank you very much! Solve it by using ubuntu 22.04. Thank you very much!

SaltFish001 commented 2 years ago

@dvrogozh, Thank you very much! Solve it by using ubuntu 22.04. Thank you very much!

I got same error, but i can not pass by this issue. Can you give me some help?

dvrogozh commented 1 year ago

@SaltFish001 : I listed available options in https://github.com/Intel-Media-SDK/MediaSDK/issues/2970#issuecomment-1205561199. Please, clarify which one you are trying to follow, on which CPU/GPU and what does not work?

SaltFish001 commented 1 year ago

@SaltFish001 : I listed available options in #2970 (comment). Please, clarify which one you are trying to follow, on which CPU/GPU and what does not work?

I've tried all the options。I still get thih s error。use N5105, build with ubuntu 22.04.1&ffmpeg5.0