Posts: 66
Joined: Sun Apr 07, 2013 2:14 pm

Editing OMXPlayer

Wed Apr 09, 2014 8:05 pm

There are two things I want to change about omxplayer:
I want to stop it displaying a message on screen whenever you pause/play it.
Also when you quit, it waits for input before you can enter further commands on the command line. I want it to continue back to the command line without waiting for input.

I'd imagine that to change these I'd need to edit the source code and recompile it on my pi. I've found the source code, but how can I find/where is the right place(s) to edit?

Also, how do I recompile the code from scratch?

Thanks for any help

User avatar
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Editing OMXPlayer

Wed Apr 09, 2014 9:46 pm

That's odd usually when I press "q" it instantly returns control to the console and sometimes the occasional error message.
As for the on screen "play/pause" message you can suppress this by adding --no-osd to your command line argument.

If you still insist on hacking up omxplayer the source code is available via the ol' github - https://github.com/popcornmix/omxplayer :)

Richard S.

Posts: 66
Joined: Sun Apr 07, 2013 2:14 pm

Re: Editing OMXPlayer

Thu Apr 10, 2014 6:52 pm

I expect it does. I'm controlling it using sockets in python from another computer over a network. That means I need omxplayer to be able to receive input not from a keyboard, so I'm using pipes. I have a python script running on the pi which listens for the signal to run command line arguments. It works thus:

mkfifo arbitrary_pipe

omxplayer video.avi < arbitrary_pipe &
echo . > arbitrary_pipe &
echo -n q > arbitrary_pipe &

when the last command is executed, I have to press enter on the pi before I can continue.

Posts: 6345
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Editing OMXPlayer

Thu Apr 10, 2014 8:25 pm

Perhaps using the dbus interface will work better. There is a dbuscontrol.sh script in the omxplayer repository on github. Download it, make it executable and copy it to /usr/local/bin.

Then add something like that to your python script:

Code: Select all

def send_dbus(args):
    res = ''
        db = subprocess.Popen(['dbuscontrolm.sh']+args,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
        (res,err) = db.communicate()
        res = ''
    if err:
        res = ''
    return res
where args is an array, containing the command and possibly arguments.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

Return to “C/C++”