Skip to content

Commit

Permalink
Take vendor/product ids into account for examples
Browse files Browse the repository at this point in the history
- Cameras with the same "marketing name" may differ between different hardware implementations, as detected by their USB (vendor and) product id.
- It is unclear if these different hardware implementations also have diffferent properties, from the perspective of `uvcc` usage.
- For `uvcc` example output, use both a marketing name subdirectory and a subdirectory per product id.
- This commit updates the instructions and moves current examples to per-id subdirectories.

See

- #21
  • Loading branch information
joelpurra committed May 12, 2022
1 parent 3aefc6a commit 235fe37
Show file tree
Hide file tree
Showing 20 changed files with 23 additions and 17 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

## Compatible cameras

- [Logitech C920 HD Pro Webcam](https://www.logitech.com/en-us/product/hd-pro-webcam-c920).
- [Logitech C920 HD Pro Webcam](https://www.logitech.com/en-us/product/hd-pro-webcam-c920) ([1133:2093](./examples/logitech-c920/1133-2093/))
- [Microsoft LifeCam Studio](https://www.microsoft.com/en-WW/accessories/products/webcams/lifecam-studio) Model 1425 ([1118:1906](./examples/microsoft-1425/1118-1906/))
- Hopefully other [UVC-compatible webcams and digital camcorders](https://en.wikipedia.org/wiki/List_of_USB_video_class_devices).

### Do you have another UVC-compatible camera?
Expand Down
29 changes: 20 additions & 9 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
# [`uvcc`](https://joelpurra.com/projects/uvcc/) output examples

See individual subdirectories for specific cameras.
A small sample of `uvcc` camera control output. See individual subdirectories for specific cameras. Note that [cameras with the same "marketing name" may have several USB hardware implementations with different vendor/product ids](https://github.com/joelpurra/uvcc/issues/21), so there may be more than one subdirectory.

## How to add or update the output from your camera

- Unplug the USB cable and reconnect your camera.
- This done to get "fresh" (hopefully default) values for `uvcc export`.
- Open the terminal.
- Create and/or enter the correct camera subdirectory.
- Use [kebab-case](https://en.wikipedia.org/wiki/Kebab_case) naming, with vendor and product code/name.
- Create and/or enter the correct camera product marketing name subdirectory.
- The "marketing name" is the product name (usually including a short codename) you would see on the box when you buy a camera.
- Use [kebab-case](https://en.wikipedia.org/wiki/Kebab_case) naming, with vendor name and product code/name.
- Do not use the full "marketing name", such as "Logitech HD Pro Webcam C920".
- Correct example: `logitech-c920`.
- Run [`../update-example.sh`](./update-example.sh)
- For Linux systems, entering the password in `sudo` might be required.
- Verify that the `*.json` files were updated.
- Correct examples:
- [`logitech-c920`](./logitech-c920/) from `Logitech HD Pro Webcam C920` (`name` in `uvcc devices`).
- [`microsoft-1425`](./microsoft-1425/) from the vendor name and the model number `1425` found on the label on the camera cable as well as the box the camera was delivered in.
- Create and/or enter the correct vendor/product id subdirectory.
- This is due to [cameras with the same "marketing name" having different USB product ids](https://github.com/joelpurra/uvcc/issues/21), and this possibly having different hardware properties.
- Use the format `<vendor id>-<product id>` with decimal number formatting.
- You can find the USB `vendor` and `product` ids in the output of `uvcc devices`.
- Correct examples:
- [`logitech-c920/1133-2093`](./logitech-c920/1133-2093/)
- [`microsoft-1425/1118-1906`](./microsoft-1425/1118-1906/)
- Reset the camera to default values.
- Unplug all cameras.
- Reconnect only the camera you want to test.
- This done to get "fresh" (hopefully default) values for `uvcc export`.
- Run [`../../update-example.sh`](./update-example.sh)
- Verify that the `*.json` files were created/updated.
- Commit your changes and [submit a pull request](https://github.com/joelpurra/uvcc/compare).

## Is it not working?
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion examples/logitech-c920/demo/output/.gitignore

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 1 addition & 6 deletions examples/update-example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ rm -f 'controls.json'
$UVCC controls > 'controls.json'

rm -f 'devices.json'
if $UVCC devices >& /dev/null;
then
$UVCC devices > 'devices.json'
else
sudo $UVCC devices > 'devices.json'
fi
$UVCC devices > 'devices.json'

rm -f 'export.json'
$UVCC export > 'export.json'
Expand Down

0 comments on commit 235fe37

Please sign in to comment.