ofVideoPlayer setFrame behavour

Hello,
i have the following program. it loads a video and i wanna skip the frames manually.

#include "ofMain.h"
class ofApp : public ofBaseApp{

	public:
		void setup(){
			_player.setLoopState(OF_LOOP_NONE);
			_player.load("clip.mp4");
			_player.stop();
			ofLogNotice() << "total num frames: " << _player.getTotalNumFrames();
		}
		void update(){
			_player.update();

		}
		void draw(){
			_player.draw(0,0);
		}

		void keyPressed(int key){
			ofLogNotice() << "current frame: " << _player.getCurrentFrame();
			switch(key){
				case '0': _player.setPaused(true); _player.firstFrame(); break;
				case '1':
				case '2':
				case '3':
				case '4':
				case '5':
				case '6':
				case '7':
				case '8':
				case '9': {
					auto increment = (key - '0') * 4;
					ofLogNotice() << "skipping frames: " << increment;
					_player.setFrame(_player.getCurrentFrame() + increment);
					ofLogNotice() << "current frame: " << _player.getCurrentFrame() << "\n";
					break;
				}

			}
		}
		ofVideoPlayer _player;
};
int main( ){
	ofSetupOpenGL(1024,768,OF_WINDOW);
	return ofRunApp(new ofApp());
}

it only jumps if i press the 8 or 9 key, but it does not return the correct new position. if i only wanna jump 1 frame, nothing happens. do i miss anything?
i am using osx.

[notice ] total num frames: 81
[notice ] current frame: 0
[notice ] skipping frames: 4
[notice ] current frame: 0

[notice ] current frame: 0
[notice ] skipping frames: 8
[notice ] current frame: 0

[notice ] current frame: 0
[notice ] skipping frames: 12
[notice ] current frame: 0

[notice ] current frame: 0
[notice ] skipping frames: 16
[notice ] current frame: 0

[notice ] current frame: 0
[notice ] skipping frames: 20
[notice ] current frame: 0

[notice ] current frame: 0
[notice ] skipping frames: 24
[notice ] current frame: 0

[notice ] current frame: 0
[notice ] skipping frames: 28
[notice ] current frame: 0

[notice ] current frame: 0
[notice ] skipping frames: 32
[notice ] current frame: 0

T

I have similar mysterious experience of precise video frame control.
I don’t remember what was the issue but I guess this is not an oF problem but more like a video codec & native video api problem (e.g. api only decodes video at certain condition etc). Sometimes, I even couldn’t stop & start video. How about using image sequence?

Thanks for the response. It seem to work on windows. Haven’t tested on linux. I will try prores instead of h264. Using an image sequence would be the alternative, but I would like to avoid it if possible. In the other hand I guess I would get much higher framerates, skipping frames on h264 videos is quite expensive,

skipping frames on h264 videos is quite expensive,

Oh yes, I start to recall my memory, this i-frame & p-frame thing of a codec.
Higher keyframe distance could work better in case of h264?
ProRes seems not using keyframe, so it could work better too, I’m curious how it goes.

i remember reading someting related… and as hrs says depends on. On quicktime to export there is a photo jpeg… try with that.

I have been working recently with video and hap is working great at least on linux but i didnt skyping frames maybe is worth a try

I have had already a look at hap, it looks promising. But the ofxhapplayer add-on has not implemented the frame skip feature.

Try with the photo-jpeg codec, that was the codec that recommended to jump to frames. I searched but im not able to find de post.

And in hap you have setPosition need to calc the position that correspond to the desired frame

some discussion that may be useful