Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revisionBoth sides next revision
hardware:en-decoder [2020/01/05 17:57] – [FFMPEG] derpeterhardware:en-decoder [2020/11/16 20:10] derpeter
Line 2: Line 2:
  
   * https://en.wikipedia.org/wiki/Category:Video_acceleration   * https://en.wikipedia.org/wiki/Category:Video_acceleration
 +  * https://en.wikipedia.org/wiki/Category:Video_compression_and_decompression_ASIC
 +  * https://wiki.archlinux.org/index.php/Hardware_video_acceleration
  
 = APIs = APIs
  
 == VAAPI == VAAPI
-VAAPi was specified by intel but can be used with hardware of different vendors. It is well supported in gstreamer and ffmpeg. In most cases this is you best option. Only for some hardware / driver combinations you may get better results with one of the more proprietary APIs / drivers. +VAAPI was specified by intel but can be used with hardware of different vendors. It is well supported in gstreamer and ffmpeg. In most cases this is you best option. Only for some hardware / driver combinations you may get better results with one of the more proprietary APIs / drivers. 
  
   * https://01.org/linuxgraphics/community/vaapi   * https://01.org/linuxgraphics/community/vaapi
   * https://freedesktop.org/wiki/Software/vaapi/   * https://freedesktop.org/wiki/Software/vaapi/
  
