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

Fix problem configuring USB cams #746

Merged
merged 1 commit into from
Jul 18, 2023
Merged
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
9 changes: 6 additions & 3 deletions picamera2/picamera2.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,11 @@ def __init__(self, camera_num=0, verbose_console=None, tuning=None):
# We deliberately make raw streams with no size so that it will be filled in
# later once the main stream size has been set.
self.preview_configuration = self.create_preview_configuration()
self.preview_configuration.enable_raw()
self.preview_configuration.enable_raw() # causes the size to be reset to None
self.still_configuration = self.create_still_configuration()
self.still_configuration.enable_raw()
self.still_configuration.enable_raw() # ditto
self.video_configuration = self.create_video_configuration()
self.video_configuration.enable_raw()
self.video_configuration.enable_raw() # ditto
except Exception:
_log.error("Camera __init__ sequence did not complete.")
raise RuntimeError("Camera __init__ sequence did not complete.")
Expand Down Expand Up @@ -918,6 +918,9 @@ def configure_(self, camera_config="preview") -> None:
camera_config = camera_config.make_dict()
if camera_config is None:
camera_config = self.create_preview_configuration()
# Be 100% sure that non-Pi cameras aren't asking for a raw stream.
if not self._is_rpi_camera():
camera_config['raw'] = None

# Mark ourselves as unconfigured.
self.libcamera_config = None
Expand Down
Loading