Playing videos

We can play video and audio files using OMXPlayer, which was specifically designed by the XBMC project, and it uses hardware decoding on the Raspberry Pi. Since OMXPlayer uses hardware decoders, it is possible for you to use any additionally purchased video licenses.

Tip

OMXPlayer requires at least 256 MB GPU RAM to run.

OMXPlayer for video playback

Download an MP4 file onto the Raspberry Pi (for example, we can use the site http://www.hd-trailers.net/ to find some links) and we will use OMXPlayer to play video and sound to the HDMI port. You can also use RTMP streams directly instead of video files. Replace the URL in wget with an existing file on the Internet:

sudo apt-get install omxplayer 
cd /tmp 
sudo wget http://videosite.com/filename.mp4 ...

Get Raspberry Pi 2 Server Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.