This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM62P: If multiple video streams are to be output, how should the GStreamer command be modified?

Part Number: AM62P

Hi,

The current command for single-channel video stream output is:

gst-launch-1.0 v4l2src device="/dev/video3" ! video/x-raw, width=1920, height=1536, format=UYVY ! queue ! kmssink driver-name=tidss sync=false.

Could you please tell me how to modify the command for dual-channel and multi-channel video stream output? Thank you!

  • Hi,

    I’ve assigned your query to the concerned expert. Please note that responses may be delayed due to the Christmas and New Year holidays. Please feel free to ping this thread if you don't receive a response latest by Jan 1st week

    Regards,
    Johnson

  • Hi Ying,

    gst-launch-1.0 v4l2src device="/dev/video3" ! video/x-raw, width=1920, height=1536, format=UYVY ! queue ! kmssink driver-name=tidss sync=false.

    You can modify the above pipeline as shown below:

    /* Display pipeline */

    gst-launch-1.0 v4l2src device="/dev/video3" ! video/x-raw, width=1920, height=1536, format=UYVY !  tee name=t \

    t. ! queue ! kmssink driver-name=tidss sync=false.

    /*Video streaming */

    t. ! queue ! v4l2h264enc ! rtph264pay ! udpsink host=127.0.0.1 port=5000

    As you would see, I used a camera source to display the contents on the display and in parallel, I have also streamed the camera capture as encoded stream via network in the above example.

    Hope this helps

    Best Regards,

    Suren

  • Hi Suren,

    Thank you very much for your reply. However, I would like to output four video streams (video3, video4, video5, and video6) to the display simultaneously. Could you please let me know how to achieve this with commands?

    Best Regards

    Ying

  • Hi Ying,

    Use mosaic gstreamer element to display all 4 camera's output in a single display:

    Example Pipeline on AM62P would be something like below:

    gst-launch-1.0 \

    v4l2src device=/dev/video-ov5640-cam0 ! video/x-raw, width=640,height=480, format=YUY2 ! ticolorconvert ! queue ! mosaic.sink_0 \

    v4l2src device=/dev/video-ov5640-cam1 ! video/x-raw, width=640,height=480, format=YUY2 ! ticolorconvert ! queue ! mosaic.sink_1 \

    v4l2src device=/dev/video-ov5640-cam2 ! video/x-raw, width=640,height=480, format=YUY2 ! ticolorconvert ! queue ! mosaic.sink_2 \

    v4l2src device=/dev/video-ov5640-cam3 ! video/x-raw, width=640,height=480, format=YUY2 ! ticolorconvert ! queue ! mosaic.sink_3 \

    timosaic name=mosaic \

    sink_0::startx=300 sink_0::starty=0 sink_0::width=640 sink_0::height=480 \

    sink_1::startx=980 sink_1::starty=0 sink_1::width=640 sink_1::height=480  \

    sink_2::startx=300 sink_2::starty=500 sink_2::width=640 sink_2::height=480 \

    sink_3::startx=980 sink_3::starty=500 sink_3::width=640 sink_3::height=480 ! \

    video/x-raw, width=1920, height=1080, format=NV12 ! queue ! kmssink driver-name=tidss sync=false force-modesetting=true

    Hope this helps

    Best Regards,

    Suren

  • Hi Suren,

    Currently, multi-channel video streams can be output simultaneously, but the video suffers from frame corruption and duplicate frames. Could you please provide commands that leverage hardware acceleration?

    Best Regards

    Ying