omxplayer
omxplayer copied to clipboard
Added function start-paused
This function allows a user to start omxplayer in a paused state instead of immediately starting playback of the video. The user can then use standard keyboard or dbus commands to begin playback manually.
To use this function add the command-line parameter: --start-paused to the omxplayer command.
Example:
omxplayer -p -o hdmi --start-paused test.mkv
This will start the omxplayer, load the buffer to begin playback and then pause. To resume playback, press the key on the keyboard for resume (by default this is the p or space keys), or send a dbus command.
This pull request solves these issues: #527 #534
Does an "omxplayer --start-paused test.mkv" show the first frame on the screen or a black screen? And if it does, always or just sometimes?
During our testing it has always shown a black screen. My belief based on the source code is that it actually pauses a few frames before the actual first frame of the movie buffer. But I'm considering retracting this pull request for now. Our extended testing found a problem with controlling multiple instances of omxplayer through dbus to be problematic. In addition, long term we are going to need more insight into startup times which this interface currently can't handle.
@bholmes451 Not taking the the DBUS issues into account, I reckon this PR nonetheless does what it says, i.e. pause the video upon start (so one can start later via DBUS/key cmd)?
If so, I kindly request a merge @popcornmix . We need this functionality and I considered implementing it myself, but bholmes451 was faster ;-)
@bholmes451 after compiling your fork, it seems not to work correct. If I use this parameter it doesn't show the first frame. Also no blank screen is shown. The optimal solution should be showing first frame as this is standard on Broadcast Media Players. Any Idea how to fix this?
@merlink01 so what is actually shown then?
It seems the Framebuffer stays as before, so I see the shell instead.
For testing I used this File: https://www.edius.de/test/foo.mp4 (h264/1080p50)
@merlink01 me thinks adding -b
should blank the screen. will try it out and report here
Thanks, ill try it.
It would be great if there were two options, one to pause before the first frame and one after the first frame.
Pausing before for the first frame is useful for low end theatre video playout where the Pi is connected direct to the projector. Pausing after first frame meets your broadcast requirement and is also useful for 'magic pictures' where a static first frame suddenly starts moving when the viewer approaches (using movement sensor). I have implemented both of these in Pi Presents by using the dbus Position command to detect when to pause but it would be much better done in omxplayer, less jittery time delays.
OK, the -b option does the job. But I agree with @KenT2, for my player solution the first Frame would be a much better solution.
@merlink01 When omxplayer is in the initial paused state, does it show the first frame when you execute the STEP command (available by pressing the 'v' (keyboard) key))?
@jehutting Thanks for the tip, I'll try tomorow.
@jehutting Yes that is working!
But there is no dbus command for step. (I'll try to simulate a key press.)
Thanks @merlink01 for trying it out.
The idea is to give the --start-paused an extra argument where the value
- 0 = pause before the first frame (blank screen, as is the case of current implementation), and
- 1 = pause after the first frame (meaning showing the first frame).
With value 1 all you need to do is an extra statement m_av_clock->OMXStep();
.
Note: OMXStep() has an argument steps
for the number of steps to make; I never tried that.
If you are Working on this, would it also be possible to implementiert an --end-paused Option? So the player could stop on last frame.
I've merged this and also added --end-paused by #669 .
Is there any hope of this being merged? It strikes me as essential for any higher-level video control. Thanks.