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.

AM57x gstreamer element for rtsp streaming

Hello,

We are trying to run a "camera capture, encode and stream" use case using "gst-launch " on AM57xx evm using below command:

   gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=1000 io-mode=4 ! 'video/x-raw, \
   format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! ducatih264enc bitrate=4000 ! 'video/x-h264, mapping=/stream' ! rtspsink

We see below error:

WARNING: erroneous pipeline: no element "rtspsink"

So "rtspsink" element is not present .. is there an alternative element that can be used to stream the h264 encoded frames ?

Regards,

Snehal

  • I will forward this to the software team.
  • Hello,

    You could try below command:

    gst-inspect-1.0 | grep "sink"

    This will show you all available sink elements.

    BR
    Margarita
  • Below output of available sink elements:

    ====================
    root@am57xx-evm:~# gst-inspect-1.0 | grep "sink"
    udp: dynudpsink: UDP packet sender
    udp: multiudpsink: UDP packet sender
    udp: udpsink: UDP packet sender
    video4linux2: v4l2sink: Video (video4linux2) Sink
    gdkpixbuf: gdkpixbufsink: GdkPixbuf sink
    fbdevsink: fbdevsink: fbdev video sink
    tcp: multisocketsink: Multi socket sink
    tcp: multifdsink: Multi filedescriptor sink
    tcp: tcpserversink: TCP server sink
    tcp: tcpclientsink: TCP client sink
    inter: intervideosink: Internal video sink
    inter: intersubsink: Internal subtitle sink
    inter: interaudiosink: Internal audio sink
    ossaudio: osssink: Audio Sink (OSS)
    alsa: alsasink: Audio sink (ALSA)
    playback: playsink: Player Sink
    app: appsink: AppSink
    debugutilsbad: fpsdisplaysink: Measure and show framerate on videosink
    debugutilsbad: checksumsink: Checksum sink
    multifile: multifilesink: Multi-File Sink
    decklink: decklinksink: Decklink Sink
    pulseaudio: pulsesink: PulseAudio Audio Sink
    autodetect: autoaudiosink: Auto audio sink
    autodetect: autovideosink: Auto video sink
    kms: kmssink: Video sink
    debug: testsink: Test plugin
    shm: shmsink: Shared Memory Sink
    coreelements: filesink: File Sink
    coreelements: fdsink: Filedescriptor Sink
    coreelements: fakesink: Fake Sink
    gio: giostreamsink: GIO stream sink
    gio: giosink: GIO sink
    soup: souphttpclientsink: HTTP client sink
    waylandsink: waylandsink: wayland video sink
    root@am57xx-evm:~#
    =========================

    Seems "souphttpclientsink" is the only somewhat related element available.

    Would it be simple enough to add "rtspsink" element .. any ideas ?

    Regards,
    Snehal
  • Hello,

    Since I know there is a rtspsrc part of the good plugin but there is no rtspsink element.

    You could check this documentation:

    gstreamer.freedesktop.org/.../rtp.html

    You could check here:
    github.com/.../gst-rtsp-server

    I am not sure is this will work, you could try.
    Keep in mind that this is for release 1.8.

    Hope this helps.

    BR
    Margarita
  • Thanks. Appreciate prompt support.
    Looks promising. Will give it a try.


    Regards,
    Snehal
  • Was able to compile gst-rtsp-server-1.2.3.

    Used sample app from code.metager.de/.../test-launch.c
    However when we run the application we get a seg fault.
    Below was the command:
    test-launch v4l2src device=/dev/video1 num-buffers=1000 io-mode=4 ! 'video/x-raw, \
    format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! vpe num-input-buffers=8 ! tee name=t ! \
    queue ! ducatih264enc bitrate=4000 ! queue ! h264parse ! rtph264pay name=pay0 pt=96

    Note: We are sure that "launch line" is fine as we have tested launch line with gst-launch-1.0 and able to see stream on LCD
    gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=1000 io-mode=4 ! 'video/x-raw, \
    format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! vpe num-input-buffers=8 ! tee name=t ! \
    queue ! ducatih264enc bitrate=4000 ! queue ! h264parse ! qtmux ! filesink location=x.mp4 t. ! queue ! waylandsink

    Anybody tried rtsp streaming example on AM57xx EVM ?



    Below is just for info on issues faced with newer rtsp server configure/compile.
    Configure error with 1.4.0 : "configure: Requested 'gstreamer-1.0 >= 1.4.0' but version of GStreamer is 1.2.3"
    Below was the configure command
    ./configure --prefix=/home/test/AM57xx/MoreTools/Install_gst-rtsp-server/ --build=i686-linux --host=arm-linux --exec-prefix=/home/test/AM57xx/MoreTools/Install_gst-rtsp-server/ CC=arm-linux-gnueabihf-gcc AR=arm-linux-gnueabihf-ar STRIP=arm-linux-gnueabihf-strip RANLIB=arm-linux-gnueabihf-ranlib LD=arm-linux-gnueabihf-ld CXX=arm-linux-gnueabihf-g++ CPP=arm-linux-gnueabihf-cpp PKG_CONFIG_PATH=/home/test/AM57xx/tisdk/build/arago-tmp-external-linaro-toolchain/work/am57xx_evm-linux-gnueabi/tisdk-rootfs-image/1.0-r0/rootfs/usr/lib/pkgconfig CFLAGS="-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/home/test/AM57xx/tisdk/build/arago-tmp-external-linaro-toolchain/work/am57xx_evm-linux-gnueabi/tisdk-rootfs-image/1.0-r0/rootfs/usr/include/ -L/home/test/AM57xx/tisdk/build/arago-tmp-external-linaro-toolchain/work/am57xx_evm-linux-gnueabi/tisdk-rootfs-image/1.0-r0/rootfs/usr/lib -L/home/test/AM57xx/tisdk/build/arago-tmp-external-linaro-toolchain/work/am57xx_evm-linux-gnueabi/tisdk-rootfs-image/1.0-r0/rootfs -L/home/test/AM57xx/tisdk/build/arago-tmp-external-linaro-toolchain/work/am57xx_evm-linux-gnueabi/tisdk-rootfs-image/1.0-r0/rootfs/lib"
  • Streaming server application crashes with "gst_rtsp_media_create_stream: assertion 'GST_PAD_IS_SRC (pad)' failed" msg when we try to open the rtsp in a VLC client:

    Below is the command to run the application and then below it is the error that comes when we try to open the rtsp link in a VLC client:

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

    ./test-reuse " ( videotestsrc ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! vpe ! ducatih264enc bitrate=4000 ! h264parse ! rtph264pay name=pay0 pt=96 )"

    stream ready at rtsp://127.0.0.1:8554/test


    ** (test-reuse:1936): CRITICAL **: gst_rtsp_media_create_stream: assertion 'GST_PAD_IS_SRC (pad)' failed

    (test-reuse:1936): GStreamer-CRITICAL **:
    Trying to dispose element pay0, but it is in READY instead of the NULL state.
    You need to explicitly set elements to the NULL state before
    dropping the final reference, to allow them to clean up.
    This problem may also be caused by a refcounting bug in the
    application or some element.

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

    Any ideas what could be the issue ?

  • Hello,

    It seems that the error comes from gst_rtsp_media_create_stream function.
    You could try to check it.
    Do you observe it only when you open VLC?

    BR
    Margarita
  • Some debug information :

    Analysis done on AM57xx EVM board :

    GST_PAD_IS_SRC assertion from within gst_rtsp_media_create_stream() function of gst-rtsp-server-1.2.3 library is failing.

    We put a print of pad direction using GST_PAD_DIRECTION(pad) .. it came as 0 means GST_PAD_UNKNOWN as seen from below enum.

    typedef enum {
      GST_PAD_UNKNOWN,
      GST_PAD_SRC,
      GST_PAD_SINK
    } GstPadDirection;

    Command use to run rtsp streamer : ./test-launch "videotestsrc pattern=1 ! ducatih264enc ! rtph264pay name=pay0 pt=96"

    Below analysis done on linux PC:

    Now when we compile same gst-rtsp-server-1.2.3 for linux PC and run we saw the pad direction as 1 means GST_PAD_SRC.

    Command use to run rtsp streamer : ./test-launch "videotestsrc pattern=1 ! x264enc ! rtph264pay name=pay0 pt=96"

    Can you help figure why PAD direction is being determined as 0 on the EVM board ?

  • To answer the question "Do you observe it only when you open VLC?"
    The error comes when a rtsp client try to fetch stream from rtsp server.
    The error comes then we try to view the stream via VLC or try to catpure stream via gst (gst-launch-1.0 -e rtspsrc location=rtsp://10.103.2.242:8554/test ! decodebin ! x264enc ! mp4mux ! filesink location=file.mp4).
  • Hello,

    I am sorry I was out of office.

    GST RTP Server is not TI software.

    Do you see errors on the EVM?
    What you are executing on the EVM?


    BR
    Margarita

  • You can udpsink along with rtpsrc for your use-case. In the other side, you can udpsrc with rtp header strip option.
  • Just to close on this:
    Could not get gst-rtsp-server to work.
    Wrote a wrapper rtspserver gst plugin around a rtsp server library and was able to stream from camera and view on VLC.
    gst-launch-1.0 -e v4l2src device=/dev/video1 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, framerate=(fraction)30/1' ! vpe num-input-buffers=8 ! ducatih264enc bitrate=4000 ! eirtspserver ! fakesink
  • Hello,

    Thank you for sharing this information.
    I am closing this thread.

    BR
    Margarita