It is the 19th of February 2017

How to setup HW accelerated Vlc on Raspberry PI 2

Wrapup of what is required to run HW accelerated (mmal/omxil) Vlc on the Raspberry PI 2 to play Youtube Videos with TVlc.

What does not work:

  • h264 Playback. So you will get 360p Youtube Videos most of the time.
pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.1.13-v7+ #826 SMP PREEMPT Fri Nov 13 20:19:03 GMT 2015 armv7l GNU/Linux

pi@raspberrypi:~ $ cat /etc/issue
Raspbian GNU/Linux 8 \n \l
pi@raspberrypi:~ $ vcgencmd version Nov 18 2015 15:43:45 Copyright (c) 2012 Broadcom version 0c9af7cde38e223c95c3404f468db8fc5004495c (clean) (release)
pi@raspberrypi:~ $ vlc --version
VLC media player 2.2.2 Weatherwax (revision 2.2.1-334-g0f94bb5)
VLC version 2.2.2 Weatherwax (2.2.1-334-g0f94bb5)
Compiled by pi on raspberrypi (Dec 13 2015 11:05:42)
Compiler: gcc version 4.9.2 (Raspbian 4.9.2-10)

One line install

curl -L https://github.com/teiresias/tvlc-bootstrap/raw/master/tvlc-bootstrap-raspberry-pi2.sh | sudo bash

Compile VLC

1. Install prerequisites

sudo apt-get install git libtool build-essential pkg-config autoconf
sudo apt-get install liba52-0.7.4-dev libdirac-dev libdvdread-dev libkate-dev libass-dev libbluray-dev libcddb2-dev libdca-dev libfaad-dev libflac-dev libmad0-dev libmodplug-dev libmpcdec-dev libmpeg2-4-dev libogg-dev libopencv-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 libdvbpsi-dev libasound2-dev libxml2-dev libxpm-dev libsdl1.2-dev sdl-image1.2 libxcb-keysyms1-dev libxinerama-dev libxext-dev qt4-dev-tools libvpx1 libvpx-dev libiso9660-dev libgnutls28-dev
sudo apt-get install pulseaudio alsa-utils

 2. Get Vlc-2.2 Source

Vlc 3 is not working with hardware acceleration on Raspberry PI 2 right now.

git clone git://git.videolan.org/vlc/vlc-2.2.git
cd vlc-2.2
./bootstrap
./configure --prefix=/usr/local --enable-mmal --enable-rpi-omxil --enable-flac --enable-omxil --enable-omxil-vout --enable-dbus --enable-libmpeg2 --enable-vpx --enable-mkv --enable-mpc --enable-theora --enable-dvbpsi --enable-x264 --enable-bluray=no
./compile
echo $?
sudo make install
echo $?

 This will take some hours...

3. Start VLC with mmal

vlc --vout mmal_vout --mmal-adjust-refreshrate --deinterlace 0 --extraintf=http --http-password foo --preferred-resolution=360

or to use omxil (Seems to run more stable for me. mmal unfortunately currently sometimes crashes vlc):

vlc --vout omxil_vout --deinterlace 0 --extraintf=http --http-password foo --preferred-resolution=360

 

4. Set audio output module

Go to Tools->Settings->audio and select  ALSA as output module and bcm2835 as output device to avoid sound lags.

TVlc Raspberry PI Flag

In TVlc go to Settings and activate the Raspberry PI Flag.  (Available with Version 6.0.3 - 2015-12-20)

Autostart VLC on Raspberry PI 2 boot

pi@raspberrypi:~ $ cat .config/autostart/tvlc.desktop 
[Desktop Entry]
Type=Application
Exec=vlc --vout mmal_vout --mmal-adjust-refreshrate --deinterlace 0 --extraintf=http --http-password foo --preferred-resolution=360

 

Related Posts

Featured Apps

Free Money