[FFmpeg-trac] #11271(undetermined:new): How to choose the best hwaccel?

FFmpeg trac at avcodec.org
Mon Oct 28 20:54:20 EET 2024


#11271: How to choose the best hwaccel?
-------------------------------------+-------------------------------------
             Reporter:  Mads         |                     Type:
  Johansen                           |  enhancement
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:  git-
  undetermined                       |  master
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 I have been using ''auto'' and consistently gotten dxva2 as the result.
 For example ''ffmpeg -hwaccel auto -i input output'' will write
 ''[vist#0:0/h264 @ 0000021c3915e700] [dec:h264 @ 0000021c39fa4740] Using
 auto hwaccel type dxva2 with new default device.''

 With ''ffmpeg -hwaccels'' I get

 {{{
 ffmpeg version N-117642-g08b1bffa49 Copyright (c) 2000-2024 the FFmpeg
 developers
   built with gcc 14.2.0 (Rev1, Built by MSYS2 project)
   configuration:  --pkg-config=pkgconf --cc='ccache gcc' --cxx='ccache
 g++' --ld='ccache g++' --extra-cxxflags=-fpermissive --extra-cflags=-Wno-
 int-conversion --disable-autodetect --enable-cuda --enable-cuvid --enable-
 d3d12va --enable-d3d11va --enable-dxva2 --enable-nvenc --enable-ffnvcodec
 --enable-nvdec --enable-cuda-llvm --enable-libvmaf --enable-libaom
 --enable-libvpx --enable-libx264 --enable-libx265 --disable-debug
 --enable-gpl --enable-vulkan --enable-libplacebo --enable-opencl --enable-
 schannel --disable-w32threads
   libavutil      59. 45.100 / 59. 45.100
   libavcodec     61. 22.100 / 61. 22.100
   libavformat    61.  9.100 / 61.  9.100
   libavdevice    61.  4.100 / 61.  4.100
   libavfilter    10.  6.100 / 10.  6.100
   libswscale      8.  9.100 /  8.  9.100
   libswresample   5.  4.100 /  5.  4.100
   libpostproc    58.  4.100 / 58.  4.100
 Hardware acceleration methods:
 cuda
 dxva2
 d3d11va
 opencl
 vulkan
 d3d12va
 }}}

 My assumption is that the hwaccel option talks with the hardware, so by
 changing the option the only thing that will be different (for supported
 codecs) is the speed of the method.

 So my question is: How do I chose which (if any, other than auto) hwaccel
 to choose use?
 As methodology for the an informed choice, I would use standard H264 (for
 example ''h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709,
 progressive), 3840x2160, 25000 kb/s, 25 fps, 25 tbr, 25k tbn (default)'')
 and use any of the above hwaccels, read the file with hwaccel number ->
 output to NULL and benchmark the wall time each hwaccel takes and chose
 the fastest.
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/11271>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list