Skip to content

Instantly share code, notes, and snippets.

@radames
radames / opencv_video_to_pygame.py
Last active April 17, 2023 15:34
OpenCV VideoCapture running on PyGame - repo ref https://github.com/radames/opencv_video_to_pygame
from pygame.locals import KEYDOWN, K_ESCAPE, K_q
import pygame
import cv2
import sys
camera = cv2.VideoCapture(1)
pygame.init()
pygame.display.set_caption("OpenCV camera stream on Pygame")
screen = pygame.display.set_mode([1280, 720])