It's no secret that the Raspberry Pi has been a huge success ever since it was launched!
It's quite handy for prototyping, teaching programming, as a mini PC and it's also very widely used as media center box for the home TV.
Talking about media I you'll agree with me that many immediately think about VLC.
VLC has been very popular as a media player supporting almost every format as also as library (libvlc) used to develop applications with audio and video capabilities!
Well mixing those two, Raspberry Pi and VLC, might seem the perfect combination to most of you right? This would result in a small little box able to play almost every format and as the raspberry has HD capabilities it seems just perfect as media box for your home TV set!
Well that's what I first thought of too but as it turned out, VLC didn't support hardware acceleration on the Raspberry Pi since the beginning! So the perfect combination wasn't possible!
Luckily enough, after a long time, patches and custom modules were released to the VLC source code just for the Raspberry.
Now the problem was to find how to use that. It wasn't much talked about as most users ended up adopting Raspbmc, a media player with hardware accelerated video decoding on the raspberry.
Still for some people, like me, it was important to get VLC running with hardware acceleration on th Raspberry! For me it was mainly for development purposes (libvlc) !
I searched for a long time on the internet but didn't find any tutorial, binary or whatever version of VLC with hardware acceleration enabled so I decided to share this tutorial for all those who don't really understand how to compile VLC from source with hardware acceleration activated.
So here we go:
NOTE: I have compiled it under Raspbian distribution!
Step 0: environment preparation - build tools installation:
# apt-get install git libtool build-essential pkg-config autoconf
Step 1: get VLC sources from git:
# git clone git://git.videolan.org/vlc.git # cd vlc # ./bootstrapStep 2: configure enabling the important modules for hardware acceleration on raspberry:
# install all these libraries needed by VLC and it's modules:
liba52-0.7.4-dev libdirac-dev libdvdread-dev libkate-dev
libass-dev libbluray-dev libcddb2-dev libdca-dev
libmpcdec-dev libmpeg2-4-dev libogg-dev
libpostproc-dev libshout3-dev libspeex-dev libspeexdsp-dev
libssh2-1-dev liblua5.1-0-dev libopus-dev libschroedinger-dev
libsmbclient-dev libtwolame-dev libx264-dev libxcb-composite0-dev
libxcb-randr0-dev libxcb-xv0-dev libzvbi-dev
(thanks to user gkreidl on the http://www.raspberrypi.org forums for listing all those :))
# ./configure --enable-rpi-omxil --enable-dvbpsi --enable-x264 <other_modules_you_might_need>
(Info: the modules listed above used to configure the installation are the ones absolutely needed to enable hardware acceleration. You might need to enable or disable some others depending on your needs!) (Info: I am not sure anymore If the --enable-dvbpsi --enable-x264 are required but it surely doesn't hurt :) The most important here is --enable-rpi-omxil)
Update: depending on the modules you enable you most likely need to install third party libraries. configure will fail and tell you what library is missing. You'll have to install it and run configure all over again! Bring patience as you'll most likely have to repeat this a
Step 3: compile:
# make clean # make
Step 4: how to run it with hardware acceleration enabled from command line:
# ./vlc --vout omxil_vout <other_params_you_might_need>
(Info: you absolutely have to use the param --vout omxil_vout for vlc to use the custom video output for raspberry!)Step 6 (optional): !!! AT YOUR OWN RISK !!!
If you wish to playback HD content it is strongly recommended
to overclock your raspberry. You can download an example of a
config.txt file here: http://ul.to/48oyrf1z
You can either add the options in the overclock section in this config.txt
file to yours or simply replace your /boot/config.txt file with this one.
My tests showed the raspberry to run around +/-50°C when playing
back HD content.
Well guys that's it. This is the way I successfully compiled VLC with hardware acceleration enabled on Raspberry Pi! Libvlc is also working like a charm :)
Hope this helps a lot of people out as I remember seeing lots of folks asking for this.
Nice coding ;)
I forgot to mention that you might have to slightly overclock your Raspberry if you want to run fullscreen 1080p completely lag-free.
I'll post my Raspberry configuration file here on monday with the adequate overclocking configurations.
I updated the tutorial with some missing important information! I also got asked if I could upload an already compiled version so I'll try to do that tomorrow!
COMPILED VERSION FOR DOWNLOAD HERE:
I uploaded my compiled version! You can download it here if you do not wish to compile for your specific needs: