Skip to content

Commit

Permalink
Add YUV420 encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
haixuanTao committed Dec 1, 2024
1 parent 6b941f2 commit 0514044
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions node-hub/opencv-video-capture/opencv_video_capture/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ def main():
# Get the right encoding
if encoding == "rgb8":
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
elif encoding == "yuv420":
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2YUV_I420)
elif encoding in ["jpeg", "jpg", "jpe", "bmp", "webp", "png"]:
ret, frame = cv2.imencode("." + encoding, frame)
if not ret:
Expand Down

0 comments on commit 0514044

Please sign in to comment.