ofxOMXPlayer doesn't reset getCurrentFrame()

I’m working on a video/lighting project on the raspberry pi. The goal is to have an HD video running while different LEDs are ramping up and down in sync with the video.

My initial goal was to base it off of omxplayer’s getCurrentFrame() function:

currentFrame = omxPlayer.getCurrentFrame();

	if(currentFrame > 100 && currentFrame < 200)
		pca->setLED(0, (currentFrame-100) * 40);

but the current frame count doesn’t resent upon looping. I’m somewhat stuck at this point and I’m wondering if i need to put either the OMXplayer in a seperate thread (is that even possible b/c of threads not accessing GL?)
I’m also having trouble restarting the video on command after it has ended (instead of looping). Any help is much appreciated.

There is a onVideoLoop you can implement which may help

your ofApp will just need to implement extend the ofxOMXPlayerListener . You can see this in the playlistApp example.


thanks so much. great addon.

for now i’m having it pause onVideoLoop. regarding the currentFrame restarting i’m doing this:

int currentFrame = omxPlayer.getCurrentFrame() % omxPlayer.getTotalNumFrames();

nice - that’s smart - I should probably do that in the addon. I’m currently trying to deal with some files (recorded via the camera/encoder) that don’t have any frame info so it’s kinda tricky