Posts: 10
Joined: Sat Jun 23, 2012 7:06 pm

SSH play script for omxplayer

Sat Jun 30, 2012 2:34 am

Hi guys, from reading a diff post on trying to do ssh to omxplayer and such and having the problem of seeing text on the screen with 16:9 movies on a 4:3 screen.

Do in the editor of choice, I use nano,

Code: Select all

nano play.sh
(you can use just play if you like)

Put this in there and save.

Code: Select all


# prevent screensaver from powering down display
setterm -blank off -powerdown off > /dev/tty0

# clear the display and turn off the flashing cursor
clear > /dev/tty0

setterm -cursor off > /dev/tty0

#You don't have to use -d it just makes it come up nicer on my old TV
omxplayer -d "$1" > /dev/tty0 

clear > /dev/tty0

# turn the cursor back on when done with omxplayer
setterm -cursor on > /dev/tty0
There is a problem with the first line tho, for some reason it actually does not turn the screensaver/power off feature, it doesn't effect the movie, but when the movie is over the screen will look like it's still blank, just press a key on the keyboard of the rasp and it'll come up.

Run this bit,

Code: Select all

cp play.sh /usr/bin/. && chmod +x /usr/bin/play.sh
Then you can do this. You must use sudo or the screen won't clear, if you run from root you don't need sudo.

Code: Select all

sudo play.sh ~/somemovie.avi
and it should start playing, note all controls will be from SSH not from the rasp, anything you press on the rasp's keyboard will not be noticed by omxplayer.

Referencing here, http://www.raspberrypi.org/phpBB3/viewt ... =35&t=5543

Return to “Media centres”