Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/components/camera/advanced-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 27 additions & 1 deletion docs/operate/reference/components/camera/webcam.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Enter a name or use the suggested name for your camera and click **Create**.

Edit and fill in the attributes as applicable.
Leave the **video_path** blank and the camera will use the default video path for your machine.
If this doesn't work when you test your camera later, you can try a different video path by following the prompt in the Viam app to add a [webcam discovery service](https://app.viam.com/module/rand/find-webcams) and identify path options.
If this doesn't work when you test your camera later, you can try [configuring a video path](#using-video_path).

{{% /tab %}}
{{% tab name="JSON Template" %}}
Expand Down Expand Up @@ -99,6 +99,32 @@ The following attributes are available for `webcam` cameras:

## Using `video_path`

### Find a video path using a discovery service in the Viam app

The [`rand:find-webcams:webcam-discovery`](https://github.com/randhid/find-webcams) service helps you identify path options.
To add and use the service:

1. In the Viam app, navigate to the **CONFIGURE** tab of your machine's page.
1. Click the **+** icon next to your machine part in the left-hand menu and select **Service**.
1. Search for `find-webcams` and select the `discovery / find-webcams:webcam-discovery` service.
1. Click **Add module**.
1. Enter a name or use the suggested name for your camera and click **Create**.
1. Save your configuration, and wait a moment for the service to start.
1. Click **Test** to see the available `video_path`s.

{{<imgproc src="/components/camera/webcam-discovery-test.png" alt="The test panel for the find-webcams service." resize="1100x" style="max-width:600px" class="shadow imgzoom" >}}

1. Click the **Copy attributes** button for the camera you want to use.
1. Click the **{}** icon in the upper right corner of the camera component configuration.

{{<imgproc src="/components/camera/advanced-config.png" resize="x1100" declaredimensions=true alt="The switch to advanced button in the Viam app." style="max-width:200px" class="shadow" >}}

1. Paste the copied attributes.
1. Click **Save**.
1. You can now delete the discovery service and the module that provides it from your machine.

### Find a video path using the command line

To list available `video_path`s use the following command:

{{< tabs name="Find video devices" >}}
Expand Down
2 changes: 2 additions & 0 deletions docs/operate/reference/services/discovery/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Users of your module can then:
1. Create a camera with the copy-pasteable configuration snippet for the camera they want to use, with the camera path already filled in.
1. Use the configured camera in their vision service configuration.

To see this in action, see [webcam discovery](/operate/reference/components/camera/webcam/#find-a-video-path-using-a-discovery-service-in-the-viam-app) as an example.

To interact with a discovery service programmatically, use the [discovery service API](/dev/reference/apis/services/discovery/).

## Configuration
Expand Down
Loading