ffmpeg 选择 GPU:Intel Xe 和 Nvidia

ffmpeg 选择 GPU:Intel Xe 和 Nvidia

我的电脑上有 Nvidia RX A1000 和 Intel Xe。

当尝试使用 qsv

ffmpeg.exe -i "Recording.mkv" -c:v av1_qsv -c:a copy out.mkv

我得到了错误

ffmpeg version 6.1.1-essentials_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --pkg-config=pkgconf --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-dxva2 --enable-d3d11va --enable-libvpl --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      58. 29.100 / 58. 29.100
  libavcodec     60. 31.102 / 60. 31.102
  libavformat    60. 16.100 / 60. 16.100
  libavdevice    60.  3.100 / 60.  3.100
  libavfilter     9. 12.100 /  9. 12.100
  libswscale      7.  5.100 /  7.  5.100
  libswresample   4. 12.100 /  4. 12.100
  libpostproc    57.  3.100 / 57.  3.100
Input #0, matroska,webm, from 'Recording.mkv':
  Metadata:
    ENCODER         : Lavf58.76.100
  Duration: 02:03:15.00, start: 0.000000, bitrate: 11557 kb/s
  Stream #0:0: Video: h264 (Main), yuv420p(progressive), 2560x1060 [SAR 1:1 DAR 128:53], 30 fps, 30 tbr, 1k tbn (default)
    Metadata:
      DURATION        : 02:03:15.000000000
  Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp (default)
    Metadata:
      DURATION        : 02:03:14.990000000
File 'out.mkv' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> av1 (av1_qsv))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[av1_qsv @ 000002b15c6300c0] Current codec type is unsupported
[av1_qsv @ 000002b15c6300c0] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters.
[vost#0:0/av1_qsv @ 000002b15bcae1c0] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
Error while filtering: Function not implemented
[out#0/matroska @ 000002b15b9e5e00] Nothing was written into output file, because at least one of its streams received no packets.
frame=    0 fps=0.0 q=0.0 Lsize=       0kB time=00:00:00.48 bitrate=   0.0kbits/s speed=0.344x
Conversion failed!

尝试使用

ffmpeg.exe -init_hw_device d3d11va=qsv:MFX_IMPL_hw_any -hwaccel qsv

ffmpeg 选择 Nvidia GPU

[AVHWDeviceContext @ 00000182bc06d600] Using device 10de:25bc (NVIDIA RTX A1000 6GB Laptop GPU).
Hyper fast Audio and Video encoder

我怎样才能选择 Intel Xe?

相关内容