From 235fe378d18ff8d2cbb31c79d957ce58fe8e8b76 Mon Sep 17 00:00:00 2001 From: Joel Purra Date: Thu, 12 May 2022 14:59:34 +0200 Subject: [PATCH] Take vendor/product ids into account for examples - 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 - https://github.com/joelpurra/uvcc/issues/21 --- README.md | 3 +- examples/README.md | 29 +++++++++++++------ .../{ => 1133-2093}/controls.json | 0 .../{ => 1133-2093}/demo/README.md | 0 .../{ => 1133-2093}/demo/auto.json | 0 .../{ => 1133-2093}/demo/cold.json | 0 .../{ => 1133-2093}/demo/crazy.json | 0 .../{ => 1133-2093}/demo/record-demo.sh | 0 .../{ => 1133-2093}/demo/warm.json | 0 .../{ => 1133-2093}/devices.json | 0 .../logitech-c920/{ => 1133-2093}/export.json | 0 .../{ => 1133-2093}/metadata.json | 0 .../logitech-c920/{ => 1133-2093}/ranges.json | 0 examples/logitech-c920/demo/output/.gitignore | 1 - .../{ => 1118-1906}/controls.json | 0 .../{ => 1118-1906}/devices.json | 0 .../{ => 1118-1906}/export.json | 0 .../{ => 1118-1906}/metadata.json | 0 .../{ => 1118-1906}/ranges.json | 0 examples/update-example.sh | 7 +---- 20 files changed, 23 insertions(+), 17 deletions(-) rename examples/logitech-c920/{ => 1133-2093}/controls.json (100%) rename examples/logitech-c920/{ => 1133-2093}/demo/README.md (100%) rename examples/logitech-c920/{ => 1133-2093}/demo/auto.json (100%) rename examples/logitech-c920/{ => 1133-2093}/demo/cold.json (100%) rename examples/logitech-c920/{ => 1133-2093}/demo/crazy.json (100%) rename examples/logitech-c920/{ => 1133-2093}/demo/record-demo.sh (100%) rename examples/logitech-c920/{ => 1133-2093}/demo/warm.json (100%) rename examples/logitech-c920/{ => 1133-2093}/devices.json (100%) rename examples/logitech-c920/{ => 1133-2093}/export.json (100%) rename examples/logitech-c920/{ => 1133-2093}/metadata.json (100%) rename examples/logitech-c920/{ => 1133-2093}/ranges.json (100%) delete mode 100644 examples/logitech-c920/demo/output/.gitignore rename examples/microsoft-1425/{ => 1118-1906}/controls.json (100%) rename examples/microsoft-1425/{ => 1118-1906}/devices.json (100%) rename examples/microsoft-1425/{ => 1118-1906}/export.json (100%) rename examples/microsoft-1425/{ => 1118-1906}/metadata.json (100%) rename examples/microsoft-1425/{ => 1118-1906}/ranges.json (100%) diff --git a/README.md b/README.md index 6a23679..5db96bd 100644 --- a/README.md +++ b/README.md @@ -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? diff --git a/examples/README.md b/examples/README.md index 6474945..f6a7dcf 100644 --- a/examples/README.md +++ b/examples/README.md @@ -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 `-` 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? diff --git a/examples/logitech-c920/controls.json b/examples/logitech-c920/1133-2093/controls.json similarity index 100% rename from examples/logitech-c920/controls.json rename to examples/logitech-c920/1133-2093/controls.json diff --git a/examples/logitech-c920/demo/README.md b/examples/logitech-c920/1133-2093/demo/README.md similarity index 100% rename from examples/logitech-c920/demo/README.md rename to examples/logitech-c920/1133-2093/demo/README.md diff --git a/examples/logitech-c920/demo/auto.json b/examples/logitech-c920/1133-2093/demo/auto.json similarity index 100% rename from examples/logitech-c920/demo/auto.json rename to examples/logitech-c920/1133-2093/demo/auto.json diff --git a/examples/logitech-c920/demo/cold.json b/examples/logitech-c920/1133-2093/demo/cold.json similarity index 100% rename from examples/logitech-c920/demo/cold.json rename to examples/logitech-c920/1133-2093/demo/cold.json diff --git a/examples/logitech-c920/demo/crazy.json b/examples/logitech-c920/1133-2093/demo/crazy.json similarity index 100% rename from examples/logitech-c920/demo/crazy.json rename to examples/logitech-c920/1133-2093/demo/crazy.json diff --git a/examples/logitech-c920/demo/record-demo.sh b/examples/logitech-c920/1133-2093/demo/record-demo.sh similarity index 100% rename from examples/logitech-c920/demo/record-demo.sh rename to examples/logitech-c920/1133-2093/demo/record-demo.sh diff --git a/examples/logitech-c920/demo/warm.json b/examples/logitech-c920/1133-2093/demo/warm.json similarity index 100% rename from examples/logitech-c920/demo/warm.json rename to examples/logitech-c920/1133-2093/demo/warm.json diff --git a/examples/logitech-c920/devices.json b/examples/logitech-c920/1133-2093/devices.json similarity index 100% rename from examples/logitech-c920/devices.json rename to examples/logitech-c920/1133-2093/devices.json diff --git a/examples/logitech-c920/export.json b/examples/logitech-c920/1133-2093/export.json similarity index 100% rename from examples/logitech-c920/export.json rename to examples/logitech-c920/1133-2093/export.json diff --git a/examples/logitech-c920/metadata.json b/examples/logitech-c920/1133-2093/metadata.json similarity index 100% rename from examples/logitech-c920/metadata.json rename to examples/logitech-c920/1133-2093/metadata.json diff --git a/examples/logitech-c920/ranges.json b/examples/logitech-c920/1133-2093/ranges.json similarity index 100% rename from examples/logitech-c920/ranges.json rename to examples/logitech-c920/1133-2093/ranges.json diff --git a/examples/logitech-c920/demo/output/.gitignore b/examples/logitech-c920/demo/output/.gitignore deleted file mode 100644 index 72e8ffc..0000000 --- a/examples/logitech-c920/demo/output/.gitignore +++ /dev/null @@ -1 +0,0 @@ -* diff --git a/examples/microsoft-1425/controls.json b/examples/microsoft-1425/1118-1906/controls.json similarity index 100% rename from examples/microsoft-1425/controls.json rename to examples/microsoft-1425/1118-1906/controls.json diff --git a/examples/microsoft-1425/devices.json b/examples/microsoft-1425/1118-1906/devices.json similarity index 100% rename from examples/microsoft-1425/devices.json rename to examples/microsoft-1425/1118-1906/devices.json diff --git a/examples/microsoft-1425/export.json b/examples/microsoft-1425/1118-1906/export.json similarity index 100% rename from examples/microsoft-1425/export.json rename to examples/microsoft-1425/1118-1906/export.json diff --git a/examples/microsoft-1425/metadata.json b/examples/microsoft-1425/1118-1906/metadata.json similarity index 100% rename from examples/microsoft-1425/metadata.json rename to examples/microsoft-1425/1118-1906/metadata.json diff --git a/examples/microsoft-1425/ranges.json b/examples/microsoft-1425/1118-1906/ranges.json similarity index 100% rename from examples/microsoft-1425/ranges.json rename to examples/microsoft-1425/1118-1906/ranges.json diff --git a/examples/update-example.sh b/examples/update-example.sh index e8f1292..82934a2 100755 --- a/examples/update-example.sh +++ b/examples/update-example.sh @@ -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'