Store video frame number in the eye-tracking output
Hi everyone,
I have an experiment where I use the new_media_player to display videos and the pygaze plugins to record eye-tracking data with a Tobii tx300 at 300hz
I am wondering whether anyone would know how can I store the frame number being presented to the eye-tracking tsv file? basically to be able to match the video frame with the gaze sample for later processing (e.g. with OpenFace).
Really appreciate if anyone has a suggestion for this!
thank you
Helio
Comments
Hi Helio,
Never tried it myself, but if you can access the frame number through the player (maybe through opencv2?), you can send messages to the logger via pygaze's logging functionality. exp.pygaze_eyetracker.log(), I believe.
Hope this helps,
Eduard
Thanks @eduard , do you know if the current media player was built on top of opencv2?
Thanks,
Hélio
Hi Helio,
As far as I know, it wasn't (MoviePy, I think).
Check out the video part of the documentation: https://osdoc.cogsci.nl/3.2/manual/stimuli/video/#opencv
Eduard
To add to this, the MoviePy plug-in has the option to run custom code every frame. I don't know how robust it is, due to creating a race condition or otherwise, but this would be easy to test. For example, you could:
framecount = 0