popcornmix / omxplayer

omxplayer
GNU General Public License v2.0
1.01k stars 334 forks source link

How to control pause/resume trough options/command line? #534

Open matteoraggi opened 7 years ago

matteoraggi commented 7 years ago

Is it possible to pause and resume omxplayer trough command line? I can't find it in the command line options... Thanks for the patience.

pcwalden commented 7 years ago

'p' pauses and resumes

matteoraggi commented 7 years ago

P is pausing and resuming if I press manually on the keyboard the P button, but trough command line I can't press P, because I can't use the same terminal session while playing, am I right?

vcrocher commented 7 years ago

You can use dbuscontrol.sh script to do this: $ ./dbuscontrol.sh pause should do what you want. If you are after a bit more control (pause only or play only for instance) you can tweek the dbuscontrol.sh with other available dbus controls.

bholmes451 commented 7 years ago

I have added a command line parameter in my version which allows you to start the video paused and then resume via keyboard command or dbuscontrol. I'm currently attempting to get a pull request figured out to merge it into the main code. Is that what you wanted to do?

matteoraggi commented 7 years ago

Yes, it is a great idea! is it possible also to configure for how much time the video would remain in pause directly?

bholmes451 commented 7 years ago

I hadn't considered that as my use case is specifically for commanded resume but I can look into it.

matteoraggi commented 7 years ago

Very good, thanks! I am very courious about it, I would be happy to be your alfa and beta tester :-)

jordiblanchcarles commented 7 years ago

Hello, does somebody know if the command line parameter to start omxplayer in pause has already been included in omxplayer stable version, or there's any chance it will? I'm very interested in this parameter because I'd like to start an omxplayer instance to play a video and meanwhile start another one in background that should load the video and keep in pause until the first one quits. I've tried to do this using named pipes but sometimes it is not working properly and I get the 2 videos playing at the same time.

Thank you in advance!

bholmes451 commented 7 years ago

I have just figured out what was going on with my fork and submitted a pull request for this enhancement. If you need this immediately you can compile from my fork (which has been updated to match the most recent popcornmix version: https://github.com/bholmes451/omxplayer/

matteoraggi commented 7 years ago

veyr nice! I found the command "--start-paused Immediately pause the video after loading, will wait for dbus or key command to play" so after starting pauses, which is the command to play the video then? And which other differencies has this fork from popcornmix?

jordiblanchcarles commented 7 years ago

Perfect! Thank you! I'll try your fork. Thank you very much!

bholmes451 commented 7 years ago

This is the only change between the current popcornmix version and my fork. I did a pull this morning from the popcornmix master branch. You can see the changes here: https://github.com/popcornmix/omxplayer/pull/538

Basically I changed the code from automatically starting playback after the buffer was filled to pausing when the flag is sent. You can use the p key or the space key. The dbus command I have used is ./dbuscontrol.sh play or ./dbuscontrol.sh pause