Changes between Version 62 and Version 63 of HWAccelIntro


Ignore:
Timestamp:
Jan 9, 2018, 12:39:10 AM (7 months ago)
Author:
llogan
Comment:

minor nits

Legend:

Unmodified
Added
Removed
Modified
  • HWAccelIntro

    v62 v63  
    1 [[PageOutline(2, Contents)]] 
     1[[PageOutline]] 
    22 
    33Many platforms offer access to dedicated hardware to perform a range of video-related tasks. Using such hardware allows some operations like decoding, encoding or filtering to be completed faster or using less of other resources (particularly CPU), but may give different or inferior results, or impose additional restrictions which are not present when using software only. On PC-like platforms, video hardware is typically integrated into a GPU (from AMD, Intel or NVIDIA), while on mobile SoC-type platforms it is generally an independent IP core (many different vendors). 
     
    1212 
    1313 
    14 == Platform API Availability == 
     14= Platform API Availability = 
    1515 
    1616|| ||||||= Linux =||||||= Windows =||= Android =||||= Apple =||= Other =|| 
     
    3232 
    3333Key: 
    34 * Y  Fully usable. 
    35 * P  Partial support (some devices / some features). 
    36 * N  Not possible. 
     34* `Y`  Fully usable. 
     35* `P`  Partial support (some devices / some features). 
     36* `N`  Not possible. 
    3737 
    3838 
    39 == FFmpeg API Implementation Status == 
     39= FFmpeg API Implementation Status = 
    4040 
    4141|| ||||||=  Decoder  =||||=  Encoder  =||||||=  Other support  =|| 
     
    5858 
    5959Key: 
    60 * -  Not applicable to this API. 
    61 * Y  Working. 
    62 * N  Possible but not implemented. 
    63 * F  Not yet integrated, but work is being done in this area. 
     60* `-`  Not applicable to this API. 
     61* `Y`  Working. 
     62* `N`  Possible but not implemented. 
     63* `F`  Not yet integrated, but work is being done in this area. 
    6464 
    6565 
    66 == Use with the FFmpeg Utility == 
     66= Use with the `ffmpeg` command-line tool = 
    6767 
    6868Internal hwaccel decoders are enabled via the `-hwaccel` option.  The software decoder starts normally, but if it detects a stream which is decodable in hardware then it will attempt to delegate all significant processing to that hardware.  If the stream is not decodable in hardware (for example, it is an unsupported codec or profile) then it will still be decoded in software automatically.  If the hardware requires a particular device to function (or needs to distinguish between multiple devices, say if several graphics cards are available) then one can be selected using `-hwaccel_device`. 
     
    7575 
    7676 
    77 == VDPAU == 
     77= VDPAU = 
    7878 
    79 [http://http.download.nvidia.com/XFree86/vdpau/doxygen/html/index.html Video Decode and Presentation API for Unix]. Developed by NVIDIA for Unix/Linux systems. To enable this you typically need the `libvdpau` development package in your distribution, and a compatible graphics card. 
     79[https://http.download.nvidia.com/XFree86/vdpau/doxygen/html/index.html Video Decode and Presentation API for Unix]. Developed by NVIDIA for !Unix/Linux systems. To enable this you typically need the `libvdpau` development package in your distribution, and a compatible graphics card. 
    8080 
    8181Note that VDPAU cannot be used to decode frames in memory, the compressed frames are sent by libavcodec to the GPU device supported by VDPAU and then the decoded image can be accessed using the VDPAU API. This is not done automatically by FFmpeg, but must be done at the application level (check for example the {{{ffmpeg_vdpau.c}}} file used by {{{ffmpeg.c}}}). Also, note that with this API it is not possible to move the decoded frame back to RAM, for example in case you need to encode again the decoded frame (e.g. when doing transcoding on a server). 
     
    8383Several decoders are currently supported through VDPAU in libavcodec, in particular H.264, MPEG-1/2/4, and VC-1. 
    8484 
    85 == VAAPI == 
     85= VAAPI = 
    8686 
    8787Video Acceleration API (VAAPI) is a non-proprietary and royalty-free open source software library ("libva") and API specification, initially developed by Intel but can be used in combination with other devices. 
     
    8989It can be used to access the Quick Sync hardware in Intel GPUs and the UVD/VCE hardware in AMD GPUs. See [wiki:Hardware/VAAPI VAAPI]. 
    9090 
    91 == DXVA2 == 
     91= DXVA2 = 
    9292 
    93 Direct-X Video Acceleration API, developed by Microsoft (supports Windows and XBox360). 
    94  
    95 Link to MSDN documentation: 
    96 http://msdn.microsoft.com/en-us/library/windows/desktop/cc307941%28v=vs.85%29.aspx 
     93[https://msdn.microsoft.com/en-us/library/windows/desktop/cc307941(v=vs.85).aspx Direct-X Video Acceleration API], developed by Microsoft (supports Windows and XBox360). 
    9794 
    9895Several decoders are currently supported, in particular H.264, MPEG-2, VC-1 and WMV 3. 
    9996 
    10097DXVA2 hardware acceleration only works on Windows. In order to build FFmpeg with DXVA2 support, you need to install the dxva2api.h header. 
    101 For MinGW this can be done by [http://download.videolan.org/pub/contrib/dxva2api.h downloading the header maintained by VLC] and installing it in the include patch (for example in {{{/usr/include/}}}). 
     98For MinGW this can be done by [https://download.videolan.org/pub/contrib/dxva2api.h downloading the header maintained by VLC] and installing it in the include patch (for example in {{{/usr/include/}}}). 
    10299 
    103100For MinGW64, `dxva2api.h` is provided by default. One way to install mingw-w64 is through a {{{pacman}}} repository, and can be installed using one of the two following commands, depending on the architecture: 
     
    115112 
    116113 
    117 == VideoToolbox == 
     114= !VideoToolbox = 
    118115 
    119116[https://developer.apple.com/documentation/videotoolbox VideoToolbox], only supported on macOS. H.264 decoding is available in FFmpeg/libavcodec. 
    120117 
    121 == NVENC == 
     118= NVENC = 
    122119 
    123120NVENC is an API developed by NVIDIA which enables the use of NVIDIA GPU cards to perform H.264 and HEVC encoding. FFmpeg supports NVENC through the {{{h264_nvenc}}} and {{{hevc_nvenc}}} encoders. In order to enable it in FFmpeg you need: 
     
    137134 
    138135{{{ 
    139 #!div style="border: 1pt dotted; margin: 1em; background-color: #fffff9;" 
     136#!div style="border: 1px solid #e5e5c7; margin: 1em; background-color: #ffd;" 
    140137'''Note:''' If you get the {{{No NVENC capable devices found}}} error make sure you're encoding to a supported pixel format. See encoder info as shown above. 
    141138}}} 
    142139 
    143 == CUDA/CUVID/NvDecode == 
     140= CUDA/CUVID/NvDecode = 
    144141 
    145142CUVID, which is also called nvdec by NVIDIA now, can be used for decoding on Windows and Linux. 
     
    170167The {{{-hwaccel_device}}} option can be used to specify the GPU to be used by the cuvid hwaccel in ffmpeg. 
    171168 
    172 == libmfx == 
     169= libmfx = 
    173170 
    174171libmfx is a proprietary library from Intel for use of Quick Sync hardware on both Linux and Windows. On Windows it is the primary way to use more advanced functions beyond those accessible via DXVA2/D3D11VA, particularly encode. On Linux it has a very restricted feature set and is hard to use, but may be helpful for some use-cases desiring maximum throughput. 
     
    176173See [wiki:Hardware/QuickSync QuickSync]. 
    177174 
    178 == OpenCL == 
     175= OpenCL = 
    179176 
    180177[https://www.khronos.org/opencl/ OpenCL] can be used for a number of filters.  To build, OpenCL 1.2 or later headers are required, along with an ICD or ICD loader to link to - it is recommended (but not required) to link with the ICD loader, so that the implementation can be chosen at run-time rather than build-time.  At run-time, an OpenCL 1.2 driver is required - most GPU manufacturers will provide one as part of their standard drivers.  CPU implementations are also usable, but may be slower than using native filters in ffmpeg directly. 
     
    187184* libmfx: NV12 surfaces only, via VAAPI or DXVA2. 
    188185 
    189 == AMD UVD/VCE == 
     186= AMD UVD/VCE = 
    190187 
    191188AMD UVD is usable for decode via VDPAU and VAAPI in Mesa on Linux.  VCE also has some initial support for encode via VAAPI, but should be considered experimental. 
     
    193190On Windows, UVD is accessible via standard DXVA2/D3D11VA APIs, while VCE is supported via AMF. 
    194191 
    195 == External resources == 
     192= External resources = 
    196193 
    197 * http://multimedia.cx/eggs/mac-hwaccel-video/ 
    198 * http://thread.gmane.org/gmane.comp.video.ffmpeg.libav.user/11691 
    199 * http://stackoverflow.com/questions/23289157/how-to-use-hardware-acceleration-with-ffmpeg 
     194* [https://multimedia.cx/eggs/mac-hwaccel-video/ multimedia.cx: How To Play Hardware Accelerated Video on A Mac] 
     195* [https://lists.ffmpeg.org/pipermail/libav-user/2013-September/005463.html libav-user: Hardware accelerated decoding] 
     196* [https://stackoverflow.com/questions/23289157/how-to-use-hardware-acceleration-with-ffmpeg Stack Overflow: How to use hardware acceleration with ffmpeg]