Tuesday, 3 July 2012

GPU Capability

The latest MagPi, the Raspberry Pi community’s free-to-download magazine, came out today and within it was a section on tweaks and fixes along with some of the free software which can be installed, one of which was the omxplayer. I had come across this package previously and played with it briefly on my Ubuntu Server, which was ultimately intended to run headless, so combined with the crappy performance I was seeing anyway, I didn't spend very much time with.  But given the RPi's Broadcom BCM2835 chipset, which is designed to handle intensive multimedia, it was an opportunity to have a look at the packages capabilities again. OMXplayer is run from the command line, meaning there is no GUI overhead in terms of a desktop environment from which it must be run.

Installing OMXPlayer

The debian package was liberated as follows:
wget http://seyrsnys.myzen.co.uk/rpi/omxplayer_0.0.1-arm.deb
and installed
sudo dpkg -i omxplayer_0.0.1-arm.deb
along with dependencies (-f fixes broken dependencies resulting from the previous line):
sudo apt-get -f install

Mounting Shared Folders

The omxplayer package was now installed, but I hadn't yet mounted my shares from the server on the RPi. In order to get this sorted out. I have Samba on the Ubuntu server because I share to Windows machines elsewhere on my network, so to keep things simple, I went the same route for the RPi mountings also.
The first step is to create a credentials file in the home folder of the default pi user:
sudo nano .smbcredentials
Within this file there are two lines:
username=my_username
password=my_password
Because this is not an entirely secure means of storing username and password data, the file is then set as read-only for the root user, although any user with access to root will be able to read it - which on the RPi's default user is anyone!
sudo chown root:root ~/.smbcredentials
sudo chmod 600 ~/.smbcredentials
The next step was to create mount points for the shared music and video folders:
sudo mkdir /mnt/music /mnt/video
Next, I changed the File System Table file /etc/fstab which will mount shared folders to those local folders whenever the RPi boots:
sudo nano /etc/fstab
Add in this file I added a line for each folder to be mounted as follows:
//server/music /mnt/music smbfs credentials=/home/pi/.smbcredentials,uid=1000,gid=1000
//server/video /mnt/video smbfs credentials=/home/pi/.smbcredentials,uid=1000,gid=1000
A quick reboot and we're done; checking the contents of /mnt/video shows the contents of the server's shared folder as expected.

Playing a video

The last thing to do is actually play a video and see what happens! The video of choice is Big Buck Bunny, an open source video which was made using open source software such as Ubuntu, Inkscape, Blender and GIMP. What's more, this is a high definition video, outputting 1080p, which whould really exercise the RPi's GPU!  And the result? Pin sharp rendering which my P&S camera simply cannot do justice to!



The only issue I now need to overcome is putting the audio out through the HDMI port along with video, but in the interim the audio socket on the RPi is doing the job perfectly.

Quite hungry in terms of CPU demand!!


Credits for the post must go to:
http://www.themagpi.com
https://help.ubuntu.com/community/MountWindowsSharesPermanently
http://www.bigbuckbunny.org


No comments:

Post a Comment