ofVideoPlayer analysis and async playing

Hello oF community,

I have a question regarding ofVideoPlayer. I am interested in loading a short video (10 seconds) and analysing the frames using openCV.

All that is simple enough, however what I really want to do is do this in a single update call (possibly threaded) and calculate a list of timestamps and optical flow values which I can then reference later. Unfortunately I have no way of getting the pixels out of the video without calling “update()” which seems to do something internally based on ofGetElapsedTimef() (or something like that).

Curious if anyone has done anything like this and would be keen to point me in the right direction!

James Bentley

Perhaps I should note, my first attempt is to create a class that inherits from ofVideoPlayer but overrides the functionality I don’t want in update. I also want to remove any texture business because for the cv stuff I only want pixels to convert to cv::Mats.

I’ll keep this thread updated with my progress.

@Bentley I’m interesting in doing something similar. Were you able to solve it?

if you use ofxGStreamer you can access the frames individually, without uploading to gpu or having to deal with timer issues.

Is there somewhere an example of going through all the frames/pixels in a movie using gstreamer?

Here’s some old code I used. It has some extra stuff in it but I think that you’ll get the idea.
(it needs the ofxGStreamer addon i think)
src copy.zip (6.0 KB)

1 Like

@roymacdonald thanks! I will give it a look!

Thank you @roymacdonald ! Very useful :slight_smile: It seems like ofxGStreamer is Mac / Win only, but I hope it can work natively in Linux.

ofxGStreamer just includes the files that are the default video utils in linux so they can be used in windows and osx so everything should work the same

1 Like

Hi there,

just coming back to this. I was actually not able to solve it and to tell you the truth I’ve completely forgotten the application that I had in mind for it!

Are you having any luck with the Gstreamer approach?