Changes between Version 46 and Version 47 of HWAccelIntro


Ignore:
Timestamp:
Jul 19, 2017, 11:49:18 PM (5 weeks ago)
Author:
jkqxz
Comment:

Improve introduction and summary tables

Legend:

Unmodified
Added
Removed
Modified
  • HWAccelIntro

    v46 v47  
    11[[PageOutline(2, Contents)]] 
    22 
    3 FFmpeg provides a subsystem for hardware acceleration. 
    4  
    5 Hardware acceleration allows to use specific devices (usually graphical card or other specific devices) to perform multimedia processing. This allows to use dedicated hardware to perform demanding computation while freeing the CPU from such computations. Typically hardware acceleration enables specific hardware devices (usually the GPU) to perform operations related to decoding and encoding video streams, or filtering video. 
    6  
    7 When using FFmpeg the tool, HW-assisted decoding is enabled using through the {{{-hwaccel}}} option, which enables a specific decoder. Each decoder may have specific limitations (for example an H.264 decoder may only support baseline profile). HW-assisted encoding is enabled through the use of a specific encoder (for example {{{h264_nvenc}}}). Filtering HW-assisted processing is only supported in a few filters, and in that case you enable the OpenCL code through a filter option. 
    8  
    9 There are several hardware acceleration standards API, some of which are supported to some extent by FFmpeg. 
    10  
    11 == Platforms overview == 
    12  
    13 === API availability === 
    14  
    15 ||= =||= Linux Intel =||= Linux NVIDIA =||= Windows Intel =||= Windows NVIDIA =||= OS X =||= Android =||= iOS =||= Raspberry Pi =|| 
    16 ||= CUDA          =|| N || Y  || N || Y || Y || N || N || N || 
    17 ||= Direct3D 11   =|| N || N  || Y || Y || N || N || N || N || 
    18 ||= DXVA2         =|| N || N  || Y || Y || N || N || N || N || 
    19 ||= !MediaCodec   =|| N || N  || N || N || N || Y || N || N || 
    20 ||= MMAL          =|| N || N  || N || N || N || N || N || Y || 
    21 ||= NVENC         =|| N || Y  || N || Y || N || N || N || N || 
    22 ||= OpenCL        =|| Y || Y  || Y || Y || Y || N || N || N || 
    23 ||= Quick Sync    =|| Y || N  || Y || N || N || N || N || N || 
    24 ||= VA-API        =|| Y || Y* || N || N || N || N || N || N || 
    25 ||= VDA†          =|| N || N  || N || N || Y || N || N || N || 
    26 ||= VDPAU         =|| N || Y  || N || N || N || N || N || N || 
    27 ||= !VideoToolbox =|| N || N  || N || N || Y || N || Y || N || 
    28 ||= XvMC          =|| Y || Y  || N || N || N || N || N || N || 
    29  
    30 ^^* Semi-maintained. 
    31  
    32 † Deprecated by upstream. 
    33  
    34 === FFmpeg implementations === 
    35  
    36 ||= =||= AVHWAccel =||= Decoder =||= Encoder =||= CLI =||= Filtering =|| `AVHWFramesContext` 
    37 ||= CUDA^1^       =|| Y   || Y   || N^2^ || Y   || Y   || Y   || 
    38 ||= Direct3D 11   =|| Y   || N   || N/A || N   || N   || N   || 
    39 ||= DXVA2         =|| Y   || N   || N/A || Y   || N   || Y   || 
    40 ||= !MediaCodec   =|| Y   || Y   || N   || N/A || N/A || N   || 
    41 ||= MMAL          =|| Y   || Y   || N/A || N   || N/A || N   || 
    42 ||= NVENC         =|| N/A || N^3^ || Y   || Y   || N/A || N   || 
    43 ||= OpenCL        =|| N/A || N/A || N/A || N/A || Y   || N   || 
    44 ||= Quick Sync    =|| Y   || Y   || Y   || Y   || N   || N*  || 
    45 ||= VA-API        =|| Y   || N   || Y   || Y   || Y   || Y   || 
    46 ||= VDA           =|| Y   || Y   || N/A || Y   || N/A || N   || 
    47 ||= VDPAU         =|| Y   || N†  || N/A || Y   || N   || Y   || 
    48 ||= !VideoToolbox =|| Y   || N   || Y   || Y   || N   || N   || 
    49 ||= XvMC          =|| Y   || N†  || N/A || N   || N/A || N   || 
    50  
    51 N/A This feature is not directly supported by the API, or is not currently implementable. 
    52  
    53 ^^* Work in progress. If "Y" is indicated, infrastructure is in place but no filters have been implemented yet. 
    54  
    55 † Actually yes, but is deprecated for technical reasons and should not be used. 
    56  
    57 ^1^ Also known as "CUDA Video Decoding API" or "CUVID" or "NvDecode". 
    58  
    59 ^2^ See NVENC 
    60  
    61 ^3^ See CUDA 
     3Many 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). 
     4 
     5Hardware decoders will generate equivalent output to software decoders, but may use less power and CPU to do so.  Feature support varies - for more complex codecs with many different profiles, hardware decoders rarely implement all of them (for example, hardware decoders tend not to implement anything beyond YUV 4:2:0 at 8-bit depth for H.264).  A common feature of many hardware decoders to be able to generate output in hardware surfaces suitable for use by other components (with discrete graphics cards, this means surfaces in the memory on the card rather than in system memory) - this is often useful for playback, as no further copying is required before rendering the output, and in some cases it can also be used with encoders supporting hardware surface input to avoid any copying at all in transcode cases. 
     6 
     7Hardware encoders typically generate output of significantly lower quality than good software encoders like x264, but are generally faster and do not use much CPU resource.  (That is, they require a higher bitrate to make output with the same perceptual quality, or they make output with a lower perceptual quality at the same bitrate.) 
     8 
     9Systems with decode and/or encode capability may also offer access to other related filtering features.  Things like scaling and deinterlacing are common, other postprocessing may be available depending on the system.  Where hardware surfaces are usable, these filters will generally act on them rather than on normal frames in system memory. 
     10 
     11There are a lot of different APIs of varying standardisation status available.  FFmpeg offers access to many of these, with varying support. 
     12 
     13 
     14== Platform API Availability == 
     15 
     16|| ||||||= Linux =||||||= Windows =||= Android =||||= Apple =||= Other =|| 
     17|| ||= AMD =||= Intel =||= Nvidia =||= AMD =||= Intel =||= Nvidia =||= =||= macOS =||= iOS =||= Raspberry Pi =|| 
     18|| CUDA / CUVID / NVENC || N || N || Y || N || N || Y || N || N || N || N || 
     19|| Direct3D 11          || N || N || N || Y || Y || Y || N || N || N || N || 
     20|| Direct3D 9 (DXVA2)   || N || N || N || Y || Y || Y || N || N || N || N || 
     21|| libmfx               || N || Y || N || N || Y || N || N || N || N || N || 
     22|| !MediaCodec          || N || N || N || N || N || N || Y || N || N || N || 
     23|| Media Foundation     || N || N || N || Y || Y || Y || N || N || N || N || 
     24|| MMAL                 || N || N || N || N || N || N || N || N || N || Y || 
     25|| OpenCL               || Y || Y || Y || Y || Y || Y || P || Y || N || N || 
     26|| OpenMAX              || P || N || N || N || N || N || P || N || N || Y || 
     27|| V4L2 M2M             || N || N || N || N || N || N || P || N || N || N || 
     28|| VAAPI                || P || Y || P || N || N || N || N || N || N || N || 
     29|| VDA                  || N || N || N || N || N || N || N || Y || N || N || 
     30|| VDPAU                || P || N || Y || N || N || N || N || N || N || N || 
     31|| !VideoToolbox        || N || N || N || N || N || N || N || Y || Y || N || 
     32 
     33Key: 
     34* Y  Fully usable. 
     35* P  Partial support (some devices / some features). 
     36* N  Not possible. 
     37 
     38 
     39== FFmpeg API Implementation Status == 
     40 
     41|| ||||||=  Decoder  =||||=  Encoder  =||||||=  Other support  =|| 
     42|| || Internal || Standalone || Hardware output || Standalone || Hardware input || Filtering || Hardware context || Usable from ffmpeg CLI || 
     43|| CUDA / CUVID / NVENC || N || Y || Y || Y || Y || Y || Y || Y || 
     44|| Direct3D 11          || Y || - || Y || - || - || F || Y || Y || 
     45|| Direct3D 9 / DXVA2   || Y || - || Y || - || - || N || Y || Y || 
     46|| libmfx               || - || Y || Y || Y || Y || Y || Y || Y || 
     47|| !MediaCodec          || - || Y || Y || N || N || - || N || N || 
     48|| Media Foundation     || - || N || N || N || N || N || N || N || 
     49|| MMAL                 || - || Y || Y || N || N || - || N || N || 
     50|| OpenCL               || - || - || - || - || - || Y || F || F || 
     51|| OpenMAX              || - || N || N || Y || N || N || N || Y || 
     52|| !RockChip MPP        || - || F || F || N || N || - || F || F || 
     53|| V4L2 M2M             || - || N || N || N || N || N || N || N || 
     54|| VAAPI                || Y || - || Y || Y || Y || Y || Y || Y || 
     55|| VDA                  || Y || N || Y || - || - || - || N || Y || 
     56|| VDPAU                || Y || - || Y || - || - || N || Y || Y || 
     57|| !VideoToolbox        || Y || N || Y || Y || Y || - || Y || Y || 
     58 
     59Key: 
     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. 
    6264 
    6365