I recently took the plunge and bought a Raspberry Pi to replace my tired and decrepit old Dell Server. The main purpose of which was to hook it up to an external hard drive, leave it plugged into my TV and watch some movies on it. Basically a torrent/video box with maybe some web hosting thrown into the mix.
So the pi works out the box with NOOBS and I went straight for Raspbian as I preferred the Debian based system. However when I started with the machine it became apparent that there is actually a problem with playing videos…
The Pi isn’t a powerful computer, and as such has problems playing videos outside of specific environments such as XBMC, and since I wanted to stay away from dual boots I thought I better make it work. I tried a few solutions like VLC and Gnome-MPlayer but the hardware platform made videos a bit difficult, there was only one application that worked, OMXPlayer.
OMX is a command line video player (which sounded redundant from the start) and when I ran the command to open a video it seemed to work audio and video perfectly, however using the command line for everything is not my style, I was quite happy to keep using OXM but I was more in the mood for a double click and play situation.
Luckily I found a forum post (X) that showed me just what I was after, you can create a symbolic shortcut to OXMplayer that you can launch from the menu, and you can add an argument into the command so that you can pass a file path with a double click of the file.
First of all you need to open up a terminal and enter the following command to create the shortcut.
sudo nano /usr/share/applications/oxmplayer.desktop
then paste in the following lines
[Desktop Entry]
Type=Application
Name=OMXPlayer
Categories=AudioVideo;Player;
Exec=lxterminal –command “omxplayer -o hdmi %f”
Terminal=false
Icon=/usr/share/icons/nuoveXT2/96x96/categories/applications-multimedia.png
Use CTRL+X to save the shortcut and when closed there should be a new item in your menu showing OMXplayer
Double clicking this item will not do much as there is no file to actually play, however you can change the default player of video files to use this application using by right clicking a video and pointing to this shortcut.
You can now double click on a video and it will launch in OMXPlayer command line.
There is however further problems, specifically to do with resolutions, because unfortunately for some reason if the video doesn’t match your monitor resolution you will end up with bars on the sides of the screen
as you can see in the picture the sides are still visible because unfortunately earlier episodes of Sunny in Philadelphia wasn’t shot in widescreen. The video is already running as large as we can, but we need to find some way to blacken the screen.
Checking the man options for OMXplayer I found that by adding the -b argument to OMXPlayer it will black the edges of the screen for you to make video time a bit better.
Some people have indicated that there are issues with the screen refreshing or not coming back on after a video which was discussed in this bug.
So to make the screen blackout during your video change the following
[Desktop Entry]
Type=Application
Name=OMXPlayer
Categories=AudioVideo;Player;
Exec=lxterminal –command “omxplayer -b -o hdmi %f ”
Terminal=false
Icon=/usr/share/icons/nuoveXT2/96x96/categories/applications-multimedia.png
and that should do it easy videos.
Since the OMXPlayer is in command line there is no GUI so here is a helpful list of how to actually control the player here
Leave a Reply