MontyPithon
Posts: 5
Joined: Sat Mar 23, 2013 5:02 pm

Re: omxplayer web remote controls for any web enabled device

Sat Mar 23, 2013 8:00 pm

Well how do you get it to start then?

I have never done CSS/PHP/HTML/Python/Bash more than to apply small adjustments to existing code in a try and error kind of way (hence this exercise, I thought it was about time I learned). I think I am doing quite alright so far since controlling a running omx seems to work and I am quite satisfied with the way it looks but I am really stumped when it comes to starting the actual player.

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

Re: omxplayer web remote controls for any web enabled device

Sat Mar 23, 2013 8:09 pm

MontyPithon wrote:Well how do you get it to start then?
using a created shell script. I run script with shell_exec which in turn runs omxplayer.

f1vefour
Posts: 7
Joined: Sat Mar 23, 2013 7:09 pm

Re: omxplayer web remote controls for any web enabled device

Sat Mar 23, 2013 9:20 pm

Very nice method of omxplayer control.

If you have an android based handset you can use the Coversal app for full control of omxplayer including file browse/play.

MontyPithon
Posts: 5
Joined: Sat Mar 23, 2013 5:02 pm

Re: omxplayer web remote controls for any web enabled device

Sat Mar 23, 2013 10:05 pm

That's what I tried as well but it doesn't seem to work either. The script itself work perfectly fine and I have tried different scripts already including the one you posted a little above.

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

Re: omxplayer web remote controls for any web enabled device

Sat Mar 23, 2013 10:20 pm

#!/bin/sh\nsudo sh -c \"./cls.sh\"\nomxplayer -p -o hdmi \"$1\" <".FIFO." >/dev/null 2>&1 &\nsleep 1\necho -n . >".FIFO."\n"; - look at this - you'll get an idea.

MontyPithon
Posts: 5
Joined: Sat Mar 23, 2013 5:02 pm

Re: omxplayer web remote controls for any web enabled device

Sun Mar 24, 2013 12:37 am

Again the script works fine and if I start it from console the web interface can control the player. I can see that

Code: Select all

shell_exec('sh /PATHTOSCRIP/SCRIP.sh')
does something, the screen blinks briefly but then nothing happens. I am using lighttdp as a webserver, might that be the reason?
I really appreciate the quick response and the time you take by the way.

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

Re: omxplayer web remote controls for any web enabled device

Sun Mar 24, 2013 9:09 am

first of all make it work ftom shell script and fifo. then, move it to http server. i believe http server flavour doesn't matter as long as permissions are ok.

MontyPithon
Posts: 5
Joined: Sat Mar 23, 2013 5:02 pm

Re: omxplayer web remote controls for any web enabled device

Sun Mar 24, 2013 12:12 pm

Ok, works like a charm now. The mistake was really stupid but I got it to work now by tinkering with some permissions. Thanks for the great help.

kani
Posts: 2
Joined: Tue Feb 12, 2013 3:00 pm

Re: omxplayer web remote controls for any web enabled device

Mon May 13, 2013 1:50 pm

Hello,
have you ever considered giving to the user the possibility to add subtitles?
omxplayer uses keyword "--subtitles" to do that.
Do you consider adding this functionality?

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

Re: omxplayer web remote controls for any web enabled device

Mon May 13, 2013 4:24 pm

kani wrote:Hello,
have you ever considered giving to the user the possibility to add subtitles?
omxplayer uses keyword "--subtitles" to do that.
Do you consider adding this functionality?
I can do it. For example if we decide to name subtitles the with the same name as video, I can search for the same name with another "extension" and pass it to player command line.

I mean if video called "video1.avi" I can make it to find "video1.*" but not "video1.avi" and if exists - pass it as subbtitles.

henle
Posts: 65
Joined: Sat Apr 21, 2012 7:23 pm

Re: omxplayer web remote controls for any web enabled device

Mon May 13, 2013 7:54 pm

Juggler wrote: [...]

I can do it. For example if we decide to name subtitles the with the same name as video, I can search for the same name with another "extension" and pass it to player command line.

