Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't pick UDP stream from gstreamer #6307

Open
pkirk opened this issue Apr 30, 2024 · 4 comments
Open

Can't pick UDP stream from gstreamer #6307

pkirk opened this issue Apr 30, 2024 · 4 comments
Labels

Comments

@pkirk
Copy link

pkirk commented Apr 30, 2024

Short description

Dear Ant Media People,
I've got a stream from an IoT webcam that use GStreamer like that
$ gst-launch-1.0 rtspsrc location=rtsp://127.0.0.1:8554/stream latency=0 name=rtsplivesrc rtsplivesrc. ! queue ! capsfilter caps="application/x-rtp,media=video" ! udpsink host=1.2.3.4 auto-multicast=true port=55000
and I cannot change that invocation.
On my Ant Media Enterprise I've created my Live Stream with Stream URL
"udp://127.0.0.1:55000".
I've checked with tcpdump and there is a flow of data coming, but Ant Media doesn't pick it up.

Environment

  • Operating system and version: Ubuntu 22.04.4 LTS
  • Java version: openjdk 11.0.22 2024-01-16
  • Ant Media Server version: Enterprise Edition 2.7.0 20231031_0626
  • Browser name and version: It's not a browser problem

Steps to reproduce

  1. Stream with GStreamer to udp://IP_ANT_MEDIA:55000
  2. Create a new Live Stream with Live Source with source udp://127.0.0.1:55000
  3. No stream is detected

Expected behavior

Ant Media Server should pick the stream and show it streaming

Actual behavior

Ant Media Server doesn't show anything on the logs, while on the tcpdump I get a stream of

11:41:50.824346 IP (tos 0x28, ttl 51, id 312, offset 0, flags [DF], proto UDP (17), length 1428)
    IP_GSTREAMER_DEVICE.62393 > IP_ANT_MEDIA.55000: [udp sum ok] UDP, length 1400

Logs

Nothing shows up.

@mekya mekya added the support label May 6, 2024
@mekya
Copy link
Contributor

mekya commented May 6, 2024

Hi @pkirk,

Thank you for reporting the bug.

I've put it to the backlog and we need to verify the issue. I cannot give a clear ETA for now.

If you want to speed up the process, please reach out to contact@antmedia.io with your enterprise license and/or support package.

Cheers
Oguz

@yashtandon113
Copy link
Contributor

Hi @pkirk
As we discussed in the support ticket, I launched the Ubuntu 16.04 server on my end and tested the stream via UDP, which works for me with the pipeline below; could you please test it as well?

gst-launch-1.0 rtspsrc location=rtsp://127.0.0.1:6554/test.flv latency=0 ! decodebin ! x264enc key-int-max=2 tune=zerolatency ! h264parse ! mpegtsmux ! udpsink host=1.2.3.4 port=55000

If it still does not work for you, could you please share the output of the below command to analyze the streaming parameters of your source stream?

ffprobe -i "rtsp://127.0.0.1:8554/stream"

@pkirk
Copy link
Author

pkirk commented May 14, 2024

@yashtandon113 writing also here for the remote eventuality that someone else could need it:

  • gst-launch didn't work on that limited device ("WARNING: erroneous pipeline: no element "x264enc"")
  • ffprobe was not installed and I couldn't find on the Internet an armv7l .deb to manually install it on that Ubuntu 16
  • I opened the firewall ( iptables -A INPUT -i wlan0 -p tcp --dport 8554 -j ACCEPT )
  • I used ffprobe from another machine in the LAN and it gives me the following

paolo@DESKTOP:$ ffprobe -i "rtsp://192.168.1.123:8554/stream"
ffprobe version 4.2.7-0ubuntu0.1 Copyright (c) 2007-2022 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
[rtsp @ 0x55da14f72a00] UDP timeout, retrying with TCP
[rtsp @ 0x55da14f72a00] method SETUP failed: 503 Service Unavailable
[rtsp @ 0x55da14f72a00] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, rtsp, from 'rtsp://192.168.1.123:8554/stream':
Metadata:
title : Session streamed with GStreamer
comment : rtsp-server
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264, none, 90k tbr, 90k tbn, 180k tbc
Stream #0:1: Audio: opus, 48000 Hz, stereo, fltp

@yashtandon113
Copy link
Contributor

@pkirk
As discussed over the ticket.

After getting the credentials from your side, I fixed the parameter-related pipeline issue on your end after installing some packages, etc.

Finally, the below pipeline works for me to get a source from your end and send it to the server with UDP.

gst-launch-1.0 rtspsrc location=rtsp://127.0.0.1:8554/stream latency=0 ! decodebin ! videoconvert ! x264enc tune=zerolatency ! h264parse ! mpegtsmux ! udpsink host=1.2.3.4 port=55000

However, the video is not smoother and there are lot of frame drops, which needs to be investigated further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Next Sprint
Development

No branches or pull requests

3 participants