SK-AM62P-LP: Debugging RTP Camera Stream Flickering on AM62P Qt6 HMI application

Part Number: SK-AM62P-LP
Other Parts Discussed in Thread: AM62P, AM62P5

Hi, I am using latest sdk in my evm (tisdk-default-image-am62pxx-evm-11.01.16.13.rootfs.wic.xz ) 

I  Have connected display using HDMI connector and I am able to see the ti-apps-launcher appilcation.

I have disabled and stopped the ti-apps-launcher HMI app using the systemctl command. I created a new Qt6 HMI application (sid_am62p_qt_hmi) and set up its corresponding service (sid_am62p_qt_hmi), mapping it to the binary located at /usr/bin/sid_am62p_qt_hmi/sid_am62p_qt_hmi. I then enabled and started the new service. I can now see my HMI application displayed on the screen. Additionally, I have successfully streamed the USB camera(I have taken refrence from  live_camera module from ti-apps-launcher), and it is working with the following pipeline: 

image.png

I am now attempting to stream an RTP camera using the following pipeline. The stream is coming through, but it is flickering. During flickering, the following log messages are generated. I request your support in helping us resolve this issue.

image.png

image.png

image.png

  • Hi Karthikeyan,

    image.png

    Does the above pipeline without your application show any flickering?

    what I meant was: try running the pipeline using command line and see if you can run without any issues.

    Also, try the below pipeline on command line and let us know if you still see flickering?

    gst-launch-1.0 -v udpsrc port=5008 ! 'application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96' ! \
    rtph264depay ! h264parse ! v4l2h264dec ! kmssink driver-name=tidss sync=false 

    Best Regards,

    Suren

  • Thanks for your response. We are using multicast RTP camera, I have adjusted the RTP command from unicast(as per camera configuration) to multicast and tested, it is not working. Screenshots are shared for reference.

    gst-launch-1.0 -v udpsrc multicast-group=224.0.40.116 multicast-iface="eth0" port=5008 ! 'application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96' ! rtph264depay ! h264parse ! v4l2h264dec ! kmssink driver-name=tidss sync=false

  • Hi Karthikeyan

    Did the below pipeline work:

    gst-launch-1.0 -v udpsrc port=5008 ! 'application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96' ! \
    rtph264depay ! h264parse ! v4l2h264dec ! kmssink driver-name=tidss sync=false 

    Since the pipeline you are running is showing some internal data stream error, which is not able to link the elements in the pipeline.

    Best Regards,

    Suren

  • The pipeline you shared didn’t work for me. That’s the same screenshot I had shared earlier.

  • Hi Karthikeyan,

    Can you add the following in rtph264depay element when trying to use v4l2h264dec in the pipeline:

    rtph264depay wait-for-keyframe=1 

    Also, are you using v4l2h264enc for encoding and streaming via udpsink?

    Best Regards,

    Suren

  • Hi Suren,

    Thanks for your suggestion. I have tested as per your suggestion, It is not working. Tested command and log I have shared for your reference. 

    Tested Command:

    gst-launch-1.0 -v udpsrc multicast-group=224.0.40.116 multicast-iface="eth0" port=5008 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" auto-multicast=true ! rtpjitterbuffer ! rtph264depay wait-for-keyframe=1 ! h264parse ! v4l2h264dec capture-io-mode=dmabuf ! videoconvert ! video/x-raw,format=NV12 ! kmssink driver-name=tidss sync=false

    Tested log:

    root@am62pxx-evm:/usr/bin/sid_am62p_qt_hmi/videos# clear
    [H[Jroot@am62pxx-evm:/usr/bin/sid_am62p_qt_hmi/videos# gst-launch-1.0 -v udpsrc multicast-group=224.0.40.116 multicast-iface="eth0" port=5008 caps="application/x-
    -rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" auto-multicast=true ! rtpjitterbuffer ! rtph264depay wait-for-k
    keyframe=1 ! h264parse ! v4l2h264dec capture-io-mode=dmabuf ! videoconvert ! video/x-raw,format=NV12 ! kmssink driver-name=tidss sync=false
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    /GstPipeline:pipeline0/GstKMSSink:kmssink0: display-width = 1920
    /GstPipeline:pipeline0/GstKMSSink:kmssink0: display-height = 1080
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    /GstPipeline:pipeline0/GstUDPSrc:udpsrc0.GstPad:src: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96
    /GstPipeline:pipeline0/GstRtpJitterBuffer:rtpjitterbuffer0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96
    New clock: GstSystemClock
    /GstPipeline:pipeline0/GstRtpJitterBuffer:rtpjitterbuffer0.GstPad:src: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96
    /GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0.GstPad:src: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au
    /GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, parsed=(boolean)true
    /GstPipeline:pipeline0/v4l2h264dec:v4l2h264dec0.GstPad:sink: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, parsed=(boolean)true
    /GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au
    /GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96
    Redistribute latency...
    /GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, width=(int)1280, height=(int)800, framerate=(fraction)0/1, coded-picture-structure=(string)frame, chroma-format=(stri[84389.564507] ------------[ cut here ]------------
    ng)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, pars[84389.572654] WARNING: CPU: 2 PID: 27374 at /drivers/media/common/videobuf2/videobuf2-core.c:1803 vb2_start_streaming+0x108/0x178 [videobuf2_common]
    ed=(boolean)true, profile=(string)constrained-baseline, level=(s[84389.591292] Modules linked in: hid_multitouch rpmsg_ctrl rpmsg_char snd_soc_hdmi_codec uvcvideo videobuf2_vmalloc uvc overlay snd_soc_simple_card crct10dif_ce snd_soc_simple_card_utils pvrsrvkm(O) display_connector wave5 cfg80211 rti_wdt videobuf2_dma_contig v4l2_mem2mem k3_j72xx_bandgap rtc_ti_k3 videobuf2_v4l2 videobuf2_memops videobuf2_common snd_soc_tlv320aic3x_i2c tidss bluetooth sii902x videodev tps6598x ti_k3_r5_remoteproc snd_soc_tlv320aic3x ecdh_generic ecc mc drm_dma_helper rfkill drm_display_helper typec mcrc64 sa2ul snd_soc_davinci_mcasp drm_kms_helper snd_soc_ti_udma omap_mailbox omap_hwspinlock snd_soc_ti_edma snd_soc_ti_sdma pwm_tiehrpwm pwm_tiecap cryptodev(O) fuse drm drm_panel_orientation_quirks backlight ipv6
    tring)5.1
    /GstPipeline:pipeline0/v4l2h264dec:v4l2h264dec0.GstPa[84389.661158] CPU: 2 UID: 0 PID: 27374 Comm: rtpjitterbuffer Tainted: G W O 6.12.43-ti-01064-g3a3f87d0bf70 #1
    d:sink: caps = video/x-h264, stream-format=(string)byte-stream, [84389.677630] Tainted: [W]=WARN, [O]=OOT_MODULE
    alignment=(string)au, width=(int)1280, height=(int)800, framerat[84389.687513] Hardware name: Texas Instruments AM62P5 SK (DT)
    e=(fraction)0/1, coded-picture-structure=(string)frame, chroma-f[84389.698613] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
    ormat=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(u[84389.711097] pc : vb2_start_streaming+0x108/0x178 [videobuf2_common]
    int)8, parsed=(boolean)true, profile=(string)constrained-baselin[84389.722891] lr : vb2_start_streaming+0x68/0x178 [videobuf2_common]
    e, level=(string)5.1
    [84389.734598] sp : ffff8000838ebb40
    [84389.739805] x29: ffff8000838ebb40 x28: ffff00083656e010 x27: 0000000000000000
    [84389.746936] x26: ffff000808a9b930 x25: ffff000806de8840 x24: 0000000000000000
    [84389.754063] x23: ffff800079990618 x22: 0000000000000000 x21: ffff000837896e90
    [84389.761190] x20: ffff000837896da8 x19: 00000000fffffffb x18: 0000000000000001
    [84389.768315] x17: 0000000000000000 x16: 0000000000000000 x15: 0113c484371c309a
    [84389.775439] x14: 00ef8ecf230f3aba x13: ffff000805600080 x12: 0000000000000001
    [84389.782563] x11: 00000000000000c0 x10: 00000000000009e0 x9 : ffff8000838eb890
    [84389.789688] x8 : ffff00095af9b180 x7 : 0001000000000002 x6 : 0000000000000003
    [84389.796812] x5 : 0001000000000000 x4 : ffff0008012325c0 x3 : 0000000000000000
    [84389.803936] x2 : 0000000000000000 x1 : ffff80007982c000 x0 : 0000000000000001
    [84389.811062] Call trace:
    [84389.813499] vb2_start_streaming+0x108/0x178 [videobuf2_common]
    [84389.819421] vb2_core_streamon+0x100/0x1c4 [videobuf2_common]
    [84389.825167] vb2_streamon+0x18/0x64 [videobuf2_v4l2]
    [84389.830134] v4l2_m2m_ioctl_streamon+0x38/0x98 [v4l2_mem2mem]
    [84389.835889] v4l_streamon+0x24/0x30 [videodev]
    [84389.840392] __video_do_ioctl+0x330/0x3fc [videodev]
    [84389.845402] video_usercopy+0x2e0/0x67c [videodev]
    [84389.850234] video_ioctl2+0x18/0x28 [videodev]
    [84389.854711] v4l2_ioctl+0x40/0x60 [videodev]
    [84389.859013] __arm64_sys_ioctl+0xac/0xf0
    [84389.862932] invoke_syscall+0x48/0x10c
    [84389.866675] el0_svc_common.constprop.0+0xc0/0xe0
    [84389.871370] do_el0_svc+0x1c/0x28
    [84389.874677] el0_svc+0x28/0x98
    [84389.877726] el0t_64_sync_handler+0x120/0x12c
    [84389.882073] el0t_64_sync+0x190/0x194
    [84389.885728] ---[ end trace 0000000000000000 ]---
    ERROR: from element /GstPipeline:pipeline0/v4l2h264dec:v4l2h264dec0: Could not read from resource.
    Additional debug info:
    /usr/src/debug/gstreamer1.0-plugins-good/1.22.12/sys/v4l2/gstv4l2object.c(5746): gst_v4l2_object_poll (): /GstPipeline:pipeline0/v4l2h264dec:v4l2h264dec0:
    poll error 1: Success (0)
    Execution ended after 0:00:00.684586525
    Setting pipeline to NULL ...
    Freeing pipeline ...
    root@am62pxx-evm:/usr/bin/sid_am62p_qt_hmi/videos#

  • Hi Karthikeyan,

    Can you run the pipeline without the capture-io-mode=dmabuf on v4l2h264dec and remove the videoconvert and caps filter following the videoconvert and provide me the pipeline and the logs again, in case it fails.

    v4l2h264dec capture-io-mode=dmabuf ! videoconvert ! video/x-raw,format=NV12 

    Best Regards,

    Suren

  • Hi Suren, as per your suggestion, I have tried the following command and I got live streaming. Is there any update needed? Please let me know.

    gst-launch-1.0 -v udpsrc multicast-group=224.0.40.116 multicast-iface="eth0" port=5008 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" auto-multicast=true ! rtpjitterbuffer latency=0 drop-on-latency=true ! rtph264depay wait-for-keyframe=1 ! video/x-h264, width=1280, height=800, framerate=30/1 ! h264parse ! queue max-size-buffers=4 leaky=downstream ! v4l2h264dec ! kmssink driver-name=tidss sync=false

  • Hi Karthikeyan, 

    I am glad you were able to get the pipeline working. 

    Let me know if any further assistance is required here on this thread.

    Best Regards,

    Suren

  • Hi Suren,

    Thanks for your support. It is working while trying in terminal, but it is hanging in qt6. I have shared the pipeline below. Request your support? 

    String LiveCamera::rtp_liveCamera_gst_pipeline_hw(int port) {
    return QString(
    "udpsrc multicast-group=224.0.40.116 multicast-iface=eth0 port=%1 "
    "caps=\"application/x-rtp, media=(string)video, clock-rate=(int)90000, "
    "encoding-name=(string)H264, payload=(int)96\" auto-multicast=true ! "
    "rtpjitterbuffer latency=0 drop-on-latency=true ! "
    "rtph264depay wait-for-keyframe=1 ! "
    "video/x-h264, width=1280, height=800, framerate=30/1 ! "
    "h264parse ! queue max-size-buffers=4 leaky=downstream ! "
    "v4l2h264dec ! "
    "glupload ! qml6glsink name=sink sync=false"
    ).arg(port);
    }

  • Could you add glcolorconvert ! gldownload before the gml6glsink element and give it a try?

    Best Regards,

    Suren