denisecailab / ezTrack

Free, platform independent, behavior tracking software.
GNU General Public License v3.0
118 stars 41 forks source link

suggestion: use capture.get(cv2.CAP_PROP_FPS) to get fps directly from video capture file #12

Closed Leandroscholz closed 4 years ago

Leandroscholz commented 4 years ago

Hi @ZachPenn @phildong,

I would like to suggest a minor change to make things easier for users. Instead of requesting fps from user, use capture.get(cv2.CAP_PROP_FPS) to get fps directly from video capture file and add it to video_dict['fps']. In case user desires to change fps for some reasion this could be also added.

Cheers, L.

ZachPenn commented 4 years ago

We've debated this. The issue with doing it this way is that the FPS metadata is not always written correctly. For example, with the Miniscope software, although the true frame acquisition rate is often 30 FPS (at least that's what we use in the lab), the metadata is written as 20/25 FPS (I can't remember offhand which one). In any event, the user will need to know the frame rate in order to specify which frames they are interested in analyzing so we haven't seen it as a big deal to make them explicitly write it in. I should also note that the video_dict['fps'] parameter only influences video playback speeds.