ModalAI Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    UVC camera video recording and encoding implementation

    VOXL SDK
    3
    4
    153
    Loading More Posts
    • 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.
    • A
      AndriiHlyvko
      last edited by

      Hi, I am currently trying to implement video recording of UVC camera. My initial approach was to use OMX in the voxl-uvc-server to try to encode the NV12 raw frames to h264/h265 and then pass them to a modal pipe so that I could have voxl-mavcam-manager read from the encoded pipe and save the frames to a file. I was looking at how the voxl-camera-server was using OMX and HAL3 library to do the encoding but it seems pretty complex. As an alternative I was also considering using ffmpeg to do the encoding since its a simpler more high-level library but I am worried that ffmpeg won't be able to do hardware acceleration. I was wondering if any of the developers could give me some pointers or point me to any documentation resources to help me with the implementation.

      Thanks.

      Eric KatzfeyE 1 Reply Last reply Reply Quote 0
      • Eric KatzfeyE
        Eric Katzfey ModalAI Team @AndriiHlyvko
        last edited by

        @AndriiHlyvko You can look at voxl-streamer. That is based on GStreamer. You could modify that to save video to a file. https://gitlab.com/voxl-public/voxl-sdk/services/voxl-streamer

        Alex KushleyevA A 2 Replies Last reply Reply Quote 0
        • Alex KushleyevA
          Alex Kushleyev ModalAI Team @Eric Katzfey
          last edited by

          Just to add, the voxl-streamer (gstreamer) does use the OMX API for the hardware encoder under the hood, so the only extra overhead you will see is from sending YUVs over MPA (encoding should be very fast and efficient).

          If resolution is 1080p or smaller, you should not see a large performance hit from sending YUVs over MPA. Sending 4K YUV frames over MPA (from uvc server to voxl-streamer) would consume significant resources (cpu), but would still work (you could try it).

          Alex

          1 Reply Last reply Reply Quote 0
          • A
            AndriiHlyvko @Eric Katzfey
            last edited by AndriiHlyvko

            @Eric-Katzfey @Alex-Kushleyev not exactly what I was looking for. I already implemented it using ffmpeg library. Basically I wanted to use voxl-send-command utility to send start/stop recording commands while also have the ability to save snapshots. I didn't like the idea of using gstreamer pipes for implementing this so I chose ffmpeg. I think my solution is good enough for now. I am able to start/stop recordings do snapshots and embed xmp metadata into the snapshots. Although I might come back to using OMX library if I decide I need the hardware encoding.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Powered by NodeBB | Contributors