{"id":50354339,"url":"https://github.com/basicallysource/macos-webcam-controls","last_synced_at":"2026-05-29T22:01:37.009Z","repository":{"id":339862094,"uuid":"1163054663","full_name":"basicallysource/macos-webcam-controls","owner":"basicallysource","description":"What it says on the thing","archived":false,"fork":false,"pushed_at":"2026-02-21T23:00:31.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-22T05:45:40.160Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/basicallysource.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-21T03:01:07.000Z","updated_at":"2026-02-21T23:00:35.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/basicallysource/macos-webcam-controls","commit_stats":null,"previous_names":["basicallysource/macos-webcam-controls"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/basicallysource/macos-webcam-controls","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basicallysource%2Fmacos-webcam-controls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basicallysource%2Fmacos-webcam-controls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basicallysource%2Fmacos-webcam-controls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basicallysource%2Fmacos-webcam-controls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/basicallysource","download_url":"https://codeload.github.com/basicallysource/macos-webcam-controls/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/basicallysource%2Fmacos-webcam-controls/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33672125,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-29T22:01:36.193Z","updated_at":"2026-05-29T22:01:37.001Z","avatar_url":"https://github.com/basicallysource.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Actual macOS Webcam Controls in Python\n\nEverything based on AVFoundation seems to be completely fake. [This great app](https://github.com/itaybre/CameraController/) is the only thing that seems to work programmatically for controlling exposure, white balance, etc. on a USB webcam on macOS. This repo is merely a translation of that work into Python.\n\n## Run The UI\n\nFrom the repository root:\n\n```bash\nuv run python camera_keyboard_ui.py\n```\n\nOptional:\n\n```bash\nuv run python camera_keyboard_ui.py --list\nuv run python camera_keyboard_ui.py 1\n```\n\n## Apply Settings From JSON\n\nUse `set.py` to apply settings without opening the UI.\n\n```bash\nuv run python set.py config.json --dry-run\nuv run python set.py config.json\nuv run python set.py config.json --verbose --force-manual\n```\n\nYou can copy `example_config.json` as a starting point:\n\n```bash\ncp example_config.json config.json\n```\n\nConfig structure:\n\n- `cameras`: list of rules\n- each rule has:\n  - matcher fields (any combination): `index`, `name`, `name_contains`, `bus`, `addr`, `vid`, `pid`\n  - `settings`: object of control IDs to values\n\n## `uvc_camera.py` API\n\n### Top-level functions\n\n- `listCameras() -\u003e list[UvcCameraDescriptor]`\n  - Discover available UVC cameras.\n- `unrefCamera(camera_descriptor) -\u003e None`\n  - Release a camera descriptor from `listCameras`.\n- `formatCamera(camera_descriptor, index) -\u003e str`\n  - Build a display string for a camera.\n\n### `UvcCameraDescriptor`\n\nFields:\n\n- `vendor_id`, `product_id`\n- `bus_number`, `device_address`\n- `interface_number`\n- `processing_unit_id`, `camera_terminal_id`\n- `product_name`, `manufacturer_name`, `display_name`\n\n### `UvcCameraController`\n\nUse as a context manager:\n\n```python\nfrom uvc_camera import listCameras, UvcCameraController, unrefCamera\n\ncameras = listCameras()\ntry:\n    with UvcCameraController(cameras[0]) as controller:\n        ids = controller.getSupportedControlIds()\n        value = controller.getControl(\"exposure_time\")\n        controller.setControl(\"exposure_time\", value + 1)\nfinally:\n    for cam in cameras:\n        unrefCamera(cam)\n```\n\nMethods:\n\n- `open()` / `close()`\n- `getSupportedControlIds() -\u003e list[str]`\n- `getControlSpec(control_id) -\u003e dict`\n- `getControlInfo(control_id) -\u003e UvcControlInfo`\n- `getControl(control_id) -\u003e int | bool | tuple[int, int]`\n- `setControl(control_id, value) -\u003e value`\n- `forceManualMode() -\u003e None`\n  - Forces only exposure mode to manual.\n\n### `UvcControlInfo`\n\nFields:\n\n- `is_capable`\n- `kind` (`int`, `bool`, `enum`, `pair`)\n- `current`\n- `minimum`, `maximum`, `resolution`\n\n### Control IDs\n\nThe module supports these IDs (only capable controls are exposed by `getSupportedControlIds()`):\n\n- `scanning_mode`\n- `exposure_mode`, `exposure_priority`, `exposure_time`\n- `gain`\n- `brightness`, `contrast`, `contrast_auto`\n- `saturation`, `sharpness`\n- `hue`, `hue_auto`\n- `gamma`\n- `white_balance`, `white_balance_auto`\n- `white_balance_component`, `white_balance_component_auto`\n- `power_line_frequency`\n- `backlight_compensation`\n- `focus_auto`, `focus_absolute`\n- `iris_absolute`\n- `zoom_absolute`\n- `pan_tilt_absolute`\n- `roll_absolute`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasicallysource%2Fmacos-webcam-controls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasicallysource%2Fmacos-webcam-controls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasicallysource%2Fmacos-webcam-controls/lists"}