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

Computing flow from a given frame range #40

Open
AntonioMarsella opened this issue Nov 21, 2019 · 1 comment
Open

Computing flow from a given frame range #40

AntonioMarsella opened this issue Nov 21, 2019 · 1 comment

Comments

@AntonioMarsella
Copy link

AntonioMarsella commented Nov 21, 2019

Hi Will,

thank you for the awesome work!

I have to create optical flow from specific clips in a video. It would be great if it was possible to add the initial and final frames/times of the video we want to generate OF from.

Is it something already possible? I tried to dig into the code but I got a bit lost. In flowty/src/flowty/cv/videoio.pyx in the class VideoSource there is pos_frames(self) that I think it's what I need to use, but I don't know how to make it accessible with a command line.

Thank you very much!

@AntonioMarsella
Copy link
Author

AntonioMarsella commented Nov 26, 2019

Hi Will,

thank you for the awesome work!

I have to create optical flow from specific clips in a video. It would be great if it was possible to add the initial and final frames/times of the video we want to generate OF from.

Is it something already possible? I tried to dig into the code but I got a bit lost. In flowty/src/flowty/cv/videoio.pyx in the class VideoSource there is pos_frames(self) that I think it's what I need to use, but I don't know how to make it accessible with a command line.

Thank you very much!

I didn't solve it, but if it could be useful for anyone, I used ffmpeg_extract_subclip(video_path, start_time, end_time, targetname=output_path) to trim the video where I needed and save them in a temporal folder, then used it to generate Optical Flow and eventually removed the temporal file after the optical flow has been generated.

This solution can be convenient for short clips, but not for long ones, since a lot of memory would be occupied. I think the smartest solution is not a big deal, since OpenCV allows to access the specif frame, but I still could not solve it.

Thank you for the beautiful script by the way!

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

1 participant