Hello Guys, In this tutorial, I will show you how to play a video file using OpenCV. To play a video file or to stream a webcam OpenCV has a function named VideoCapture. This function takes only one argument. If you want to play the video you need to pass the file name with extension. Ex: nature.mp4. Similarly, If you want to stream your webcam you need to pass a number or device index. Which simply means which webcam you want to access. Just in case, If you have more than one webcam. If you have only one webcam then you have to pass 0 or else if you have two web cameras then for accessing the second web camera you have to pass 1 and so on. Once we have initialized the video object by calling the VideoCapture function. Then we will use an infinite while loop which will iterate till video.read() method returns true. read() function returns two parameters 1. Boolean – If True video still playing or False if the video is ended. 2. Frame – Here frame is simply your picture. We h
This blog includes computer hacks,tips and tricks,gaming hacks and many more stuff.