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

Save number of frames to video's metadata file #73

Open
niksirbi opened this issue Mar 31, 2023 · 0 comments
Open

Save number of frames to video's metadata file #73

niksirbi opened this issue Mar 31, 2023 · 0 comments
Labels
enhancement Optional feature
Milestone

Comments

@niksirbi
Copy link
Member

Problem

We need the frame count per video at several places in the app (e.g. ROI and event pages).
Currently, this is implemented via OpenCV thus:

vidcap = cv2.VideoCapture(video_path, apiPreference=cv2.CAP_FFMPEG)
num_frames = int(vidcap.get(cv2.CAP_PROP_FRAME_COUNT))

Since videos can be several hours long, the above calculation may take a few seconds per video, leading to delays when switching between videos.

Ideas

To improve performance, the number of frames per video should be calculated only once and saved in the video metadata file. This can be achieved by adding a "calculate number of frames" button or by silently saving the data upon first calculation.

Caveats

Alternatively, there may be a much faster way of reading the number of frames per video which I am not aware of.

@niksirbi niksirbi added the enhancement Optional feature label Mar 31, 2023
@niksirbi niksirbi added this to the v1 milestone Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Optional feature
Projects
None yet
Development

No branches or pull requests

1 participant