-The tool ''vainfo'' from the libva-utils repository ( https://github.com/intel/libva-utils/tree/master/vainfo ) can give you an overview what is supported on you system. The results differ depending on lib, cpu and driver version. vainfo is also packaged in many linux distributions. Output on a kabylake microarchitecture based CPU will e.g. look like this:+The tool ''vainfo'' from the libva-utils repository ( https://github.com/intel/libva-utils/tree/master/vainfo ) can give you an overview what is supported on you system. The results differ depending on lib, cpu and driver version. vainfo is also packaged in many linuxdistributions.  
 + 
 +Vainfo can be forced to use a specific render device  
 +<code> 
 +vainfo --display drm --device /dev/dri/renderD129 
 +</code> 
 + 
 +Also the driver to use can be choosen 
 +<code> 
 +LIBVA_DRIVER_NAME=iHD 
 +</code> 
 + 
 +Output on a kabylake microarchitecture based CPU will e.g. look like this:
  
 <code> <code>
Line 73: Line 87:
   * https://en.wikichip.org/wiki/intel/microarchitectures/gen9#Hardware_Accelerated_Video   * https://en.wikichip.org/wiki/intel/microarchitectures/gen9#Hardware_Accelerated_Video
   * https://en.wikichip.org/wiki/intel/microarchitectures/gen9.5#Hardware_Accelerated_Video   * https://en.wikichip.org/wiki/intel/microarchitectures/gen9.5#Hardware_Accelerated_Video
 +  * https://wiki.gentoo.org/wiki/Intel#Feature_support
 +  * https://wiki.archlinux.org/index.php/intel_graphics
 +
 +There are two userspace drivers availiable to enable usage of the igpu with vaapi. 
 +
 +* intel-media-driver (Gen8+ / Broadwell+)
 +* i965-va-driver (up to Gen7)
 +
 +Gen9+ / Skylake to Gen11 need GuC/HuC firmware to be loaded to enable all features (https://github.com/intel/media-driver#known-issues-and-limitations)
 +
 +
 +The ffmpeg wiki has a clear list of the capabilities each Intel GPU generation offers:
 +
 +  * https://trac.ffmpeg.org/wiki/Hardware/QuickSync
  
 The TL;DR on this is: If your CPU is at least a SandyBridge based CPU with a GPU core to en/decode h264. If you need VP9 you should at least have an kabylake core. Depending of what exactly you do you will be able to have more than 10 streams in parallel. The TL;DR on this is: If your CPU is at least a SandyBridge based CPU with a GPU core to en/decode h264. If you need VP9 you should at least have an kabylake core. Depending of what exactly you do you will be able to have more than 10 streams in parallel.
Line 98: Line 126:
   * http://web.archive.org/web/20170214143849im_/https://developer.nvidia.com/sites/default/files/akamai/designworks/images/VidEncode_HP_002.png   * http://web.archive.org/web/20170214143849im_/https://developer.nvidia.com/sites/default/files/akamai/designworks/images/VidEncode_HP_002.png
  
-== AMD+To see the load of your GPU use nvidia'
 +<code>nvidia-smi pmon</code> 
 +== AMD / ATI 
 +=== Radeon 
 +The AMD stand alone GPUs provide also video en/ decoder capabilities. With recent Linux Kernels e.g. the NAVI Gpus (Radeon GT 5xxx) can be used without binary drivers. 
 +The first AMD/ATI GPU with video accelerator was R600 architecture from 2007. AMD developed different accelerator suites over time:
  
 +* https://en.wikipedia.org/wiki/Unified_Video_Decoder
 +* https://en.wikipedia.org/wiki/Video_Coding_Engine
 +* https://en.wikipedia.org/wiki/Video_Core_Next
 + 
 +which provide different encoding and decoding capabilities as well as different offloading features.
 +
 +E.g. a Radeon gt 5500 XT provides the following encoders through libva with opensource drivers on 5.4.0 Kernel
 +
 +<code>
 +libva info: VA-API version 1.6.0
 +libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
 +libva info: Found init function __vaDriverInit_1_6
 +libva info: va_openDriver() returns 0
 +vainfo: VA-API version: 1.6 (libva 2.6.0)
 +vainfo: Driver version: Mesa Gallium driver 20.0.2 for AMD NAVI14 (DRM 3.35.0, 5.4.0-18-generic, LLVM 9.0.1)
 +vainfo: Supported profile and entrypoints
 +      VAProfileMPEG2Simple            : VAEntrypointVLD
 +      VAProfileMPEG2Main              : VAEntrypointVLD
 +      VAProfileVC1Simple              : VAEntrypointVLD
 +      VAProfileVC1Main                : VAEntrypointVLD
 +      VAProfileVC1Advanced            : VAEntrypointVLD
 +      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
 +      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
 +      VAProfileH264Main               : VAEntrypointVLD
 +      VAProfileH264Main               : VAEntrypointEncSlice
 +      VAProfileH264High               : VAEntrypointVLD
 +      VAProfileH264High               : VAEntrypointEncSlice
 +      VAProfileHEVCMain               : VAEntrypointVLD
 +      VAProfileHEVCMain               : VAEntrypointEncSlice
 +      VAProfileHEVCMain10             : VAEntrypointVLD
 +      VAProfileJPEGBaseline           : VAEntrypointVLD
 +      VAProfileVP9Profile0            : VAEntrypointVLD
 +      VAProfileVP9Profile2            : VAEntrypointVLD
 +      VAProfileNone                   : VAEntrypointVideoProc
 +</code>
 +
 +while gstreamer seems not support the usage jet.
 == Broadcom == Broadcom
 === Christal HD === Christal HD
Line 109: Line 179:
   * https://wiki.matthiasbock.net/index.php/Hardware-accelerated_video_playback_on_the_Raspberry_Pi   * https://wiki.matthiasbock.net/index.php/Hardware-accelerated_video_playback_on_the_Raspberry_Pi
  
 +On an raspberrypi (1-4) the following omx features are supported (at least according to gstreamer)
  
-= FFMPEG+<code> 
 +  omxmpeg2videodec: OpenMAX MPEG2 Video Decoder 
 +  omxmpeg4videodec: OpenMAX MPEG4 Video Decoder 
 +  omxh263dec: OpenMAX H.263 Video Decoder 
 +  omxh264dec: OpenMAX H.264 Video Decoder 
 +  omxtheoradec: OpenMAX Theora Video Decoder 
 +  omxvp8dec: OpenMAX VP8 Video Decoder 
 +  omxmjpegdec: OpenMAX MJPEG Video Decoder 
 +  omxvc1dec: OpenMAX WMV Video Decoder 
 +  omxh264enc: OpenMAX H.264 Video Encoder 
 +  omxanalogaudiosink: OpenMAX Analog Audio Sink 
 +  omxhdmiaudiosink: OpenMAX HDMI Audio Sink 
 +</code> 
 += Software  
 + 
 +== FFMPEG
   * https://trac.ffmpeg.org/wiki/HWAccelIntro   * https://trac.ffmpeg.org/wiki/HWAccelIntro
   * https://trac.ffmpeg.org/wiki/Hardware/VAAPI,   * https://trac.ffmpeg.org/wiki/Hardware/VAAPI,
  
-= Gstreamer +== Gstreamer 
-To see which de/encoder gstreamer can use on your system you can run:+To see which de/encoder gstreamer can use on your system you can run e.g.:
 <code>sudo gst-inspect-1.0 vaapi </code> <code>sudo gst-inspect-1.0 vaapi </code>
-gstreamer1.0-vaapi needs to be installed for this to work.+gstreamer1.0-vaapi needs to be installed for this to work. Replace vaapi with the API you want to use e.g. omx. 
 +There are some envirement variables that can be set to change gstreamers behavior / driver usage 
 + 
 +<code> 
 +LIBVA_DRIVER_NAME=iHD DRI_PRIME=/dev/dri/renderD128 GST_VAAPI_ALL_DRIVERS=1 
 +</code> 
 +where the first one is in most cases enough. 
 + 
 The output will look like: The output will look like:
  
Line 149: Line 243:
 </code> </code>
  
 +  * https://blogs.igalia.com/vjaquez/2018/03/28/gstreamer-va-api-troubleshooting/ <= trouble shooting guide
   * https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-vaapi-plugins/html/ch01.html   * https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-vaapi-plugins/html/ch01.html
   * https://gstreamer.freedesktop.org/documentation/tutorials/playback/hardware-accelerated-video-decoding.html   * https://gstreamer.freedesktop.org/documentation/tutorials/playback/hardware-accelerated-video-decoding.html
  • hardware/en-decoder.txt
  • Last modified: 2021/10/15 10:43
  • by derpeter