bobintetley
Posts: 5
Joined: Thu Feb 21, 2013 3:08 pm

web-based omxplayer remote for smartphones

Fri Feb 22, 2013 2:07 pm

I cobbled together a python script that runs a small webserver serving a smartphone/tablet interface to control omxplayer if anyone is interested. There's a README file included, it requires installation of two Raspbian packages (python-pexpect and python-webpy) and is very straightforward to setup.

You can get it at http://rawsontetley.org/proj_omxremote.html

:D

bobintetley
Posts: 5
Joined: Thu Feb 21, 2013 3:08 pm

Re: web-based omxplayer remote for smartphones

Sun Feb 24, 2013 5:50 pm

... now updated and uses omxplayer --info to get the length and shows time elapsed/length during playback (omxplayer doesn't seem to support playback info to stdout so we have to calc our own I guess).

bobbydriver
Posts: 70
Joined: Thu Oct 18, 2012 9:06 am

Re: web-based omxplayer remote for smartphones

Mon Feb 25, 2013 10:37 am

For Android there is an App that does just this without needing Python and Webserver on your Pi. You just put your IP, username/passwd and video folder into the app and it does the rest

https://play.google.com/store/apps/deta ... mote&hl=en

Your app does pretty much what Juggler's application does, (viewtopic.php?p=161523#p161523) although that uses Apache & PHP on the Pi.

Really useful though - I searched for ages for someone doing just this

bobintetley
Posts: 5
Joined: Thu Feb 21, 2013 3:08 pm

Re: web-based omxplayer remote for smartphones

Mon Feb 25, 2013 2:23 pm

I tried the android app first and found the following drawbacks with it:

1. It uses SSH, which means your phone has to maintain a constant connection to the pi for the buttons to work - wifi sleep will kill your ability to send instructions to the currently playing video.
2. It doesn't give any info on playback position.
3. It can't cope with multiple users since they'll get a different SSH session. That causes multiple instances of omxplayer to load and barf.
4. If you back out of the currently playing item, you can't reconnect to its controls.
5. It looks like ass!

bobbydriver
Posts: 70
Joined: Thu Oct 18, 2012 9:06 am

Re: web-based omxplayer remote for smartphones

Tue Feb 26, 2013 1:41 pm

Cheers for the comments on that Android App - I'd not noticed any of those things yet, but they make sense. Compared to Juggler's app it doesn't look like ass, it looks quite nice...haha

I'll try out your project too and see how it goes

nginx
Posts: 41
Joined: Sun Dec 09, 2012 2:35 pm

Re: web-based omxplayer remote for smartphones

Tue Mar 05, 2013 5:35 am

Brilliant script I must say. Thanks for sharing. Its streets ahead of the one in Google Play Store. Had to make a few minor changes to the script to make it run on CRT TV & align the subtitles but its working to perfection now. I have daemonized it to make it start automatically when the pi boots.

I have one gripe though. The script is a bit resource intensive (not server side but client side), possibly due to use of jquery. I have a directory with 2500 subdirectories and Opera mobile fails to display that directory on my tablet as it runs out of resources. On my laptop, there's no such problem, there's about a 3 sec delay but the directory loads successfully. Do you think its possible to may be optimize the script a bit more to use less resources?

nginx
Posts: 41
Joined: Sun Dec 09, 2012 2:35 pm

Re: web-based omxplayer remote for smartphones

Mon Mar 11, 2013 5:45 pm

I found no way to contact you at your site, so I am posting here again. There seems to be another bug. I'm using the latest version of the script but it only shows the elapsed time while total duration is always 00:00. I tried videos encoded with xvid, divx & x264 codecs but the script can't detect the duration for any of them. Even after the video has finished playing on TV, the elapsed time keeps increasing because the script can't detect end of file. As a result the stop button needs to be manually pressed everytime.

Any possible fix?

mrhobbeys
Posts: 80
Joined: Wed Jul 18, 2012 2:53 am

Re: web-based omxplayer remote for smartphones

Tue Mar 26, 2013 5:52 am

I am trying this out right now and I can run a video via ssh using these following examples:

Code: Select all

omxplayer "file.vid"
omxplayer -r -o hdmi "file.vid"
The video plays fine this way, but when I try to use the web app I get a blank screen.
www.betterpchealth.com
www.hektechnologies.com

Return to “Media centres”