I’m doing some development in openFrameworks with their video player, oFVideoPlayer, which uses gstreamer via a wrapper called ofGstUtils.
When trying to set the speed of a video I’m unable to do so, and am getting an error from Gst that is generated because gst_element_seek() is returning as false. It’s unclear why this is the case; I know that it returns true if the element handles the seek event, but I’m not sure why this element can’t.
I’ve looked around for what can cause gst_element_seek() to return as false and can’t find much, except that the video has to be playing at the time of the seek event (it is). What’s the most common cause? My first thought was a codec issue, this is on a Raspberry Pi using Apple ProRes format, but changing formats doesn’t seem to have any effect.
Okay, I just tried another test and there’s two new effects:
I’m able to change the speed, but only to values between -1 and 1 (anything above 1 comes back with an unable to change speed error - previously I was using 2 and above as I’m trying to speed up and slow down)
The video has to play through once before the speed is updated. It will return the unable to change speed error for every number sent, but after it’s played through it updates the speed with the last sent value.
In the ofVideoPlayer library this setSpeed() function uses the ofGstUtils wrapper (it’s here, line 470) and it seems it’s adding the GST_SEEK_FLAG_SKIP if the speed value is >1 or <-1, which is when setting the speed doesn’t work at all.
This is on a Raspberry Pi 3b+ through openFrameworks so adding the debug will take a bit of figuring out, but I’ll report back.
By the way, just wanted to say that the Gstreamer docs are fantastic.