Problem with frame accuracy using nextFrame() with GStreamer

I am looking for an accurate way of jumping frame by frame within a video forwards and backwards with ofGstVideoPlayer.
Using nextFrame() and previousFrame() with some videos some frames are being skipped (that is probably codecs and I-frames related?).
For the nextFrame() I found a way using gst_event_new_step, but I have not achieved an equivalent for previousFrame()?

void ofGstUtils::goToNextFrame(){
    gst_element_send_event(gstPipeline,gst_event_new_step(GST_FORMAT_BUFFERS, 1, 1.0, TRUE, FALSE));

During that testing I also ran into similar problems when querying getPosition() as described here:

I know that dealing with videos one is always confronted with weird behaviour like sometimes videos have “no frames” and you can not use setFrame() or you only get a proper position after the first couple of frames, but maybe somebody has figured that out and could give me a hint regarding ofGstVideoPlayer and accurate positioning?
I am developing a tool which should work with whatever the user drags in so I want to provide a more or less universal solution :slight_smile:


I attached a small FrameTestMovie (mov) I use for testing and it is one where the current nextFrame() and previousFrame() functions sometimes hang or skip a frame. (529.8 KB)

Btw, I am using OF from the master branch with OSX and XCode 6.2


maybe this helps:

i did not try to use trickmodes myself. maybe i can manage to give it a try later.
might be we should use gst_event_new_seek instead of gst_element_seek…?

Thanks @inx.
I now see my limitations regarding GStreamer. I can not wrap my head around these different functions. Today I did not get it to work.
Have you achieved anything in this field?

I had found this article regarding frame accuracy related to ffmpeg, but the theory, I guess, is the same for any video library.