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

Opening video starting from a specific frame. A proposal on introducing a new API #14

Open
Krzysztofz01 opened this issue Mar 28, 2024 · 1 comment

Comments

@Krzysztofz01
Copy link
Contributor

I come again with a proposal for a new API, which, I could implement if it receives positive feedback. What I mean is the possibility to open a video starting from a specific frame. The ability to open such a file with a " leap" would be very helpful when working with video using multiple threads/goroutines: each goroutine would create its own process in which it would work with its video chunk.

I also wonder how such a solution would compare performance-wise with a solution where there is one process with access to the file, and the work with the frame would be done in a pool of goroutines.

I am curious to hear the opinions of those interested.
Best regards!

@Krzysztofz01
Copy link
Contributor Author

Hello,
I'm back to pull this topic further. Regarding technical issues, I think this feature could be implemented in such a way that a Select(skip, take int) error method is provided, which allows you to skip N frames and select the next M frames (or all of them after passing e.g.: 0). Calling this method would only be possible before the process starts, that is, before the first frame is read (before init() is called). As for the FFMPEG process, select=between filters can be used, this would be the simplest solution but not the most efficient, since it requires decoding the entire video. Such an optimization problem can be circumvented by calculating on the basis of the indicated frames and frame-rate from which second of the recording we want to look for the frames indicated. A similar optimization can be applied to frame clipping methods. I look forward to feedback and would be happy to undertake the implementation.

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