I mean if video called "video1.avi" I can make it to find "video1.*" but not "video1.avi" and if exists - pass it as subbtitles.
Omxplayer does in fact do this already.

kani
Posts: 2
Joined: Tue Feb 12, 2013 3:00 pm

Re: omxplayer web remote controls for any web enabled device

Sat Jun 01, 2013 10:25 am

henle wrote:
Juggler wrote: [...]

I can do it. For example if we decide to name subtitles the with the same name as video, I can search for the same name with another "extension" and pass it to player command line.

I mean if video called "video1.avi" I can make it to find "video1.*" but not "video1.avi" and if exists - pass it as subbtitles.
Omxplayer does in fact do this already.
Yes, sorry it already works. You only have to set the name of .srt file equal to the movie file.
Thanks ;)

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

Re: omxplayer web remote controls for any web enabled device

Sun Jun 02, 2013 4:08 pm

Ok, then I've nothing to improve here :?

gavuk
Posts: 2
Joined: Sun Jan 05, 2014 1:54 pm

Re: omxplayer web remote controls for any web enabled device

Sun Jan 05, 2014 2:09 pm

I know no one's posted in this thread for a while, but I just wanted to say thanks for releasing this. It's exactly what I was looking for, and it's saved me a lot of hassle getting my Raspberry Pi set up to easily play films.

I did make a couple of changes to setup.php (lines 74 and 111) as it had trouble with a directory name containing an ampersand (&), other than that it was very simple to get going - so thank again.

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

Re: omxplayer web remote controls for any web enabled device

Sun Jan 05, 2014 6:50 pm

You are welcome!
Thanks! Please share your changes to community on github! Or send it here and I'll update sources. :)

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

Re: omxplayer web remote controls for any web enabled device

Fri Jan 31, 2014 3:53 am

i am making some changes to this but how to submit changes to github ?

i am adding a playlist and video player option

Allasard
Posts: 2
Joined: Mon Jan 27, 2014 7:30 pm

Re: omxplayer web remote controls for any web enabled device

Tue Jun 24, 2014 9:12 pm

I've been meaning to share this for a long long time, but....procrastination!
I did a major overhaul of what you had. I wanted a car video player for my toddler, so I needed to be able to select things without looking at the screen. I took Juggler's script and heavily modified. Then I made my Pi a Wifi AP and we can connect via our phones to the interface and control the screen.
It will now sequentially play files from multiple repositories.
I added things like:
- It remembers what file you are playing. Persistent across reboots.
- You can have multiple directories of videos (eg. per show) and it will keep track of its place separately for each.
- It will loop one or all files in a directory
- More buttons (shutdown, skip videos, etc)
- Statuses: Current file playing, Temperature

The README.md has more details.
I've never done github, and I wasn't sure if you wanted this all merged anyway, so here is a tarball. If you want me to merge it back into the tree, I can look into that.
This is my first time ever using PHP and Javascript, so consider the code messy. :) Some statuses don't update without a refresh; and if you care, that is left as an exercise for the reader.
Link:
[Edit: See next post for newer link]

Thanks, Juggler! This was an awesome starting point!
Last edited by Allasard on Fri Jun 27, 2014 3:05 am, edited 1 time in total.

Allasard
Posts: 2
Joined: Mon Jan 27, 2014 7:30 pm

Re: omxplayer web remote controls for any web enabled device

Fri Jun 27, 2014 3:03 am

Oops. I found a slightly newer version with install instructions in the README.md:

https://dl.dropboxusercontent.com/u/447 ... 051713.tgz

I hope this is useful to someone. Let me know if I should merge it back into the git tree or keep it separate.

stetim94
Posts: 4
Joined: Tue Oct 21, 2014 7:23 am

Re: omxplayer web remote controls for any web enabled device

Tue Oct 21, 2014 10:28 am

Thanks for the updated it version, i almost got it to work. it runs the video files, but the output is in incorrect channel (tty or pts).
if i just run:
omxplayer /var/www/vids/OTHER/Doctor_Who_Short_Space_Time.avi

it works fine and this is the output in ps aux:

