imsanjoykb / Data-Science-Regular-Bootcamp

Regular practice on Data Science, Machien Learning, Deep Learning, Solving ML Project problem, Analytical Issue. Regular boost up my knowledge. The goal is to help learner with learning resource on Data Science filed.
https://imsanjoykb.github.io/
MIT License
106 stars 40 forks source link

Capturing video details #121

Open imsanjoykb opened 2 years ago

imsanjoykb commented 2 years ago

OpenCV is a vast library that helps in providing various functions for image and video operations. With OpenCV, we can perform operations on the input video. OpenCV also allows us to save that operated video for further usage. For saving images, we use cv2.imwrite() which saves the image to a specified file location. But, for saving a recorded video, we create a Video Writer object.

Firstly, we specify the fourcc variable. FourCC is a 4-byte code used to specify the video codec. List of codes can be obtained at Video Codecs by FourCC. The codecs for Windows is DIVX and for OSX is avc1, h263. FourCC code is passed as cv2.VideoWriter_fourcc(’MJPG’) for MJPG and cv2.VideoWriter_fourcc(’XVID’) for DIVX.