Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8015

Python • Re: MJPEG live streaming failed

$
0
0
Running your code gives me this error

Code:

NameError: name 'release_camera' is not defined
Can you post the whole code?

Also what system are you running it on? And which camera module is it?
Running on Raspberry Pi 4 and the camera module is e con systems see3cam 130 d

Below is the whole code:

Code:

import cv2cap = cv2.VideoCapture(0,cv2.CAP_V4L2)cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc(*'MJPG'))cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)while True:    ret, frame = cap.read()    if not ret:        break    cv2.imshow("Live Camera Feed", frame)        if cv2.waitKey(1) == 27:        breakcap.release()cv2.destroyAllWindows()
Apologies for not providing specifics in the initial post.

Statistics: Posted by tove — Thu Jun 12, 2025 12:25 am



Viewing all articles
Browse latest Browse all 8015

Trending Articles