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

cannot set --vol with args[]? #74

Closed artaslove closed 7 years ago

artaslove commented 7 years ago

Issue Report

Description

omxplayer.bin doesn't handle the initial volume argument. When play() is invoked, the video plays at full volume for about a second before changing to the volume set with set_volume().

When launching omxplayer from the command line, the argument '--vol -6000' works as expected.

Problem reproduction

$ omxplayer something.mp4 --vol -6000

works as expected

video = omxplayer.OMXPlayer('something.mp4') video.set_volume(-6000) video.play()

video plays with first second at full volume, then is silent

video = omxplayer.OMXPlayer('something.mp4', args=['--vol -6000']) video.set_volume(-6000) video.play()

/usr/bin/omxplayer.bin: unrecognized option '--vol -6000'

Environment details

Software Version
python-omxplayer-wrapper 0.1.0
python-dbus (dpkg -s python-dbus) 1.2.0-2+b1
python (python --version) 3.4.2
omxplayer (omxplayer --version) dfea8c9

Feature Request

Description

Allow setting of initial volume

Example use case

Playing a video with consistent volume

willprice commented 7 years ago

Hey,

Thanks for filling out the bug report form!

You've not split the arguments as the shell would, try with args=['--vol', '-6000'], this is about the 3rd time someone has reported this as a bug indicating the docs aren't clear enough that you must split the args as the shell would (or alternatively use shlex to do it for you).

I'll close this (reopen if my fix above doesn't work) and open a new issue to improve the docs.

Thanks

artaslove commented 7 years ago

Lol! Thanks so much. That works perfectly.

willprice commented 7 years ago

No problem, thanks for reporting, I count this as a docs bug ;)

On Feb 8 2017, at 9:13 pm, Tony notifications@github.com wrote:

Lol! Thanks so much. That works perfectly.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.