-
Notifications
You must be signed in to change notification settings - Fork 8
add resolution argument #538
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds command-line control over camera resolution by introducing an --resolution argument that allows users to specify custom width and height values for the video stream.
Key changes:
- Modified
start_stream()to accept configurable width and height parameters with backward-compatible defaults (854x480) - Added argparse-based command-line argument parsing for resolution specification in WIDTHxHEIGHT format
- Updated the main execution flow to parse and pass resolution values to the streaming function
| try: | ||
| width, height = map(int, args.resolution.split('x')) |
Copilot
AI
Nov 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The resolution parsing logic doesn't validate that the parsed width and height values are positive integers or within reasonable bounds. Negative values or zero could be passed to start_stream(), which may cause unexpected behavior in the camera command. Consider adding validation such as if width <= 0 or height <= 0: ... after parsing.
sgbaird
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot, these will need to be variables that's imported from my_secrets.py, similar to other variables and secrets. Since this will be going to YouTube, we might want to restrict it to the following options: 240p, 360p, 480p, 720p. It would also be good to allow people to rotate by 90 degrees (in addition to being able to flip vertically or horizontally) to have a portrait mode stream. However, default should be non-rotated. You can include the allowed options in the comments of my_secrets.py
remove all the CLI code
No description provided.