Difference between revisions of "VLC VAAPI"
Line 1: | Line 1: | ||
− | {{wikipedia|Video_Acceleration_API| VAAPI}} | + | {{wikipedia|Video_Acceleration_API| VAAPI}} |
− | == Introduction == | + | == 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 circonstances. | |
− | + | 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 == | |
− | ==== ATI ==== | + | This page is about compiling VLC with support of GPU acceleration on Linux. |
− | http://www.splitted-desktop.com/~gbeauchesne/xvba-video/ for ATI. | + | |
+ | This howto has been written by [[User:J-b|Jean-Baptiste Kempf]] and tested with nVidia GPU. | ||
+ | |||
+ | http://en.wikipedia.org/wiki/Video_Acceleration_API | ||
+ | |||
+ | http://www.freedesktop.org/wiki/Software/vaapi | ||
+ | |||
+ | |||
+ | |||
+ | == Before starting == | ||
+ | |||
+ | === libva === | ||
+ | |||
+ | Install libva from http://www.splitted-desktop.com/~gbeauchesne/libva/ . We do not support other libraries than the one from Mr Beauchesne. | ||
+ | |||
+ | === Drivers === | ||
+ | |||
+ | ==== nVidia ==== | ||
+ | |||
+ | http://www.splitted-desktop.com/~gbeauchesne/vdpau-video/ for nVidia. | ||
+ | |||
+ | Patch it with http://mailman.videolan.org/pipermail/vlc-devel/attachments/20100109/2cb302b3/attachment.patch | ||
+ | |||
+ | ==== ATI ==== | ||
+ | |||
+ | http://www.splitted-desktop.com/~gbeauchesne/xvba-video/ for ATI. | ||
+ | |||
+ | Run | ||
− | |||
vainfo | vainfo | ||
− | |||
− | === FFmpeg trunk === | + | To check if everything works. |
− | Get the latest FFmpeg trunk as of 2010-January. | + | |
− | Compile it with vaapi hwaccel support. | + | === 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 | ./configure --enable-gpl --enable-postproc --prefix=/path/to/ --enable-shared --enable-vaapi | ||
Line 36: | Line 55: | ||
make install | make install | ||
− | Copy vaapi.h to the includes. | + | Copy vaapi.h to the includes. |
+ | |||
+ | === VLC === | ||
+ | |||
+ | Get VLC from [[Git]]. Get the necessary external libraries (on debian/*buntu: apt-get build-dep vlc) | ||
− | |||
− | |||
− | |||
./bootstrap | ./bootstrap | ||
./configure | ./configure | ||
make | make | ||
+ | <br> | ||
− | == Compile VLC with vaapi == | + | == Compile VLC with vaapi == |
− | Patch VLC with http://vlc.pastebin.com/f59445620 | + | Patch VLC with http://vlc.pastebin.com/f59445620 |
− | Reconfigure VLC. | + | Reconfigure VLC. |
+ | |||
+ | Edit vlc-config and add | ||
− | |||
-lX11 -lva-x11 | -lX11 -lva-x11 | ||
− | |||
− | Mine looks like this: | + | to the avcodec line. |
+ | |||
+ | Mine looks like this: | ||
+ | |||
avcodec) | avcodec) | ||
cflags="${cflags} -I/home/jb/VideoLAN/vlc/vlc/extras/ffmpeg" | 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" | 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 === | + | === Recompile VLC === |
− | make clean && make | + | |
+ | make clean && make | ||
+ | |||
+ | === Check === | ||
+ | |||
+ | That everything went ok: | ||
− | |||
− | |||
./vlc --list | grep avcodec | ./vlc --list | grep avcodec | ||
− | |||
− | == Activate == | + | should return something. |
− | Activate acceleration in the preferences. | + | |
+ | == Activate == | ||
+ | |||
+ | Activate acceleration in the preferences. | ||
Profit | Profit |
Revision as of 16:56, 10 January 2010
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 circonstances.
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.
This howto has been written by Jean-Baptiste Kempf and tested with nVidia GPU.
http://en.wikipedia.org/wiki/Video_Acceleration_API
http://www.freedesktop.org/wiki/Software/vaapi
Before starting
libva
Install libva from http://www.splitted-desktop.com/~gbeauchesne/libva/ . We do not support other libraries than the one from Mr Beauchesne.
Drivers
nVidia
http://www.splitted-desktop.com/~gbeauchesne/vdpau-video/ for nVidia.
Patch it with http://mailman.videolan.org/pipermail/vlc-devel/attachments/20100109/2cb302b3/attachment.patch
ATI
http://www.splitted-desktop.com/~gbeauchesne/xvba-video/ for ATI.
Run
vainfo
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.
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
Patch VLC with http://vlc.pastebin.com/f59445620
Reconfigure VLC.
Edit vlc-config and add
-lX11 -lva-x11
to the avcodec line.
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.
Profit