使用 python 降低相机的 FPS
Decrease FPS of a camera using python
我正在从显示原始 fps 设置为 25 的相机读取帧。我正在尝试将其 FPS 降低到大约 6-7。
我同时读取多个摄像头并将帧附加到各个摄像头的 deque
。我在这里使用了线程。
到目前为止,我正在这样做,但运气不好
while True:
try:
# Read next frame from stream and insert into deque
status, frame = self.capture.read()
frame = cv2.resize(frame, (640, 360))
if status:
self.deque.append(frame)
else:
self.capture.release()
self.online = False
frame_count = 1
while True:
try:
# Read next frame from stream and insert into deque
status, frame = self.capture.read()
if frame_count % 4 == 0:
frame = cv2.resize(frame, (640, 360))
if status:
self.deque.append(frame)
else:
self.capture.release()
self.online = False
frame_count += 1
我正在从显示原始 fps 设置为 25 的相机读取帧。我正在尝试将其 FPS 降低到大约 6-7。
我同时读取多个摄像头并将帧附加到各个摄像头的 deque
。我在这里使用了线程。
到目前为止,我正在这样做,但运气不好
while True:
try:
# Read next frame from stream and insert into deque
status, frame = self.capture.read()
frame = cv2.resize(frame, (640, 360))
if status:
self.deque.append(frame)
else:
self.capture.release()
self.online = False
frame_count = 1
while True:
try:
# Read next frame from stream and insert into deque
status, frame = self.capture.read()
if frame_count % 4 == 0:
frame = cv2.resize(frame, (640, 360))
if status:
self.deque.append(frame)
else:
self.capture.release()
self.online = False
frame_count += 1