ffpyplayer
ffpyplayer copied to clipboard
Seek doesn't update position and frame while video is paused
If you'll call seek
while video is paused, it's position
and frame (picture) will remain old.
This simple code can be used for testing: main.py test.kv
Here's how seeking works with gstplayer:
And here's same code with ffpyplayer:
Lets keep this open because it should be fixed in ffpyplayer itself. Then the 6-frame hack in kivy can be removed.
Hi, I'm wondering if the seek function could implement a callback method to signal when the seek has actually arrived at the correct position. I have a similar hack in my application where I keep reading frames until I find one within range of the seek that was issued.
Basically my workaround is
player.seek(timestamp)
while frame is not None:
frame, _ = player.get_frame(force_refresh=True)
if frame:
if float_equals(timestamp, frame[1]):
notify(frame[0], frame[1])
else:
frame = None
player.set_pause(True)
It seems that get_frame has an implicit set_pause(False) in it or something but didn't really read that in the documentation. Which also brings me to a second possible request of making a peek_frame function or something that might be useful in situations.