繁体   English   中英

使用 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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM