Saturday, June 9, 2012

Raspberry Pi - 1080p playback

Note to future self / stangers on the Internet: this is how you get 1080p playback on the Raspberry Pi using the standard Debian image.

- Do no use VLC or MPlayer - they don't have hardware support.
- Compile and install omxplayer.
- To get HDMI audio add option -o hdmi.
- Widescreen movies show the frabebuffer in the black stripes. Add option -r to set appropiate HDMI mode.
- Setting HDMI mode breaks console / desktop, reset HDMI afterwards.

Here are two nice scripts to do that:

[Reset HDMI/TV - reset_tv.sh]
#!/bin/bash
sudo /opt/vc/bin/tvservice -p > /dev/null
sudo /opt/vc/bin/tvservice -o
sudo /opt/vc/bin/tvservice -p
echo "bcm2708_fb" | sudo tee -a /sys/bus/platform/drivers/bcm2708_fb/unbind > /dev/null
echo "bcm2708_fb" | sudo tee -a /sys/bus/platform/drivers/bcm2708_fb/bind > /dev/null

[PLAY A FILE AND RESET AFTERWARDS - play]
#!/bin/bash
omxplayer -o hdmi -wyr $@
reset_tv.sh

Add both to /bin or anywhere in your $PATH.


Now, to play a file:
pi@raspberrypi:~$ play /PATH/TO/FILE.mkv

Enjoy!

1 comment:

hardlined said...

Thanks, just what I was looking for.