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

Annotate the video in 30 frame rate? #147

Open
faj2007 opened this issue Jun 12, 2018 · 6 comments
Open

Annotate the video in 30 frame rate? #147

faj2007 opened this issue Jun 12, 2018 · 6 comments

Comments

@faj2007
Copy link

faj2007 commented Jun 12, 2018

This tool annotate the video in 20 frame rate, does any one know how to change the frame rate? like 30 in my videos. Thanks

@antingshen
Copy link
Owner

The tool doesn't care about frame rate, it annotates by timestamp instead of frame number. Perhaps something in your post-processing script assumes 20 fps? (maybe the export_annotations script?)

@faj2007
Copy link
Author

faj2007 commented Jun 12, 2018

I don't know what is the export_annotations scripts. I have video in 30 frames rate, and I want to annotate each frame. Do you mean I can change the timestamp? or maybe I can only do it by imagelist option.

@antingshen
Copy link
Owner

the tool should just work with 30 fps videos. What problem are you having? Why do you say the tool only annotates at 20 fps?

@clayshieh
Copy link
Collaborator

The max fps this tool can edit is restricted by the SAME_FRAME_THRESHOLD value in annotation.js which by default is 0.01 seconds and because it's calculated as an absolute difference in frame times the max fps at default settings is 50 fps for videos. During video playback you can stop at whichever frame you want but if the timestamp for that frame is close enough to the timestamp of another already annotated frame then your annotations will be stored with that closest frame instead.

If you are experiencing issues where annotations aren't appearing where they should be on playback, try lowering the value of SAME_FRAME_THRESHOLD.

@faj2007
Copy link
Author

faj2007 commented Jun 14, 2018

Thanks for the answers, I finally do it in image lists option instead. Also downloading the images a little bit slow, but I can annotate each frame. Maybe I would try SAME_FRAME_THRESHOLD later. My SAME_FRAME_THRESHOLD is 0.01, and it turns out that it annotate the video in 20 fps.

@torresalyssa
Copy link

torresalyssa commented Feb 28, 2020

I found that the issue for me was not with SAME_FRAME_THRESHOLD, but with the frame rates that are hard-coded into the VideoFramePlayer class in annotator/static/views/framePlayers.js.

If you go to the class functions nextFrame() and previousFrame(), you'll see that frameRate is hard-coded as 1/20 for nextFrame() and 1/10 for previousFrame(). This also means that as it is written, moving forward one frame and moving back one frame will not result in the same frame sequences.

I was able to make this step through a 30fps, constant frame rate video by setting both frameRate to 1/30.

Ideally this would be something that could be dynamically set, or pulled from the video metadata. The idea would be that when I upload a video to be labeled, I can include a frame rate at which I want the video to be labeled and then the video player will pull in this information and use it to know how much to skip forward or backward by when traversing through frame-by-frame.

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

4 participants