Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frames calculated by ezTrack #27

Closed
h1408 opened this issue Apr 22, 2021 · 5 comments
Closed

Frames calculated by ezTrack #27

h1408 opened this issue Apr 22, 2021 · 5 comments

Comments

@h1408
Copy link

h1408 commented Apr 22, 2021

Hello, I've been trying to run behavioral videos on ezTrack and have been using the frame rate to calculate the start/end frames. One thing I've noticed is that when I set the end frame to None and then run step 3, the total frames calculated is much higher than what I'm seeing it is by getting the total frames of the video in Matlab. Also the 'nominal fps' is different from the frame rate I see on my computer of the video. What would this difference mean in terms of analyzing the video? If I put an end frame of 15000 but ezTrack is calculated the total frames to be 600,000+ would this mean it's not actually analyzing the full video? I would appreciate any insight you have on this, thank you!

@ZachPenn
Copy link
Collaborator

Could you please provide more information on the filetype being used? The nominal fps is taken directly from the video codec metadata so I'm not sure why there would be a discrepancy. As to the number of frames, some video file types seem to have a large number of irretrievable or blank frames, and ezTrack simply reports the total, including these 'blank' frames. If the blank frames are at the end of the video, after all the frames you actually want to process, there's no issue. However, if they are intermixed, you will likely encounter issues.

I might try converting to another filetype.

@h1408
Copy link
Author

h1408 commented May 10, 2021

Hello, this is a .wmv filetype. When I open it on a windows pc, the frame rate shows as 25 frames/second. In addition, I have run the video file through MATLAB to assess the properties of the file and it also shows it as 25 frames/second, along with a total number of frames as 16000 as in the attached photo. However, in ezTrack the frames per second is shown as 1000 and the total number of frames is over 600000 (photo of this is also attached). I thought there weren't any blank frames since I was able to find the total number of frames of the video which is around 16000.
Would converting potentially lead to loss of information?
Thanks so much!
Screenshot (4)

Screenshot (3)

Screen Shot 2021-05-10 at 4 30 23 PM

@ZachPenn
Copy link
Collaborator

Looking more into the frame issue, I don't think it's so much that you are missing frames, but that you have incomplete frames. This is a typical of many video compression algorithms to support support smaller file sizes (see https://en.wikipedia.org/wiki/Video_compression_picture_types for a description of 'p frames'). Unfortunately, ezTrack does not currently possess a good way to handle videos with these incomplete, 'p frames', and simply skips them. While all full frames can be processed, frame indexing gets really weird (because key frames 1,2,3,4,5 might have indices 1,11,21,31,41, or something like this).

It may be possible for me to implement something to handle this, but I don't have any videos like yours so I can't do any testing. If you would like to post a video here or reach out to me via email, please do. I would like to start dealing with this.

With respect to the frame rate issue, I really am not sure why ezTrack isn't read the metadata properly. Again, if you'd be willing to post an actual video, it'd be great to check it out.

@h1408
Copy link
Author

h1408 commented May 28, 2021 via email

@ZachPenn
Copy link
Collaborator

I have implemented fixes to help test for these issues (commit 0fec6e4), and have updated instructions to specify that ezTrack should not be used with temporal compression algorithms. I am closing this issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants