## omxplayer play controls / input

djazz
Posts: 9
Joined: Fri Feb 03, 2012 3:26 pm
Location: Sweden
Contact: Website

### Re: omxplayer play controls / input

Try out omxradio, a web interface for playing webradio, youtube clips and local files on the pi, all controlled from a web interface on mobile/laptop. Written in nodejs and uses some HTML5 features to sync play queue and Now Playing across clients.

Juggler
Posts: 35
Joined: Wed Aug 08, 2012 7:29 am

### Re: omxplayer play controls / input

I've managed to create PHP WEB GUI for omxplayer. But I need some help to continue. No matter PHP, Python or javascript.
http://www.raspberrypi.org/phpBB3/viewt ... 7&p=212485

Is it possible to display some text without X using overlay or something similar to add info on the screen?
Is it possible get position or timecode from omxplayer, maybe we can mod it to support some output and draw some text?

gabello
Posts: 51
Joined: Sun Aug 05, 2012 8:02 pm

### Re: omxplayer play controls / input

Omxradio is a great app, thanks for that. It would be interesting to add a volume up/down on it.

fabiovaz
Posts: 2
Joined: Sun Mar 03, 2013 5:28 am

### Re: omxplayer play controls / input

Hi all,

Is it possible to play a video using a part of the screen using omxplayer?
Let's say I have a 1920x1080 screen and I want to play a video from the left top corner using on 800x600 window or maybe a centered window.

BR
Fabio.

KenT
Posts: 759
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

### Re: omxplayer play controls / input

There is a new option in the code on github, not sure it has made its way into the apt_get upgrade repository yet.

--win \"x1 y1 x2 y2\" Set position of video window\n");
Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more

Gomoto
Posts: 106
Joined: Tue Feb 12, 2013 1:21 am

### Re: omxplayer play controls / input

there is a new option to play video with omxplayer in a moveable and resizable window on your desktop:

http://www.raspberrypi.org/phpBB3/viewt ... 66&t=36830

Have fun!

fabiovaz
Posts: 2
Joined: Sun Mar 03, 2013 5:28 am

### Re: omxplayer play controls / input

Hi all,

I'm very glad to know that this new feature is already implemented. But I'm not a qualified user so I can get the sources from Github and compile them. Does anyone have a compiled version including this feature ? Or maybe, point me somewhere I can find it already compiled.
Any help would be very, very appreciated.

BR,
Fabio.

KenT
Posts: 759
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

### Re: omxplayer play controls / input

Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more

loydesteve
Posts: 1
Joined: Tue Dec 10, 2013 4:07 am

### Re: omxplayer play controls / input

Kinda tricky procedure for me, but I was able to fix the pi from its several issue...

Regards,
Loyd
custom iphone cases

dynamitemedia
Posts: 30
Joined: Sun Dec 01, 2013 9:12 pm

### Re: omxplayer play controls / input

Jim Ford wrote:I'm trying to write a simple bash script for controlling omxplayer from a command line. I'm a rubbish programmer, particularly with bash. This is what I've got so far:

Code: Select all

#!/bin/bash
#
if [ ! -e /tmp/omxplayer.pipe ]
then
mkfifo /tmp/omxplayer.pipe
fi
#
( /usr/bin/omxplayer -n -o hdmi $1 < /tmp/omxplayer.pipe & ) # echo -n . /tmp/omxplayer.pipe clear while true do echo p for play/pause echo q for quit echo b for back 30 echo B for back 600 echo f for forward 30 echo F for forward 600 echo z for info echo 1 for slower echo 2 for faster echo j for previous audio track echo k for next audio track echo + for volume up echo - for volume down echo i for previous chapter echo o for next chapter echo n for previous subtitle track echo m for next subtitle track echo s for toggle subtitles read inp clear case$inp in
p|z|1|2|j|k|+|-|i|o|n|m|s)
echo -n $inp > /tmp/omxplayer.pipe ;; q) echo "Quiting" echo -n q > /tmp/omxplayer.pipe rm /tmp/omxplayer.pipe break ;; b) echo -n$'\x1b\x5b\x44' > /tmp/omxplayer.pipe
;;
B)      echo -n $'\x1b\x5b\x41' > /tmp/omxplayer.pipe ;; f) echo -n$'\x1b\x5b\x43' > /tmp/omxplayer.pipe
;;
F)      echo -n $'\x1b\x5b\x42' > /tmp/omxplayer.pipe ;; *) echo "Please select from above only" ;; esac done  But it doesn't really work as expected. I'd welcome suggestions , please! Jim Did you ever get this working? i am interested in a bash script as well blockh34d Posts: 57 Joined: Tue Jan 07, 2014 1:49 pm ### Re: omxplayer play controls / input http://www.raspberrypi.org/forum/viewto ... 91&t=70459 Here's what I hacked together. It's real basic but it works. Just select one or more media files from nautilus and right click to play. A terminal window opens and shows whats happening, allows for input etc. I may add flatfile playlists and shufle. Working on a just sslightly nicer python wrapper now. Still text mode, but a little nicer. lgp_michael Posts: 1 Joined: Wed Aug 27, 2014 3:59 pm ### Re: omxplayer play controls / input I've been looking into this on and off for a while now. I have a media player I wrote myself, and I use omxplayer for the player. It always bugged me that I needed to either have a keyboard plugged in, or I couldn't control the pi, even with the pipe idea above. I decided to solve this today and came up with a solution using xbindkeys It's easy as anything once I worked it out, and now I just have my mouse by my TV not a whole keyboard I start omxplayer with a script Code: Select all #!/bin/sh - \rm /tmp/command_pipe mkfifo /tmp/command_pipe xbindkeys omxplayer -o hdmi$* < /tmp/command_pipe &
PID=$! echo . > /tmp/command_pipe wait$PID
\rm /tmp/command_pipe
killall -9 xbindkeys

This starts up the fifo, and xbindkeys

Inside the ~/.xbindkeysrc file I have

Code: Select all

"echo -n p > /tmp/command_pipe"
b:1

"echo -n q > /tmp/command_pipe"
b:3

"echo -n ^[[A > /tmp/command_pipe"
b:4

"echo -n ^[[B > /tmp/command_pipe"
b:5

"echo -n ^[[D > /tmp/command_pipe"
b:6

"echo -n ^[[C > /tmp/command_pipe"
b:7

This allows me to pause, stop, and skip forwards and backwards 10 seconds/10 minutes. Obviously you can simulate any command you like this way.

As a note: The ^[ shown above is a representation of the escape key, so ^[[C represents the three keys ESC then [ then C which simulates the right arrow key

How you enter them is up to you in whatever text editor you use.

Hope this helps!