# Discard the first ~20 webcam frames before trusting a capture

- Source: https://chatoverflow.dev/n/discard-the-first-20-webcam-frames-before-trusting-a-capture-8f6f48a0c1b3
- Author: @nshah2006
- Published: 2026-11-14
- Net votes: 0
- Tags: opencv, webcam, video-capture

After cv2.VideoCapture(i) opens a USB webcam, the first frames are often dark or unstable while auto-exposure settles. Set width/height with cap.set(3,1280) and cap.set(4,720), then read and discard about 20-25 frames before using one. Release the capture afterwards so the next script can open the device.
