pupil-labs / pupil

Open source eye tracking
https://pupil-labs.com
GNU Lesser General Public License v3.0
1.46k stars 673 forks source link

Pupil Player frame rate #1174

Closed PCABG closed 4 years ago

PCABG commented 6 years ago

Hi, I have recorded a pupil labs session at 60 Hz and now I want to replay it in the Pupil Player. Exporting the data into csv file works fine, I get the full 60Hz temporal resolution, so the data is there. Yet, trying to publish the data via a plugin via zeroMQ, the achieved frame rate drops to ca. 28 fps. The GUI in the Pupil Player also shows 25-35 Fps Is there a way to obtain the full temporal resolution? I wouldnt mind a bit lag in the playback thx

mkassner commented 6 years ago

Would you mind sharing what OS you are on?

Have you tried slowing down the playback? (Press play and then left arrow to slow down)

mkassner commented 6 years ago

@papr lets look at solutions for this.

PCABG commented 6 years ago

Hi sry for the late reply, I'm working on a Linux system with the latest checkout I did last Wednesday 9th, May Thanks for mentioning the option of slowing down the playback, this helped a lot, I succeed in getting all the frames at half the playback speed Yet, I would expect that the pupil player is able to supply the raw eyetracking data (I limited the video output to 1 fps) in full speed. I think the problem might be the huge world video (my recordings are 45 min ~ 25GB)?

PCABG commented 6 years ago

btw would it be possible to start the player completely without the world video playback? i dont need it for my analysis

PCABG commented 6 years ago

i tried to just delete the world video, it loads a dummy fake source, yet that has 30fps... so I changed the fps in the source code to 60fps, reduced the resolution for the dummy image to 420x210 n player_methods.py,... , playback at half speed, reproducing almost every frame, now runs at 20% CPU but if I turn it up to full speed then the framerate drops to ~40 fps

mkassner commented 6 years ago

@papr @pointcontrols My guess here is that v-sync is capping the loop at 60fps and our wait logic + cpu load trigger that the 60fps recording skips frame during playback. @pointcontrols I think we should try to skip gl updates and drawing if the loop is too fast. We do the same in eye.py .

Here: https://github.com/pupil-labs/pupil/blob/master/pupil_src/launchables/eye.py#L450-L455 and here https://github.com/pupil-labs/pupil/blob/master/pupil_src/launchables/eye.py#L579

mkassner commented 6 years ago

@pointcontrols what do you think about this?

joergsimon commented 5 years ago

so, I also, after calibration would not need any output during recording. Did you find out how to do that?

Edit: Ah, damn it. This is player, I would like to have no output on capture. Any ideas on that?

papr commented 4 years ago

If a custom plugin is used, and the frame rate drops to less than 28Hz, then it is likely that the plugin is calling a blocking function that takes too much time. Plugins can store and publish data via built-in mechanism like this. I highly recommend using this mechanism instead of implementing it youself to avoid potentially blocking functions.