Run tests for common video device configurations.
()
| 176 | |
| 177 | |
| 178 | async def main(): |
| 179 | """Run tests for common video device configurations.""" |
| 180 | |
| 181 | parser = argparse.ArgumentParser( |
| 182 | description="Test video device configurations for VisionProStreamer" |
| 183 | ) |
| 184 | parser.add_argument( |
| 185 | "--device", |
| 186 | default="0:none", |
| 187 | help="Video device identifier (e.g., '/dev/video0', '0:none') (default: '0:none')" |
| 188 | ) |
| 189 | parser.add_argument( |
| 190 | "--format", |
| 191 | dest="format_name", |
| 192 | default="avfoundation", |
| 193 | help="Input format string (e.g., 'v4l2', 'avfoundation', 'dshow') (default: 'avfoundation')" |
| 194 | ) |
| 195 | parser.add_argument( |
| 196 | "--size", |
| 197 | default="1280x720", |
| 198 | help="Resolution as WIDTHxHEIGHT (default 1280x720)" |
| 199 | ) |
| 200 | parser.add_argument( |
| 201 | "--fps", |
| 202 | type=float, |
| 203 | default=30, |
| 204 | help="Frames per second (default 30)" |
| 205 | ) |
| 206 | parser.add_argument( |
| 207 | "--live", |
| 208 | action="store_true", |
| 209 | help="Show live video feed (press Ctrl+C or 'q' to stop)" |
| 210 | ) |
| 211 | parser.add_argument( |
| 212 | "--save", |
| 213 | action="store_true", |
| 214 | help="Save 10 seconds of video to test_video_output.mp4" |
| 215 | ) |
| 216 | |
| 217 | args = parser.parse_args() |
| 218 | |
| 219 | # Determine mode |
| 220 | if args.live: |
| 221 | mode = "live" |
| 222 | elif args.save: |
| 223 | mode = "save" |
| 224 | else: |
| 225 | mode = "test" |
| 226 | |
| 227 | await test_video_device( |
| 228 | device=args.device, |
| 229 | format=args.format_name, |
| 230 | size=args.size, |
| 231 | fps=args.fps, |
| 232 | mode=mode |
| 233 | ) |
| 234 | |
| 235 |
no test coverage detected