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

Question: Setting playback speed #60

Closed willprice closed 7 years ago

willprice commented 7 years ago

This question came in via email:

Good day Will,

I found your Omx wrapper repository online. I am new to pyhton and wondered if you could assist me with a issue I have?

I would like to be able to change the playback speed from python. I see that there is a commented section with mediaplayer2 types which has a playback_rate variable, but I am not sure how to access this.

Could you please assist? It would be greatly appreciated!

willprice commented 7 years ago

Looking at the omxplayer reference dbus-control.sh script I can't see any interface exposed over DBus for controlling speed, nor any CLI flags. The only documentation for controlling speed seems to be through key presses, which you can emulate with omxplayer.action, pass in a key from the keys defined in omxplayer.keys.

The relevant key presses:

key function
1 decrease speed
2 increase speed

Ugly, but it should work.