Sunday, October 21, 2012

Watching Movies on the Pi

A word to the wise.  Don't even think about trying to get VLC working.  I have one of the new 512 meg of ram RPis and it is still super chunky and slow.  Omxplayer is your best bet (once it's working) and, based on my reading at least, is the only viewer able to utilise hardware acceleration.

Step 1:  Buy the MPEG-2 license key.  No really, not affiliated with the store or anything, but it makes such a huge difference for high resolution DivX, Xvid, MPEG-2, etc, files for such a small price, why wouldn't you?  To get your serial number type cat /proc/cpuinfo into the terminal.

Step 2:  Enter the licence key they send you into the config.txt file in the boot folder.  You can do this from the terminal by typing sudo leafpad /boot/config.txt
Then pasting the text from the email into its own line (it'll be all 'one word' and begin with 'decode_MPG2=' followed by a string of numbers and letter).

Step 3:  Reboot

Presumably you want to be able to control your movies without 'shelling in' (I know, right, I only vaguely know what that means, let alone am able to do it).  In that case just opening a file using omxplayer won't cut it.  Also, their is a good chance that there won't be any sound.  To fix these issues...

Step 4:  apt-get install xterm

Step 5:  Right click on the movie file you want to play and select 'Open with...'  Tick the box that says 'Set selected application as default action for this file type.'  Then click on the 'Custom Command Line' tab and enter the following:
xterm -e omxplayer -o hdmi -r %f
and click OK.

Step 6:  You can control the video (skip forward, back, pause, etc) using the following commands:

Space or p Pause/Resume

- Decrease Volume
+ Increase Volume

Left Seek -30
Right Seek +30
Down Seek -600
Seek +600

1 Increase Speed
2 Decrease Speed

j Previous Audio stream
k Next Audio stream

i Previous Chapter
o Next Chapter

s Toggle Subtitles
n Previous Subtitle stream
m Next Subtitle stream

q Quit


  1. Also take a look at XBIAN and RaspBMC, these are complete distributions geared to making your Pi into a Multimedia centre. I have them on different SD cards and they work great.

  2. Wow, thanks Keith. I do have a spare SD card or two, but haven't gotten around to trying these yet - will post when I do. My efforts to install XBMC onto Raspbian has met with varying degrees of (very time consuming) failure so, like you say, one of these options looks like a good option. :)

  3. Thanks for your suggestion of omxplayer which has enabled me to run movies in Raspbian but not quite the way you suggest, I think Raspbian has moved on now. However, I then discovered that gkreidl has written a GUI for omxplayer that works well, IMO, if you want to play movies in Raspbian as I do. (I'm not so good at the command line.) See
    However, as Keith suggests XBMC on a separate SD card is the best multimedia solution and Openelec on the Pi2, works very well indeed.
    Thanks again for your suggestion that enabled me to overcome the Raspbian problem with movies.