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

VideoCapture add support for byte buffer #24400

Open
gdippolito opened this issue Oct 13, 2023 · 4 comments · May be fixed by #25584
Open

VideoCapture add support for byte buffer #24400

gdippolito opened this issue Oct 13, 2023 · 4 comments · May be fixed by #25584

Comments

@gdippolito
Copy link

Describe the feature and motivation

Hello!

Thanks for your work in this project.

I'm using OpenCV VideoCapture in order to download decode a few frames from a video downloaded from a remote location. OpenCV seems to be working pretty well for both H.264 and H.265 file format but it requires a file handle in the VideoCapture constructor. This means that in order to pass a downloaded object we need to first save to a temporary file and then pass the resulting path passed to VideoCapture.

Would you consider adding support to a byte object in the constructor?

Additional context

No response

@vrabaud
Copy link
Contributor

vrabaud commented Oct 16, 2023

May I suggest to actually support vector<uchar> (or just raw pointer) instead of cv::Mat to not fall into the problem with int/size_t like in #22036

@facug91
Copy link

facug91 commented Jan 15, 2024

Here's a SO post with someone's solution for this, which might help https://stackoverflow.com/questions/5237175/process-video-stream-from-memory-buffer

@gdippolito
Copy link
Author

Here's a SO post with someone's solution for this, which might help https://stackoverflow.com/questions/5237175/process-video-stream-from-memory-buffer

Thanks @facug91 for the response. Since we have a working solution in C++ would it be much effort to add support to the Python bindings to support a byte object instead of only supporting a file handle?

@dkurt dkurt linked a pull request May 14, 2024 that will close this issue
12 tasks
@dkurt
Copy link
Member

dkurt commented May 15, 2024

Initial version with FFmpeg backend only: #25584

@dkurt dkurt self-assigned this May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants