SK-AM69: gstreamer RTSP with v4l2h264dec

Part Number: SK-AM69

Tool/software:

Hi,
I installed using ti-processor-sdk-linux-am69-sk-10_01_08_01-Linux-x86-Install.bin and flashed tisdk-default-image-am69-sk.rootfs.wic to the SD card.

I would like to use gst-launch-1.0 + RTSP + v4l2h264dec, but I ran into some issues. Below are the command and logs:

GST_DEBUG=3 gst-launch-1.0 rtspsrc location=rtsp://192.168.109.242/live_st1 latency=50 ! rtph264depay ! h264parse ! v4l2h264dec ! videoconvert ! waylandsink

weston@am69-sk:/tmp$ GST_DEBUG=3 gst-launch-1.0 rtspsrc location=rtsp://192.168.109.242/live_st1 latency=50 ! rtph264depay ! h264parse ! v4l2h264dec ! videoconvert ! wayl
andsink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Pipeline is PREROLLED ...
Prerolled, waiting for progress to finish...
Progress: (connect) Connecting to rtsp://192.168.109.242/live_st1
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
0:00:00.098474086 1857 0xffff90000b70 WARN udpsrc gstudpsrc.c:1638:gst_udpsrc_open:<udpsrc0> warning: Could not create a buffer of requested 524288 byte
s (Operation not permitted). Need net.admin privilege?
0:00:00.098565213 1857 0xffff90000b70 WARN udpsrc gstudpsrc.c:1648:gst_udpsrc_open:<udpsrc0> have udp buffer of 212992 bytes while 524288 were requested
0:00:00.099317033 1857 0xffff90000b70 WARN udpsrc gstudpsrc.c:1638:gst_udpsrc_open:<udpsrc1> warning: Could not create a buffer of requested 524288 byte
s (Operation not permitted). Need net.admin privilege?
0:00:00.099359189 1857 0xffff90000b70 WARN udpsrc gstudpsrc.c:1648:gst_udpsrc_open:<udpsrc1> have udp buffer of 212992 bytes while 524288 were requested
Progress: (request) SETUP stream 0
Progress: (open) Opened Stream
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Progress: (request) Sending PLAY request
Redistribute latency...
Progress: (request) Sending PLAY request
0:00:00.109526662 1857 0xffff90000d20 FIXME default gstutils.c:4036:gst_pad_create_stream_id_internal:<fakesrc0:src> Creating random stream-id, consider i
mplementing a deterministic way of creating a stream-id
Redistribute latency...
Progress: (request) Sent PLAY request
Redistribute latency...
0:00:00.128166954 1857 0xffff90001230 WARN v4l2 gstv4l2object.c:3408:gst_v4l2_object_reset_compose_region:<v4l2h264dec0:sink> Failed to get default co
mpose rectangle with VIDIOC_G_SELECTION: Invalid argument
Redistribute latency...
0:00:00.137190824 1857 0xffff90001230 WARN GST_CAPS gstpad.c:5813:pre_eventfunc_check:<v4l2h264dec0:sink> caps video/x-h264, stream-format=(string)byte-st
ream, alignment=(string)au, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, coded-picture-structure=(string)frame, chroma-format=(string)4:2:0, bit-depth-lum
a=(uint)8, bit-depth-chroma=(uint)8, colorimetry=(string)0:1:0:0, parsed=(boolean)true, profile=(string)high, level=(string)4.2 not accepted
0:00:00.138125618 1857 0xffff90001230 WARN GST_CAPS gstpad.c:5813:pre_eventfunc_check:<v4l2h264dec0:sink> caps video/x-h264, stream-format=(string)byte-st
ream, alignment=(string)au, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, coded-picture-structure=(string)frame, chroma-format=(string)4:2:0, bit-depth-lum
a=(uint)8, bit-depth-chroma=(uint)8, colorimetry=(string)0:1:0:0, parsed=(boolean)true, profile=(string)high, level=(string)4.2 not accepted
0:00:00.138873893 1857 0xffff90001230 WARN GST_CAPS gstpad.c:5813:pre_eventfunc_check:<v4l2h264dec0:sink> caps video/x-h264, stream-format=(string)byte-st
ream, alignment=(string)au, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, coded-picture-structure=(string)frame, chroma-format=(string)4:2:0, bit-depth-lum
a=(uint)8, bit-depth-chroma=(uint)8, colorimetry=(string)0:1:0:0, parsed=(boolean)true, profile=(string)high, level=(string)4.2 not accepted
0:00:00.139521816 1857 0xffff90001230 WARN GST_CAPS gstpad.c:5813:pre_eventfunc_check:<v4l2h264dec0:sink> caps video/x-h264, stream-format=(string)byte-st
ream, alignment=(string)au, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, coded-picture-structure=(string)frame, chroma-format=(string)4:2:0, bit-depth-lum
a=(uint)8, bit-depth-chroma=(uint)8, colorimetry=(string)0:1:0:0, parsed=(boolean)true, profile=(string)high, level=(string)4.2 not accepted
0:00:00.154962384 1857 0xffff90000ed0 WARN basesrc gstbasesrc.c:3134:gst_base_src_loop:<udpsrc1> error: Internal data stream error.
0:00:00.154997770 1857 0xffff90000ed0 WARN basesrc gstbasesrc.c:3134:gst_base_src_loop:<udpsrc1> error: streaming stopped, reason not-negotiated (-4)
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc1: Internal data stream error.

How to fix this ?

By the way
gst-launch-1.0 rtspsrc location=rtsp://192.168.109.242/live_st1 latency=50 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! waylandsink
works fine.

Thank you

  • Hi Jason,

    Can you try the below pipeline and see if it works?

    GST_DEBUG=3 gst-launch-1.0 rtspsrc location=rtsp://192.168.109.242/live_st1 latency=50 ! rtph264depay wait-for-keyframe=1 ! h264parse ! v4l2h264dec ! videoconvert ! waylandsink

    Best Regards,

    Suren

  • Hi Suren,

    Thanks your reply.

    I try, but it doesn't work, see the log below.

    Best Regards,

    LOG:
    weston@am69-sk:~$ GST_DEBUG=3 gst-launch-1.0 rtspsrc location=rtsp://192.168.109.242/live_st1 latency=50 ! \
    > rtph264depay wait-for-keyframe=1 ! h264parse ! v4l2h264dec ! videoconvert ! waylandsink
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Progress: (open) Opening Stream
    Pipeline is PREROLLED ...
    Prerolled, waiting for progress to finish...
    Progress: (connect) Connecting to rtsp://192.168.109.242/live_st1
    Progress: (open) Retrieving server options
    Progress: (open) Retrieving media info
    0:00:00.078091736 1321 0xffff80000b70 WARN udpsrc gstudpsrc.c:1638:gst_udpsrc_open:<udpsrc0> warning: Could not create a buffer of requested 524288 b?
    0:00:00.078179742 1321 0xffff80000b70 WARN udpsrc gstudpsrc.c:1648:gst_udpsrc_open:<udpsrc0> have udp buffer of 212992 bytes while 524288 were requesd
    Progress: (request) SETUP stream 0
    Progress: (open) Opened Stream
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    Progress: (request) Sending PLAY request
    Redistribute latency...
    Progress: (request) Sending PLAY request
    0:00:00.088038871 1321 0xffff80000d20 FIXME default gstutils.c:4036:gst_pad_create_stream_id_internal:<fakesrc0:src> Creating random stream-id, consided
    Redistribute latency...
    Progress: (request) Sent PLAY request
    Redistribute latency...
    0:00:00.104402936 1321 0xffff80001230 WARN v4l2 gstv4l2object.c:3408:gst_v4l2_object_reset_compose_region:<v4l2h264dec0:sink> Failed to get defaultt
    Redistribute latency...
    0:00:00.427265413 1321 0xffff80001230 WARN GST_CAPS gstpad.c:5813:pre_eventfunc_check:<v4l2h264dec0:sink> caps video/x-h264, stream-format=(string)byted
    0:00:00.428262048 1321 0xffff80001230 WARN GST_CAPS gstpad.c:5813:pre_eventfunc_check:<v4l2h264dec0:sink> caps video/x-h264, stream-format=(string)byted
    0:00:00.429020946 1321 0xffff80001230 WARN GST_CAPS gstpad.c:5813:pre_eventfunc_check:<v4l2h264dec0:sink> caps video/x-h264, stream-format=(string)byted
    0:00:00.429670442 1321 0xffff80001230 WARN GST_CAPS gstpad.c:5813:pre_eventfunc_check:<v4l2h264dec0:sink> caps video/x-h264, stream-format=(string)byted
    0:00:00.429914935 1321 0xffff80000ed0 WARN basesrc gstbasesrc.c:3134:gst_base_src_loop:<udpsrc0> error: Internal data stream error.
    0:00:00.429937645 1321 0xffff80000ed0 WARN basesrc gstbasesrc.c:3134:gst_base_src_loop:<udpsrc0> error: streaming stopped, reason not-negotiated (-4)
    ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc0: Internal data stream error.
    Additional debug info:
    /usr/src/debug/gstreamer1.0/1.22.12/libs/gst/base/gstbasesrc.c(3134): gst_base_src_loop (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc0:
    streaming stopped, reason not-negotiated (-4)
    Execution ended after 0:00:00.342770967
    Setting pipeline to NULL ...
    0:00:00.430861939 1321 0xffff80000b70 WARN default gstrtspconnection.c:1417:writev_bytes: Operation was cancelled
    0:00:00.430907170 1321 0xffff80000b70 WARN rtspsrc gstrtspsrc.c:6796:gst_rtspsrc_try_send:<rtspsrc0> error: Could not send message. (Received end-of-f)
    ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not write to resource.
    Additional debug info:
    /usr/src/debug/gstreamer1.0-plugins-good/1.22.12/gst/rtsp/gstrtspsrc.c(6796): gst_rtspsrc_try_send (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
    Could not send message. (Received end-of-file)
    0:00:00.431066461 1321 0xffff80000b70 WARN rtspsrc gstrtspsrc.c:9267:gst_rtspsrc_pause:<rtspsrc0> error: Could not send message. (Received end-of-file)
    ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not write to resource.
    Additional debug info:
    /usr/src/debug/gstreamer1.0-plugins-good/1.22.12/gst/rtsp/gstrtspsrc.c(9267): gst_rtspsrc_pause (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
    Could not send message. (Received end-of-file)
    Freeing pipeline ...

  • Hi Jason,

    Is there a possibility you can enable this rtsp stream accessible? For us to validate on our end.

    Best Regards,

    Suren

  • Hi Suren,


    Due to the company’s security policy, this RTSP stream cannot be made accessible externally.
    The vendor and model are Aver CAM520 Pro3.
    Here is the related webpage:
    https://www.aver.com/Downloads/search?q=CAM520%20Pro3

    This is the information obtained using ffprobe:

    $ ffprobe -hide_banner -i rtsp://192.168.109.242/live_st1
    Input #0, rtsp, from 'rtsp://192.168.109.242/live_st1':
    Metadata:
    title : RTSP/RTP stream from AVer
    comment : LIVE555 Streaming Media v2019.03.06
    Duration: N/A, start: 1.100100, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuv420p(tv, gbr/reserved/reserved, progressive), 1920x1080, 30 fps, 29.97 tbr, 90k tbn, 60 tbc

    Hope this helps.

    I will update its firmware to see if that makes any difference.

    Best Regards,
    Jason

  • Hi Jason,

    I suspect this could be a problem handling the colorimetries in Gstreamer. Can you apply the below patch on V4L2 object that handles colorimetries and let us know if it solves the problem.

    diff --git a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c
    index f3e0e99829..03628fa559 100644
    --- a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c
    +++ b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c
    @@ -2614,13 +2614,13 @@ return_data:
           "height", G_TYPE_INT, (gint) height, NULL);   gst_v4l2_object_add_aspect_ratio (v4l2object, s);
    -
    +#if 0
       if (!v4l2object->skip_try_fmt_probes) {
         gst_v4l2_object_add_interlace_mode (v4l2object, s, width, height,
             pixelformat);
         gst_v4l2_object_add_colorspace (v4l2object, s, width, height, pixelformat);
       }
    -
    +#endif
       if (G_IS_VALUE (&rates)) {
         gst_v4l2src_value_simplify (&rates);

    Hope this helps

    Best Regards,

    Suren