steven 4125 0.0 0.3 4296 1384 pts/2 S+ 10:01 0:00 /bin/bash /usr/bin/omxplayer /var/www/vids/OTHER/Doctor_Who_Short_Space_Time.avi
steven 4133 12.2 4.9 120024 21976 pts/2 Sl+ 10:01 0:46 /usr/bin/omxplayer.bin /var/www/vids/OTHER/Doctor_Who_Short_Space_Time.avi

if i run it with the web interface this is ps aux output:

www-data 4183 0.8 0.3 3092 1408 ? S 10:09 0:00 /bin/bash /usr/bin/omxplayer /var/www/vids/OTHER/Doctor_Who_Short_Space_Time.avi
www-data 4197 3.0 0.7 76476 3408 ? Sl 10:09 0:00 /usr/bin/omxplayer.bin /var/www/vids/OTHER/Doctor_Who_Short_Space_Time.avi

because it runs as a deamon, it doesn't show anything, any idea?

now the pts/2 has turned in to a question mark. I have no idea how to fix it? Can you help me? is any more "code" required?

pieternys
Posts: 1
Joined: Fri Dec 05, 2014 9:43 am

Re: omxplayer web remote controls for any web enabled device

Fri Dec 05, 2014 9:52 am

Hi Earl,

I am looking for the same issue you are describing.
Did you find a solution for this? I would like to control 6 raspberry PI's (with video content) from one central cue program (like Qlab). So I can send midi, artnet, or more specific commando's.

hope to hear from you!

Pieter Nys
Antwerp Belgium

Earlofevil wrote::lol: ... i had to laugh about myself. because i read so many posts and websites in english
to this topic I got so used to english, that i simply replied in german.
... although i could have done it in english. sorry for that.

my intent is not to control the pi totally, but to control the video playback of many pi clients.
an example-setup could look like this:

1 server (with web interface), 3 clients (with local videofiles)
Server "A" tells:
- RPI client "A" to play video file "1"
- RPI client "B" to play video file "2" (in repaet mode)
- RPI client "C" to play video file "3" then video file "4"

this could would be a very scalable solution for multi-projector-installations.

I have to test your project entirely, to give you a better feedback, but for now it's the
solution which fits most.

tzar
Posts: 1
Joined: Wed Mar 18, 2015 12:45 am

Re: omxplayer web remote controls for any web enabled device

Wed Mar 18, 2015 12:56 am

Hello Juggler !
That's great!

Please, can you help me about step by step for permissions?

I got a message below, but how I'm newbie on Linux I'm not sure what to do:

/dev/vchiq is not writable for httpd user
you have to run shell command:
sudo usermod -a -G video www-data
this will allow http server user which runs omxplayer access /dev/vchiq to display video

Tks a lot!

cookdoeyl
Posts: 1
Joined: Sat May 30, 2015 11:58 pm

Re: omxplayer web remote controls for any web enabled device

Sun May 31, 2015 12:01 am

I'm having two problems that may be related to each other. When I first play a clip, it starts out at Playspeed:2.000 with no audio. Then when I click the pause button, the video goes away. I'm able to click the speed - button to get it to play at normal speed with audio, but I have to do this every time. Any ideas why and how to fix?

Thanks,

sunrise-raspi
Posts: 2
Joined: Sun Jul 16, 2017 4:26 pm

Re: omxplayer web remote controls for any web enabled device

Sun Jul 16, 2017 4:35 pm

Hello everybody,
I know this site is already quite old but I am despairing the everything works well up to the same problem as my speaker before the output always automatically Playspeed: 2.000 but if you the same file manuel in putty reproduced it is on 1000 which It should also have.
Can anyone tell me how to solve this problem?

And apologizing for the bad English grammar speak and read is easier for me than to write :? :)
Thanks in advance

bourearo
Posts: 1
Joined: Tue Jul 17, 2018 9:35 am

Re: omxplayer web remote controls for any web enabled device

Tue Jul 17, 2018 9:41 am

Same here, videospeed is 2.00 and pause makes it stop. Searched a lot but didn't found the initial parameters of the player. Did anyone found a solution ?

Return to “Media centres”