Block 119: Video Processing Basics
Read and process video frames with OpenCV.
Concepts
- cv2.VideoCapture() from file or webcam
- cap.read() to get frames
- Processing frame-by-frame with a while loop
- cv2.VideoWriter() to save output video
Code Examples
See exercise below.
Exercise
Read a short video file and print its FPS, frame count, and resolution. Apply grayscale conversion to each frame and save as a new video.
Homework
What is the practical difference between working with images vs video streams in real-time processing?