Conversation
There was a problem hiding this comment.
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')) |
There was a problem hiding this comment.
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.
@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.