Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

how to read and release after each frames is processed in streaming video using pafy and cv2

I use pafy and cv2 to read video streaming from youtube and process the frames using object detection. The default method is to read each frame from the stream. however, if I would like to read only one frame then close the loop (release) and start to re-read again and close the loop ,and so on the process is repeated between read and close for each frame. I did this because I have bottleneck problem due to slow object detection and I don't need to detect all frames (it is ok to have gap frames). is it possible to do that ?

how to read and release after each frames is processed in streaming video using pafy and cv2

I use pafy pafy and cv2 cv2 to read video streaming from youtube and process the frames using object detection. The default method is to read each frame from the stream. however, if I would like to read only one frame then close the loop (release) and start to re-read again and close the loop ,and so on the process is repeated between read and close for each frame. I did this because I have bottleneck problem due to slow object detection and I don't need to detect all frames (it is ok to have gap frames). is it possible to do that ?