willprice / python-omxplayer-wrapper

:tv: Control OMXPlayer, the Raspberry Pi media player, from Python
http://python-omxplayer-wrapper.readthedocs.io
GNU Lesser General Public License v3.0
253 stars 71 forks source link

Ability to set loop after playback started #167

Closed superlou closed 5 years ago

superlou commented 5 years ago

Feature Request

Description

Is it possible to set OMXPlayer's "--loop" argument after playback has already started?

Example use case

I am working on a playout system for live video production, where a Raspberry Pi is playing video to a hardware video switcher. While the video is playing, the operator may decide that the video needs to be looped in order to run long enough. My understanding is that the only way to get seamless playback from OMXPlayer is to set the "--loop" argument. Trying to catch the stop-playback event and seek to the beginning causes gaps.

However, I'm not sure that whatever flag "--loop" sets is exposed over the dbus interface, so this might simply not be possible. I've been trying to find a hack where I always launch the player with "--loop" set, but I haven't been able to reliably determine when the video is at the end of playback and stop it before showing some of the beginning again.

willprice commented 5 years ago

Hi There,

Sadly I don't believe this is implemented in omxplayer, so can't be exposed in this library. All the implemented methods can be found in https://github.com/popcornmix/omxplayer/blob/master/OMXControl.cpp

superlou commented 5 years ago

Thanks, I was afraid of that. I've opened an issue on OMXPlayer to figure out what it would take to add to the player.

willprice commented 5 years ago

Cool, let me know if it ever gets implemented as it would be trivial to add once exposed. Cheers.