Skip to content

Commit 7285946

Browse files
authored
Update capture_thread.py Modify the encoding format
Modify the encoding format to MJPG to reduce the camera bandwidth
1 parent 9b665ab commit 7285946

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

surround_view/capture_thread.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def connect_camera(self):
8888
width, height = self.resolution
8989
self.cap.set(cv2.CAP_PROP_FRAME_WIDTH, width)
9090
self.cap.set(cv2.CAP_PROP_FRAME_HEIGHT, height)
91+
self.cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc(*"MJPG"))
9192
# some camera may become closed if the resolution is not supported
9293
if not self.cap.isOpened():
9394
qDebug("Resolution not supported by camera device: {}".format(self.resolution))
@@ -96,6 +97,7 @@ def connect_camera(self):
9697
else:
9798
width = int(self.cap.get(cv2.CAP_PROP_FRAME_WIDTH))
9899
height = int(self.cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
100+
self.cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc(*"MJPG"))
99101
self.resolution = (width, height)
100102

101103
return True

0 commit comments

Comments
 (0)