Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

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

    Thanked by 1heliocuve
  • 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

    Thanked by 1heliocuve
  • edited June 3

    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:

    • Edit a video with a specific, known, number of frames.
    • Insert the following inline code in an OpenSesame sequence: framecount = 0
    • Insert the video after; make sure you select 'run custom code: every frame'
    • In the code component, type:
    framecount += 1
    print framecount
    
    • Run in debug mode and see if the number of frames printed match the number in your file.


    Thanked by 2heliocuve Edwin
Sign In or Register to comment.