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

    read/write raw video data in FIFO

    Ask your questions right here!
    2
    3
    266
    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.
    • S
      shlee853
      last edited by

      Hi

      Do you have an example code to read/write raw video stream in generated FIFO using voxl-rtsp -m option?

      Thanks,

      1 Reply Last reply Reply Quote 0
      • Alex KushleyevA
        Alex Kushleyev ModalAI Team
        last edited by

        Hi, you can use the following commands.

        1. In first terminal, run voxl-rtsp which will connect to camera and create the fifo and wait for the client to open the fifo

        voxl-rtsp -m /dev/my_fifo -f h264
        voxl-rtsp version 1.0.4
        Enabling output fifo /dev/my_fifo
        Setting output format to: h264
        Connected
        Started camera 0
        Created session
        Video track created
        Updated camera parameters
        AE Mode: 1, Exposure: 0us, Gain: 0us, AWB Mode: 1
        rtsp://<your_voxl_ip_address>:8900/live
        Camera Output FIFO starting: /dev/my_fifo .. will block until client is ready
        ** process will proceed when you start reading the fifo **

        1. then in second terminal (This opens the fifo and sends the raw data from the fifo into a file):

        cat /dev/my_fifo > raw_video.h264

        1. press control-c in 1st terminal to stop the process, the cat process will also exit since the fifo will be closed.

        Note that using voxl-rtsp you can use -f to specify which format to use for data output, include h264 (Defualt), h265, or even yuv or raw formats.

        You can also just dump the video to a file without fifo, using voxl-rtsp -o <filename>. From voxl-rtsp -h :

        -o <filename> Save video to filename (No save to file by default). If extension of the file is .mp4, then video will be written in MP4 container, otherwise raw

        So if you wanted to just use voxl-rtsp without a fifo to save raw yuv (no mp4 container) to file, then just use voxl-rtsp -f h264 (or h265) -o my_video.h264 (or .h265)

        Did that answer your question?

        S 1 Reply Last reply Reply Quote 0
        • S
          shlee853 @Alex Kushleyev
          last edited by

          @Alex-Kushleyev great!

          That’s a point what I need. I’ll try it

          Thanks,

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