Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse
Brand Logo

ModalAI Forum

  1. ModalAI Support Forum
  2. Software Development
  3. Duplicating UVC camera

Duplicating UVC camera

Scheduled Pinned Locked Moved Software Development
5 Posts 4 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    maxwelllwang
    wrote on last edited by
    #1

    We are using a USB webcam plugged in to the USB port on the modem. Currently we can access the webcam from within a docker image as a USB device. But now we want to use this same camera feed for two separate docker images/ processes. so,

    How to duplicate video feed / USB device on Voxl?

    Existing methods use v4l2loopback to generate duplicate video streams, however the default yocto distribution does not contain the kernel modules necessary to run v4l2
    How would I duplicate video stream without using a custom kernel

    Asked this question before in a different channel but wanted to see if anyone has experience with this

    Eric KatzfeyE 2 Replies Last reply
    0
    • M maxwelllwang

      We are using a USB webcam plugged in to the USB port on the modem. Currently we can access the webcam from within a docker image as a USB device. But now we want to use this same camera feed for two separate docker images/ processes. so,

      How to duplicate video feed / USB device on Voxl?

      Existing methods use v4l2loopback to generate duplicate video streams, however the default yocto distribution does not contain the kernel modules necessary to run v4l2
      How would I duplicate video stream without using a custom kernel

      Asked this question before in a different channel but wanted to see if anyone has experience with this

      Eric KatzfeyE Offline
      Eric KatzfeyE Offline
      Eric Katzfey
      ModalAI Team
      wrote on last edited by
      #2

      @maxwelllwang You can build a custom kernel with this project: https://gitlab.com/voxl-public/system-image-build/voxl-build

      1 Reply Last reply
      0
      • M maxwelllwang

        We are using a USB webcam plugged in to the USB port on the modem. Currently we can access the webcam from within a docker image as a USB device. But now we want to use this same camera feed for two separate docker images/ processes. so,

        How to duplicate video feed / USB device on Voxl?

        Existing methods use v4l2loopback to generate duplicate video streams, however the default yocto distribution does not contain the kernel modules necessary to run v4l2
        How would I duplicate video stream without using a custom kernel

        Asked this question before in a different channel but wanted to see if anyone has experience with this

        Eric KatzfeyE Offline
        Eric KatzfeyE Offline
        Eric Katzfey
        ModalAI Team
        wrote on last edited by
        #3

        @maxwelllwang Another idea is to use the dev branch of the new voxl-uvc-project here: https://gitlab.com/voxl-public/modal-pipe-architecture/voxl-uvc-server/-/tree/dev. This will stream the video out with MPA. You can then have MPA clients in multiple docker containers consuming the video frames.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          Arrowtec
          Contributor
          wrote on last edited by Arrowtec
          #4

          Hey,
          I will try my best to explain the idea I had.
          You can use gstreamer to stream your camera to a shared memory sink (shmsink). To implement this I would use cv2 (python) with the video writer class to write the video to a FIFO file location. The location can be set to /temp/[name] which will utilize shared memory. This location can be mapped to both docker containers with the -v / --volume parameter so you can access the stream from the other docker container as well. This is obviously not the easiest nor best solution but probably better than a custom kernel.
          All the best

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            This is essentially the point of MPA (Modal Pipe Architecture, our interprocess communications standard). We publish FIFOs to /run/mpa with the data (standard FIFOs use the filesystem as a handle, not for actually transferring the data, the kernel will pass the data directly from process to process). voxl-uvc-server will pull the data from the camera and write it out to a pipe in /run/mpa, which can easily be mounted in a docker image and read there. You can use the libmodal_pipe(or manually request a pipe and open the FIFO, though this will be less reliable than our extensively tested library) to read it in a docker image (or images as MPA allows numerous clients).

            1 Reply Last reply
            0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            ModalAI
            Categories Recent Tags ModalAI.com Docs
            © 2026 ModalAI® · Accelerating autonomy for smaller, smarter, safer drones · Powered by NodeBB
            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups