nellapatella
Posts: 3
Joined: Tue Jan 16, 2018 8:59 am

Play video and execute command at certain frame

Tue Jan 16, 2018 9:02 am

I am super new to python and raspberry pi so please bear with me.

I need to play a video with a raspberry pi and while the video is playing, commands are sent to an Arduino at certain frames or 'moments' in the video.

I've got omxplayer working, and can send commands to the Arduino, but that's it. I am not sure if omxplayer is even the best thing to use here. I would probably need to count the frames of the video or have some way of knowing where the video is in the timeline and trigger the commands at key points.

I've done this system with MaxMSP which counts the frames and sends commands via serial to the Arduino. But I need to make my system cheaper and since MaxMSP does not work on the Pi I am converting to Python.

Any pointers would be great!

User avatar
topguy
Posts: 4357
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Play video and execute command at certain frame

Tue Jan 16, 2018 1:07 pm

Have you looked into Pure Data or Open frameworks as alternatives to MaxMSP ?

http://puredata.info/
http://openframeworks.cc/

omxplayer code is opensource ( but not Python ) so you could possibly modify it to send some signals a pre-defined frames.

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

Re: Play video and execute command at certain frame

Tue Jan 16, 2018 3:09 pm

You can send dbus commands to omxplayer and request the exact position in time.
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

nellapatella
Posts: 3
Joined: Tue Jan 16, 2018 8:59 am

Re: Play video and execute command at certain frame

Fri Jan 19, 2018 11:40 am

thanks for the replies!

I got Will Price's Python Omxplayer Wrapper to do the job!
https://github.com/willprice/python-omxplayer-wrapper

Return to “Python”

Who is online

Users browsing this forum: Paul Hutch and 6 guests