Difference between revisions of "VLC VAAPI"
m (Remove duplicate link to Wikipedia article) |
|||
(12 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | {{wikipedia| | + | {{wikipedia|Video Acceleration API}} |
== Introduction to GPU decoding in VLC == | == Introduction to GPU decoding in VLC == | ||
+ | {{See also|VLC GPU Decoding}} | ||
− | The VLC framework can use your '''''graphic card''''' (aka GPU) to decode H.264 streams (wrongly called HD videos) under certain | + | The VLC framework can use your '''''graphic card''''' (aka GPU) to decode H.264 streams (wrongly called HD videos) under certain circumstances. |
VLC, in its '''modular''' approach and its transcoding/streaming capabilities, does decoding in GPU at the '''decoding stage only''' and then gets the data back to go to the other stages (streaming, filtering or plug any video output after that). | VLC, in its '''modular''' approach and its transcoding/streaming capabilities, does decoding in GPU at the '''decoding stage only''' and then gets the data back to go to the other stages (streaming, filtering or plug any video output after that). | ||
Line 11: | Line 12: | ||
− | == Introduction to compilation of VAAPI in VLC == | + | == Introduction to compilation of VAAPI in VLC == |
− | This page is about compiling VLC with support of GPU acceleration on Linux. | + | This page is about compiling VLC with support of GPU acceleration on Linux. For Windows, look at [[VLC_DxVA2]].<br> |
This howto has been written by [[User:J-b|Jean-Baptiste Kempf]] and tested with nVidia GPU. | This howto has been written by [[User:J-b|Jean-Baptiste Kempf]] and tested with nVidia GPU. | ||
− | + | http://www.freedesktop.org/wiki/Software/vaapi | |
− | |||
− | http://www.freedesktop.org/wiki/Software/vaapi | ||
− | |||
− | |||
== Before starting == | == Before starting == | ||
Line 27: | Line 24: | ||
=== libva === | === libva === | ||
− | Install libva from http://www.splitted-desktop.com/~gbeauchesne/libva/ . We do not support other libraries than the one from Mr Beauchesne. | + | Install libva from http://www.splitted-desktop.com/~gbeauchesne/libva/.{{dead link}} We do not support other libraries than the one from Mr Beauchesne. |
=== Drivers === | === Drivers === | ||
Line 33: | Line 30: | ||
==== nVidia ==== | ==== nVidia ==== | ||
− | http://www.splitted-desktop.com/~gbeauchesne/vdpau-video/ for nVidia. | + | http://www.splitted-desktop.com/~gbeauchesne/vdpau-video/ for nVidia.{{dead link}} Use at least version 0.6.2. |
− | + | ==== ATI ==== | |
− | + | http://www.splitted-desktop.com/~gbeauchesne/xvba-video/ for ATI.{{dead link}} Use at least 0.6.4. | |
+ | |||
+ | Check if LIBVA environment variables are correctly configured: | ||
+ | |||
+ | set | grep LIBVA | ||
+ | |||
+ | Should output something like: | ||
+ | |||
+ | LIBVA_DRIVER_NAME=xvba | ||
+ | LIBVA_DRIVERS_PATH=/usr/lib64/va/drivers | ||
− | + | If not, add these, according to your library path, to your system environment variables (/etc/environment ?) | |
− | + | Then run | |
vainfo | vainfo | ||
− | To check if everything works. | + | which should return something like: |
+ | |||
+ | VAProfileH264High : VAEntrypointVLD | ||
+ | VAProfileVC1Advanced : VAEntrypointVLD | ||
+ | |||
+ | To check if everything works. | ||
=== FFmpeg trunk === | === FFmpeg trunk === | ||
Line 55: | Line 66: | ||
make install | make install | ||
− | Copy vaapi.h to the includes | + | Copy vaapi.h to the includes, if not done (newer FFmpeg should do that automagically) |
=== VLC === | === VLC === | ||
Line 69: | Line 80: | ||
== Compile VLC with vaapi == | == Compile VLC with vaapi == | ||
− | + | Configure VLC. | |
− | |||
− | |||
Edit vlc-config and add | Edit vlc-config and add | ||
Line 77: | Line 86: | ||
-lX11 -lva-x11 | -lX11 -lva-x11 | ||
− | to the avcodec line. | + | to the avcodec line. (Step no longer required with recent builds) |
Mine looks like this: | Mine looks like this: | ||
Line 95: | Line 104: | ||
./vlc --list | grep avcodec | ./vlc --list | grep avcodec | ||
− | should return something. | + | should return something. |
== Activate == | == Activate == | ||
Activate acceleration in the preferences. | Activate acceleration in the preferences. | ||
+ | |||
+ | Or directly on command line | ||
+ | |||
+ | vlc --ffmpeg-hw | ||
+ | |||
+ | Exemple: on playback log output (with -v debug and ATI VAAPI) | ||
+ | |||
+ | [0x7f8c4cc03ba8] avcodec decoder: Using VA API version 0.32 for hardware decoding. | ||
Profit | Profit | ||
+ | |||
+ | [[Category:Building]] | ||
+ | [[Category:GNU/Linux]] | ||
+ | [[Category:How To]] |
Latest revision as of 06:26, 9 February 2019
Contents
Introduction to GPU decoding in VLC
The VLC framework can use your graphic card (aka GPU) to decode H.264 streams (wrongly called HD videos) under certain circumstances.
VLC, in its modular approach and its transcoding/streaming capabilities, does decoding in GPU at the decoding stage only and then gets the data back to go to the other stages (streaming, filtering or plug any video output after that).
What that means is that, compared to some other implementation, GPU decoding in VLC can be slower because it needs to get the data back from the GPU. But you can plug ANY video output (sink) to it and use all the VLC video filters.
Introduction to compilation of VAAPI in VLC
This page is about compiling VLC with support of GPU acceleration on Linux. For Windows, look at VLC_DxVA2.
This howto has been written by Jean-Baptiste Kempf and tested with nVidia GPU.
http://www.freedesktop.org/wiki/Software/vaapi
Before starting
libva
Install libva from http://www.splitted-desktop.com/~gbeauchesne/libva/.[dead link] We do not support other libraries than the one from Mr Beauchesne.
Drivers
nVidia
http://www.splitted-desktop.com/~gbeauchesne/vdpau-video/ for nVidia.[dead link] Use at least version 0.6.2.
ATI
http://www.splitted-desktop.com/~gbeauchesne/xvba-video/ for ATI.[dead link] Use at least 0.6.4.
Check if LIBVA environment variables are correctly configured:
set | grep LIBVA
Should output something like:
LIBVA_DRIVER_NAME=xvba LIBVA_DRIVERS_PATH=/usr/lib64/va/drivers
If not, add these, according to your library path, to your system environment variables (/etc/environment ?)
Then run
vainfo
which should return something like:
VAProfileH264High : VAEntrypointVLD VAProfileVC1Advanced : VAEntrypointVLD
To check if everything works.
FFmpeg trunk
Get the latest FFmpeg trunk as of 2010-January. Compile it with vaapi hwaccel support.
./configure --enable-gpl --enable-postproc --prefix=/path/to/ --enable-shared --enable-vaapi make make install
Copy vaapi.h to the includes, if not done (newer FFmpeg should do that automagically)
VLC
Get VLC from Git. Get the necessary external libraries (on debian/*buntu: apt-get build-dep vlc)
./bootstrap ./configure make
Compile VLC with vaapi
Configure VLC.
Edit vlc-config and add
-lX11 -lva-x11
to the avcodec line. (Step no longer required with recent builds)
Mine looks like this:
avcodec) cflags="${cflags} -I/home/jb/VideoLAN/vlc/vlc/extras/ffmpeg" libs="${libs} /home/jb/vlc/extras/ffmpeg/libavcodec/libavcodec.a /home/jb/vlc/extras/ffmpeg/libavutil/libavutil.a -lz -lm -lva -ldl -ljack -lasound -lm -lX11 -lva-x11"
Recompile VLC
make clean && make
Check
That everything went ok:
./vlc --list | grep avcodec
should return something.
Activate
Activate acceleration in the preferences.
Or directly on command line
vlc --ffmpeg-hw
Exemple: on playback log output (with -v debug and ATI VAAPI)
[0x7f8c4cc03ba8] avcodec decoder: Using VA API version 0.32 for hardware decoding.
Profit