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

feat: Add basic USB-Camera support #10

Merged
merged 21 commits into from
Aug 14, 2024
Merged

feat: Add basic USB-Camera support #10

merged 21 commits into from
Aug 14, 2024

Conversation

mryel00
Copy link
Owner

@mryel00 mryel00 commented Jan 29, 2023

(Updated version)
This adds one new start parameter:

  • --camera_num -n to start spyglass with a specific camera. You can see all available cameras with the python command Picamera2.global_camera_info(). A start parameter to show this message should be added in the future.

This also adds the ability to use USB cameras instead of only CSI (Pi cameras). The whole filestructure of cams got updated to make use of inheritance for that reason.

Note:
USB cams run terribly atm with libcamera and not all controls are available to use. Therefore they shouldn't be used with Spyglass.

@mryel00 mryel00 added the enhancement New feature or request label Jan 29, 2023
@roamingthings
Copy link
Collaborator

I've created #23 as feature request for this

@roamingthings
Copy link
Collaborator

My thoughts regarding the implementation:

  • Afaik the filename convention for python is lowercase_with_underscore.py. This would mean usbCamera.py becomes usb_camera.py and usbServer.py becomes usb_server.py.
  • Looking at (usb_)camera.py the main difference seems to be the controls and main configuration. Maybe it would be better to introduce a class for the camera and have a method the get these values for each camera
  • run_server should become part of the camera class for the same reason.
  • It would be better to have an abstract camera class and a PiCamera and UsbCamera subclass.

@mryel00 Let me know if you would like to have some help regarding the implementation

@mryel00
Copy link
Owner Author

mryel00 commented Feb 5, 2023

Somehow I again forgot about the naming conventions 😅
You are right about the implementation way. That should be changed. This was more like a proof of concept and only a quick dirty way to implement and test it.
I would appreciate your help implementing it.

@mryel00 mryel00 marked this pull request as ready for review July 7, 2024 17:14
Copy link
Collaborator

@roamingthings roamingthings left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@mryel00 mryel00 merged commit 9c9c1ce into main Aug 14, 2024
2 checks passed
@mryel00 mryel00 deleted the add_usbcam_support branch August 14, 2024 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants