Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing encode format #777

Merged
merged 1 commit into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions picamera2/encoders/encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ def format(self, value):
"""
if value == "RGB888":
self._format = V4L2_PIX_FMT_BGR24
elif value == "BGR888":
self._format = V4L2_PIX_FMT_RGB24
elif value == "YUV420":
self._format = V4L2_PIX_FMT_YUV420
elif value == "XBGR8888":
Expand Down
11 changes: 11 additions & 0 deletions tests/easy_video2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/python3

from picamera2 import Picamera2

picam2 = Picamera2()

# This format was missing previously:
picam2.video_configuration.format = 'BGR888'

# Record a 2 second video.
picam2.start_and_record_video("test.mp4", duration=2)
1 change: 1 addition & 0 deletions tests/test_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ tests/configurations.py
tests/context_test.py
tests/display_transform_null.py
tests/display_transform_qt.py
tests/easy_video2.py
tests/encoder_start_stop.py
tests/large_datagram.py
tests/mjpeg_server.py
Expand Down
Loading