Video Acceleration API: Difference between revisions

Content deleted Content added
Fixed text, pardon.
Citation bot (talk | contribs)
Added website. | Use this bot. Report bugs. | #UCB_CommandLine
 
(41 intermediate revisions by 26 users not shown)
Line 1:
{{jargon|date=November 2021}}
{{Short description|Open source API for video acceleration}}
{{Infobox software
| name = libva
| author = [[Intel]]
| released = {{#statements:inception}}
| developer =
| latest release version = 2.8.0{{wikidata|property|reference|P348}}
| released = {{Start date and age|2007|09|13}} <!-- First commit to git -->
| latest release date = {{Startstart date and age|2020{{wikidata|qualifier|06P348|18P577}}}}
| discontinued =
| programming language = {{#statements:programmed in}}
| latest release version = 2.8.0
| operating system = [[Linux]], [[Android (operating system)|Android]], [[Berkeley Software Distribution|BSD]], [[Windows 10]], [[Windows 11]]
| latest release date = {{Start date and age|2020|06|18}}
| genre = [[API]]
| repo = {{URL|https://github.com/intel/libva}}
| license = {{#statements:copyright license}}
| programming language = [[C (programming language)|C]]
| operating system = [[Linux]], [[Android (operating system)|Android]], [[Berkeley Software Distribution|BSD]]
| genre = [[API]]
| license = [[MIT License]]
| website = {{URL|freedesktop.org/wiki/Software/vaapi}}
}}
 
'''Video Acceleration API''' ('''VA-API''') is an [[open source]] [[Applicationapplication programming interface|API]] that allows applications such as [[VLC media player]] or [[GStreamer]] to use hardware video acceleration capabilities, usually provided by the [[graphics processing unit]] (GPU). It is implemented by the [[free and open-source]] [[Library (computing)|library]] <tt>{{mono|libva</tt>}}, combined with a hardware-specific driver, usually provided together with the GPU driver.
 
VA-API video decode/encode interface is platform and window system independent but is primarily targeted at [[Direct Rendering Infrastructure]] (DRI) in [[X Window System]] on [[Unix]]-like [[operating system]]s (including [[Linux]], [[FreeBSD]], [[Solaris (operating system)|Solaris]]), and [[Android (operating system)|Android]], however it can potentially also be used with direct [[framebuffer]] and graphics sub-systems for video output. Accelerated processing includes support for [[Video codec|video decoding]], [[video coding|video encoding]], subpicture blending, and rendering.<ref name="ReferenceA">{{cite web|url=https://www.phoronix.com/scan.php?page=news_item&px=MTA0NDI|title=VA-API Video Acceleration On Intel Medfield - Phoronix|website=Phoronix.com|accessdateaccess-date=23 February 2019}}</ref>
 
The VA-API specification was originally designed by [[Intel]] for its [[Intel GMA|GMA (Graphics Media Accelerator)]] series of [[Graphics processing unit|GPU]] hardware with the specific purpose of eventually replacing the [[XvMC]] standard as the default Unix multi-platform equivalent of [[DirectX Video Acceleration|Microsoft Windows DirectX Video Acceleration (DxVA) API]], but today the API is no longer limited to Intel-specific hardware or GPUs.<ref>{{cite web|url=https://events.linuxfoundation.org/images/stories/pdf/lceu2012_debski.pdf|title=Video4Linux2: Path to a Standardized Video Codec API|website=Events.linuxfoundation.org|accessdateaccess-date=23 February 2019|archive-date=6 January 2014|archive-url=https://web.archive.org/web/20140106032317/https://events.linuxfoundation.org/images/stories/pdf/lceu2012_debski.pdf|url-status=dead}}</ref> Other hardware and manufacturers can freely use this open standard API for hardware accelerated video processing with their own hardware without paying a royalty fee.<ref name="lwn.net">{{cite web |url=https://lwn.net/Articles/339349/ |title=VA API slowly, but surely, making progress |author=Nathan Willis |date=2009-07-01 |website=Lwn.net}}</ref>
 
== Overview ==
[[File:Vainfo screenshot.png|thumb|An example of vainfo output, showing supported video codecs for VA-API acceleration|502x502px]]
The main motivation for VA-API is to enable hardware-accelerated video decode at various entry-points ([[Variable-length code|VLD]], [[IDCT]], [[motion compensation]], [[Deblocking filter (video)|deblocking]]<ref name="MPlayer, FFmpeg Gain VA-API Support">{{cite web|url=https://www.phoronix.com/scan.php?page=article&item=xorg_vaapi_mplayer&num=1|title=Mplayer, FFmpeg Gain VA-API Support - Phoronix|website=Phoronix.com|accessdateaccess-date=23 February 2019}}</ref>) for the prevailing coding standards today ([[H.262/MPEG-2 Part 2|MPEG-2]], [[MPEG-4 Part 2|MPEG-4 ASP]]/[[H.263]], [[H.264/MPEG-4 AVC|MPEG-4 AVC/H.264]], [[High Efficiency Video Coding|H.265/HEVC]], and [[VC-1|VC-1/WMV3]]). Extending XvMC was considered, but due to its original design for MPEG-2 [[Motion Compensation|MotionComp]] only, it made more sense to design an interface from scratch that can fully expose the video decode capabilities in today's [[Graphics processing unit|GPU]]s.<ref name="freedesktop.org">{{cite web|url=https://www.freedesktop.org/wiki/Software/vaapi/|title=vaapi|website=Freedesktop.org|accessdateaccess-date=23 February 2019}}</ref>
 
=== Supported hardware and drivers ===
As of 20192022, VA-API is natively supported by:<ref name="archwiki">{{cite web |url=https://wiki.archlinux.org/index.php/Hardware_video_acceleration |title=Hardware video acceleration |work=wiki.ArchLinux.org}}</ref>
* [[Intel Quick Sync]] open-source drivers for Linux
* [[Mesa_(computer_graphics)|Mesa]] open-source drivers for AMD and IntelNvidia graphics cards
* AMDGPU-PRO drivers for AMD graphics cards on Linux
* Nvidia proprietary driver for Nvidia graphics cards on Linux
* libva-vdpau-driver for cards supported by [[VDPAU]]
* [[Direct3D#Direct3D 12|Direct3D 12]] implementations with the VAOn12 driver<ref>{{Cite web |last=Vilerino |first=Sil |date=2023-02-15 |title=Video acceleration API (VA-API) now available on Windows! |url=https://devblogs.microsoft.com/directx/video-acceleration-api-va-api-now-available-on-windows/ |access-date=2023-03-08 |website=DirectX Developer Blog |language=en-US}}</ref>
 
=== Supported video codecs ===
Line 46 ⟶ 45:
* [[High Efficiency Video Coding|H.265/HEVC]] encode acceleration
* H.265/HEVC decode acceleration
* [[VP9]] 8-bit encode acceleration<ref name="libav-vaapi">{{Cite web |url=https://wiki.libav.org/Hardware/vaapi |title=ArchivedHardware/vaapi copy|work=wiki.libav.org |access-date=2017-01-20 |archive-url=https://web.archive.org/web/20170201235322/https://wiki.libav.org/Hardware/vaapi |archive-date=2017-02-01 |url-status=deadlive }}</ref>
* VP9 8-bit and 10-bit decode acceleration<ref name="libav-vaapi"/>
* [[AV1]] 8-bit and 10-bit encode acceleration
* AV1 8-bit and 10-bit decode acceleration<ref name="archwiki" />
 
== Processes that can be accelerated with VA-API ==
Video decoding and post-processing processes that can be offloaded and accelerated if both the device drivers and GPU hardware supports them:
* [[Motion compensation]] (mocomp)
* [[Inverse discrete cosine transform]] (iDCT)
* In-loop [[deblocking filter (video)|deblocking filter]]
* Intra-frame prediction
* [[Huffman coding|Variablevariable-Lengthlength Decodingdecoding]] (VLD), more commonly known as slice-level acceleration
* Bitstream processing ([[Context-adaptive variable-length coding|CAVLC]]/[[Context-adaptive binary arithmetic coding|CABAC]])
 
== Software architecture ==
Line 64 ⟶ 65:
 
== Software supporting VA-API ==
[[File:VA-API log of video playback on Firefox.png|thumb|upright=1.4|A log of [[Firefox]] showing VA-API being used for video decoding acceleration]]
<!-- MPlayer does not support VA-API, please see discussion -->
* [[ClutterChromium (toolkitweb browser)|Chromium]]
* Bluecherry DVR client (starting from release 2.2.6)<ref>{{cite web |date=2 March 2017 |title=[Client] 2.2.6 Released – Significant CPU usage reductions included |url=http://www.bluecherrydvr.com/client-2-2-6-released-significant-cpu-usage-reductions-included/|title=[Client] 2.2.6 Released – Significant CPU usage reductions included|access-date=223 MarchFebruary 2019 2017|website=Bluecherrydvr.com|accessdate=23 February 2019}}</ref>
* [[Jellyfin]] media server
* datarhei Restreamer<ref>{{Cite web |title=datarhei Restreamer |url=https://docs.datarhei.com/restreamer/}}</ref> real-time live video streaming
* [[Emby]] media server (starting from release 3.0.6400) <ref>{{cite web|url=http://emby.media/|title=Emby Server 3.0.6400 Released|date=29 August 2016|website=Emby.media|accessdateaccess-date=23 February 2019}}</ref>
* [[Helix (project)|Helix media player]] ([[Linux]])<ref>{{cite web|url=http://lists.moblin.org/pipermail/dev/2008-September/002750.html|title=Mailing list entry that describes uses of VA-API|website=Lists.moblin.org|accessdate=23 February 2019}}</ref><ref>{{Cite web |url=https://community.helixcommunity.org/Licenses/realplayer_for_mid_faq.html |title=Archived copy |access-date=2011-05-12 |archive-url=https://web.archive.org/web/20120324001505/https://community.helixcommunity.org/Licenses/realplayer_for_mid_faq.html |archive-date=2012-03-24 |url-status=dead }}</ref>
* ''ffmpeg'', a command line tool from the [[FFmpeg]] project, supports VA-API encoding through CLI with version (starting from 3.1 and also [[libavcodec]] (also part of the FFmpeg project) does contain code that other applications use to support hardware accelerated decoding, including VA-API.<ref>{{Cite web |url=https://raw.githubusercontent.com/FFmpeg/FFmpeg/master/Changelog |title=Archived copy |access-date=2016-08-31 |archive-url=https://web.archive.org/web/20160916205031/https://raw.githubusercontent.com/FFmpeg/FFmpeg/master/Changelog |archive-date=2016-09-16 |url-status=dead }}</ref>
* [[Firefox]] (On Wayland since release 78 and on X11 since release 80) <ref>{{Cite web |date=3 June 2020 |title=Firefox on Fedora finally gets VA-API on Wayland |url=https://mastransky.wordpress.com/2020/06/03/firefox-on-fedora-finally-gets-va-api-on-wayland/ |access-date=2020-08-19 |website=mastransky.wordpress.com}}</ref><ref>{{Cite web |title=Firefox 80 Available With VA-API On X11, WebGL Parallel Shader Compile Support |url=https://www.phoronix.com/scan.php?page=news_item&px=Firefox-80-Released |access-date=2020-08-25 |website=www.phoronix.com}}</ref>
* Fluendo <ref>{{cite web|url=https://www.phoronix.com/scan.php?page=news_item&px=ODEwMw|title=Fluendo's New Codecs Support VDPAU, VA-API - Phoronix|website=Phoronix.com|accessdate=23 February 2019}}</ref>
* [[GnashFluendo<ref>{{Cite web (software)|Gnash]] Flashtitle=Fluendo |url=https:/ [[SWF]] player/fluendo.com/en/}}</ref><ref>{{cite web|url=https://www.phoronix.com/scan.php?page=news_item&px=NzU1MAODEwMw|title=H.264Fluendo's VA-APINew GPUCodecs VideoSupport AccelerationVDPAU, For FlashVA-API - Phoronix|website=Phoronix.com|accessdateaccess-date=23 February 2019}}</ref>
* [[GStreamer]]Frigate through <tt>gstreamer-vaapi</tt>NVR<ref>{{cite web|url=https://cgitdocs.freedesktopfrigate.orgvideo/configuration/gstreamerhardware_acceleration/gstreamer#via-vaapi|title=Hardware-accelerated video decoding, encoding and processing on Intel graphics through VA-API|website=Cgit.freedesktop.org|accessdate=23 February 2019Acceleration}}</ref>
* Fluendo[[Gnash (software)|Gnash]] Flash / [[SWF]] player<ref>{{cite web|url=https://www.phoronix.com/scan.php?page=news_item&px=ODEwMwNzU1MA|title=Fluendo'sH.264 NewVA-API CodecsGPU SupportVideo VDPAU,Acceleration VA-APIFor Flash - Phoronix|website=Phoronix.com|accessdateaccess-date=23 February 2019}}</ref>
* [[GStreamer]] through {{mono|gstreamer-vaapi}}<ref>{{cite web|url=https://cgit.freedesktop.org/gstreamer/gstreamer-vaapi|title=Hardware-accelerated video decoding, encoding and processing on Intel graphics through VA-API|website=Cgit.freedesktop.org|access-date=23 February 2019}}</ref>
* [[Helix (project)|Helix media player]] ([[Linux]])<ref>{{cite web |title=Mailing list entry that describes uses of VA-API |url=http://lists.moblin.org/pipermail/dev/2008-September/002750.html |titleaccess-date=Mailing23 listFebruary entry that describes uses of2019 VA-API|website=Lists.moblin.org|accessdate=23 February 2019}}</ref><ref>{{Cite web |title=RealPlayer for MID & Intel/Linux FAQ |url=https://community.helixcommunity.org/Licenses/realplayer_for_mid_faq.html |title=Archived copy |accessurl-datestatus=2011-05-12dead |archive-url=https://web.archive.org/web/20120324001505/https://community.helixcommunity.org/Licenses/realplayer_for_mid_faq.html |archive-date=2012-03-24 |urlaccess-statusdate=dead2011-05-12 |work=HelixCommunity.org}}</ref>
* [[Jellyfin]] media server<ref>{{Cite web |title=Intel GPU |url=https://jellyfin.org/docs/general/administration/hardware-acceleration/intel/ |access-date=2024-12-02 |website=jellyfin.org |language=en}}</ref>
<!--As of May 12th, 2011, ffmpeg does not support VA-API (libavcodec contains code that allows other applications to use VA-API). Before changing the following sentence, please discuss on the Discussion page! -->
* [[Kodi (software)|Kodi]] (formerly XBMC Media Center) ([[Linux]])<ref name="phoronix.com">{{cite web|url=https://www.phoronix.com/scan.php?page=news_item&px=ODEyNw|title=XBMC Gets Working Intel VA-API Support - Phoronix|website=Phoronix.com|accessdateaccess-date=23 February 2019}}</ref>
* [[Kodi (software)#Kodibuntu|Kodibuntu]] (formerly XBMC Live) (Linux Live CD/USB operating-system)<ref name="phoronix.com"/>
* [[libavcodec]]<ref>{{Cite web |last= |title=This gist contains instructions on setting up FFmpeg and Libav to use VAAPI-based hardware accelerated encoding (on supported platforms) for H.264 (and H.265 on supported hardware) video formats. |url=https://gist.github.com/jcf/266239b2b9106bcd00358acb77c1f12e |access-date=2024-12-02 |website=Gist |language=en}}</ref>
* [[MPlayer]] (v1 with patches)<ref>{{Cite web |url=https://gitorious.org/vaapi/mplayer |title=Archived copy |access-date=2014-02-10 |archive-url=https://web.archive.org/web/20130803044531/http://gitorious.org/vaapi/mplayer |archive-date=2013-08-03 |url-status=dead }}</ref> and its fork [[MPlayer#Forks|mpv]] (native)
* [[MPlayer]] with custom patches<ref>{{Cite web |title=gbeauchesne / mplayer-vaapi |website=[[GitHub]] |url=https://github.com/gbeauchesne/mplayer-vaapi}}</ref> and its fork [[Mpv (media player)|mpv]] (native)
* [[MythTV]] (starting from release 0.25)<ref>{{cite web|url=https://www.mythtv.org/wiki/Release_Notes_-_0.25|title=Release Notes - 0.25 - MythTV Official Wiki|website=Mythtv.org|accessdate=23 February 2019}}</ref>
* [[VLC media playerMythTV]] (starting from release 10.1.025)<ref>{{cite web|url=httphttps://www.videolanmythtv.org/vlcwiki/releases/1Release_Notes_-_0.1.0.html25|title=VLCRelease Notes - 10.1.025 release- -MythTV Official VideoLANWiki|website=VideolanMythtv.org|accessdateaccess-date=23 February 2019}}</ref>
* [[OpenOBS Broadcaster SoftwareStudio]]<ref>{{Cite web |title=OBS Studio Now Supports VA-API For Video Encoding - Phoronix |url=https://www.phoronix.com/scan.php?page=news_item&px=OBS-Studio-VA-API-H264 |access-date=2020-08-06 |website=www.phoronix.com}}</ref>
* Bluecherry DVR client (starting from release 2.2.6)<ref>{{cite web|url=http://www.bluecherrydvr.com/client-2-2-6-released-significant-cpu-usage-reductions-included/|title=[Client] 2.2.6 Released – Significant CPU usage reductions included|date=2 March 2017|website=Bluecherrydvr.com|accessdate=23 February 2019}}</ref>
* OpenShot<ref>{{Cite web |title=OpenShot Library {{!}} libopenshot |url=https://openshot.org/files/libopenshot/md_doc_HW-ACCEL.html}}</ref>
* [[Xine]] (via "''xine-lib-vaapi''" library) since Version 1.2.3 <ref>{{cite web|url=http://xine-project.org/news|title=the xine project - News Feed|website=Xine-project.org|accessdate=23 February 2019}}</ref>
* [[MythTVVLC media player]] (starting from release 01.251.0)<ref>{{cite web|url=httpshttp://www.mythtvvideolan.org/wikivlc/Release_Notes_-_0releases/1.251.0.html|title=Release Notes -VLC 01.251.0 -release MythTV Official- WikiVideoLAN|website=MythtvVideolan.org|accessdateaccess-date=23 February 2019}}</ref>
* [[Open Broadcaster Software]]<ref>{{Cite web|title=OBS Studio Now Supports VA-API For Video Encoding - Phoronix|url=https://www.phoronix.com/scan.php?page=news_item&px=OBS-Studio-VA-API-H264|access-date=2020-08-06|website=www.phoronix.com}}</ref>
* [[Xine]] (via "''xine-lib-vaapi''" library) since Version 1.2.3 <ref>{{cite web|url=http://xine-project.org/news|title=the xine project - News Feed|website=Xine-project.org|accessdateaccess-date=23 February 2019}}</ref>
* [[Firefox]] (On Wayland since release 78 and on X11 since release 80) <ref>{{Cite web|title=Firefox on Fedora finally gets VA-API on Wayland|url=https://mastransky.wordpress.com/2020/06/03/firefox-on-fedora-finally-gets-va-api-on-wayland/|access-date=2020-08-19|website=mastransky.wordpress.com}}</ref><ref>{{Cite web|title=Firefox 80 Available With VA-API On X11, WebGL Parallel Shader Compile Support|url=https://www.phoronix.com/scan.php?page=news_item&px=Firefox-80-Released|access-date=2020-08-25|website=www.phoronix.com}}</ref>
 
== See also ==