How to edit video frames without extracting each frame first ? OpenCV

Question:

I am currently extracting frames from a video so I can add some bounding boxes in each frame. Then, I want to put all the frames together and make a new video, using openCV. The problem is that every time I want to do that, I have to extract thousand of frames first. Is there a way to do it without having to extract the frames?
Thanks

Asked By: fribeiro98

||

Answers:

That assumption isn’t correct. You can use OpenCV’s VideoCapture to load a video, get a frame, do some processing on it and save it using a VideoWriter object – one frame at a time. There is no need to load all frames into memory and then store them all at once.

Answered By: code-lukas
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.