Read & write Video (from System & webcam) in Open-CV

Nikhil Upadhyay
Knowledge Gurukul
Published in
2 min readMar 11, 2021

Basically in this we will understand how we can open video or web cam with the help of Computer Vision.

Here we will understand with the help of Computer Vision what we can do with video:

  1. Start Web Cam
  2. Load Video From System
  3. convert video into Gray scale
  4. Save video recorded via web cam

Frame : A video is collection of Frames any video we will see in real life is form with the help of frame for example a frame depends really on the format. Film runs at 24 frames per second while video runs at 30 fps, for example. So, for video, 1 frame would be 1/30th of a second. 5 seconds would be 150 frames.

So let’s go and understand how we can work with open-CV for load the video from web cam or load video from our system and many more..

  1. Start Web Cam :

For start the camera or webcam we use this functioncv2.VideoCapture(0) and if we have connected other camera to pc then we can change the value from 0 to 1 and 2 according to camera.

2. Load Video From System :

Convert in Gray and Save video :

So this all are basic operations that we can perform via Open-CV.

--

--

Nikhil Upadhyay
Knowledge Gurukul

Experience in AI(Computer Vision), Machine Learning, Python, Data Science and Proficient in Data Analysis, Predictive modelling, NLP, Database(SQL,