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.

PROCESSOR-SDK-AM69: v4l2h264dec Gstreamer Test on Western wayland

Part Number: PROCESSOR-SDK-AM69
Other Parts Discussed in Thread: AM69, AM69A, SK-AM69

Tool/software:

Hi AM69 Champ !

Customer is testing using tisdk-default-image after installing AM69 SDK (after uninstalling ti-apps-launcher, developing on weston)

First, they want to write a program with QT on weston and then play the rtsp stream using gstreamer library. (Need to use HW acceleration feature)

First, they verified that it works when they run it like below. (waylandsink also verified the behavior)
gst-launch-1.0 rtspsrc location=rtsp://xxxxxxxx latency=100 ! queue ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! videoscale ! video/x-raw,width=640,height=480 ! glimagesink

However, when I use the v4l2h264dec mentioned in the documentation (software-dl.ti.com/.../Foundational_Components_Multimedia_wave5.html), it works, but it doesn't work properly, with stuttering frames.
Is this something that needs to be configured before use or is it something that shouldn't be used in a weston environment?
Also, I can't use kmssink, could you please give me a guide on how to use it?

Thanks and Regards,

Jack Cha

  • Hi Jack,

    Which SDK version is the customer using? Could they try running the pipeline below?

    gst-launch-1.0 rtspsrc location=rtsp://xxxxxxx latency=0 proxy-id=None proxy-pw=None ! rtph264depay ! video/x-h264, stream-format=avc ! h264parse ! v4l2h264dec ! kmssink sync=false

    For more GStreamer examples using RTSP sources and kmssink, see the EdgeAI data flows for AM69A: https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-edgeai/AM69A/08_06_01/exports/docs/common/edgeai_dataflows.html#rtsp-source

    Thank you,

    Fabiana

  • Hi Fabiana

    Please see their comments below.

    -----------------------------------------------------------

    SDK version :
    I built it according to the documentation and the config file and image file are as follows.
    $ ./oe-layertool-setup.sh -f configs/processor-sdk-linux/processor-sdk-linux-09_02_00_05.txt
    $ MACHINE=j784s4-evm bitbake -k tisdk-default-image
    Image file : tisdk-default-image-j784s4-evm-20240527062551.rootfs.wic

    I tested in the following way and got an error.

    $ gst-launch-1.0 rtspsrc location=rtsp://xxxxxxx latency=0 proxy-id=None proxy-pw=None ! rtph264depay ! video/x-h264, stream-format=avc ! h264parse ! v4l2h264dec ! kmssink sync=false

    Setting pipeline to PAUSED ...

    ERROR: from element /GstPipeline:pipeline0/GstKMSSink:kmssink0: Could not open DRM module (NULL)

    Additional debug info:

    ../gst-plugins-bad-1.20.7/sys/kms/gstkmssink.c(850): gst_kms_sink_start (): /GstPipeline:pipeline0/GstKMSSink:kmssink0:

    reason: No such file or directory (2)

    ERROR: pipeline doesn't want to preroll.

    ERROR: from element /GstPipeline:pipeline0/GstKMSSink:kmssink0: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure.

    Additional debug info:

    ../gstreamer-1.20.7/libs/gst/base/gstbasesink.c(5878): gst_base_sink_change_state (): /GstPipeline:pipeline0/GstKMSSink:kmssink0:

    Failed to start

    ERROR: pipeline doesn't want to preroll.

    Failed to set pipeline to PAUSED.

    Setting pipeline to NULL ...

    Freeing pipeline ...

    Attached is a video of the difference when using v4l2h264dec (left) and avdec_h264 (right).

    -----------------------------------------------------------

    Regards, 

    Jack

  • There'e additional input from this customer. 

    --------------------------------------------------------------------------

    If you have a working binary or a prebuilt image on the web that works, can you show us how it works after booting (after booting, how to enter commands, etc.)?

    --------------------------------------------------------------------------

    Regards, 

    Jack

  • Hi Jack,

    Is the customer using SK-AM69? If so, I would recommend they flash their SD card with the AM69A Edge AI WIC image found here: https://www.ti.com/tool/download/PROCESSOR-SDK-LINUX-AM69A

    Try the previous test pipelines and let me know if the issue persists.

    Thank you,

    Fabiana

  • Yes, they uses SK-AM69. 

    Let me ask them to use 69A image as they could not see any improvement when using AM69 image.

    Thanks.

  • Hi Jack,

    Sounds good. Let me know if you run into any issues.

    The Edge AI SDK includes several sample applications that you can run to test the functionality of GStreamer and kmssink. For more on running these sample apps see the following section: https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-sk-tda4vm/09_02_00/exports/edgeai-docs/common/sample_apps.html#python-c-apps

    Thank you,

    Fabiana

  • Hi Fabiana

    Thanks for above answers.

    Please find the test results from customer side.

    After uploading the image to the SK-AM69 EVB, I booted it up and did the following tests.

    1) Click (mouse) on the top right X to uninstall the program
    2) Set IP (using ifconfig)
    3) gst-launch-1.0 rtspsrc location=rtsp://xxxxx latency=0 proxy-id=None proxy-pw=None ! rtph264depay ! video/x-h264, stream-format=avc ! h264parse ! avdec_h264 ! glimagesink -> OK
    4) gst-launch-1.0 rtspsrc location=rtsp://xxxxx latency=0 proxy-id=None proxy-pw=None ! rtph264depay ! video/x-h264, stream-format=avc ! h264parse ! v4l2h264dec ! glimagesink -> Slow playback
    5) gst-launch-1.0 rtspsrc location=rtsp://xxxxx latency=0 proxy-id=None proxy-pw=None ! rtph264depay ! video/x-h264, stream-format=avc ! h264parse ! v4l2h264dec ! kmssink sync=false -> kmssink error

    Thanks and Regards, 

    Jack Cha

  • Hi Fabiana

    Regarding the RTSP testing,

    They're getting the RTSP stream directly from the camera, so sharing media files is not possible.
    If you send us a tested video file, we'll try to retest with it.

    Let me know if they are testing the camera stream as RTSP and there is anything else I need to check. 

    Thanks.

    Regards, 

    Jack

  • Hi Jack,

    Thank you for sharing the results using the latest Edge AI image. Please allow me some time to discuss with the multimedia team about this.

    Regards,

    Fabiana

  • Hi Jack,

    Sorry for the delay. My bandwidth has been limited these past two weeks. Could you try this pipeline with the additions of the queue elements and dmabuf sharing:

    gst-launch-1.0 rtspsrc location=rtsp://xxxxx latency=0 proxy-id=None proxy-pw=None ! queue ! rtph264depay ! queue ! video/x-h264, stream-format=avc ! h264parse ! queue ! v4l2h264dec capture-io-mode=5 ! queue ! glimagesink

    Thanks,
    Sarabesh S.