I need to retrive from a video all the information about it such as - frame rate, size, bits, length... and also all the frame's data (the pixels as 2D numpy array for example). Do you have a function in python that you can load a video, and then retrive from it all it's data? Thank's a lot! I know there is such a function in matlab and I'm looking for a way of doing this on python.
CodePudding user response:
You'll benefit from the OpenCV library. You can install it several ways including [pip](pip install opencv-python) or conda. Here's a few previous SO threads discussing your question.
- Looping through frames: the numpy array you're looking for is the
frame
variable immediately underneath thewhile
statement - Retrieving frame rate and video duration
- Retrieving frame rate