Working example of RTMP stream to Gstreamer RTSP server?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Working example of RTMP stream to Gstreamer RTSP server?

John Deutscher

Does anyone know of a working example of sourcing from an RTMP stream in the Gstreamer RTSP server pipeline?

I’ve tried various options for getting the RTMP source to work in the launch pipeline for the RTSP server

 

This pipeline appears to start in Gstreamer, but fails when used in the “test-launch” sample for the GStreamer RTSP server.

 

gst-launch-1.0 -v -m rtmpsrc location=rtmp://<<SOME RTMP STREAM SOURCE>>/live/test ! flvdemux name=demux demux.audio ! queue ! decodebin ! fakesink demux.video ! queue ! decodebin ! videoconvert ! video/x-raw, format=I420 ! x264enc speed-preset=superfast tune=zerolatency bitrate=500 key-int-max=60 ref=2 ! rtph264pay name=pay0


That generates a lot of output with no errors, so I move it to this, which when I connect to the “rtsp://127.0.0.1:8554/test” output sink in VLC it fails to playback the stream.

 

./test-launch "(rtmpsrc location=rtmp://<<SOME RTMP STREAM SOURCE>>/live/test ! flvdemux name=demux demux.audio ! queue ! decodebin ! fakesink demux.video ! queue ! decodebin ! videoconvert ! video/x-raw, format=I420 ! x264enc speed-preset=superfast tune=zerolatency bitrate=500 key-int-max=60 ref=2 ! rtph264pay name=pay0)"

 

Anyone have a working “rtmpsrc” pipeline that they could share?  In addition, I’m looking for a working SRT ingest example as well if you have one of those handy.

 

Thanks

John Deutscher

 


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Working example of RTMP stream to Gstreamer RTSP server?

Tim Müller
On Mon, 2020-07-27 at 23:30 +0000, John Deutscher wrote:

Hi John,

Bit difficult to know what's going on without having the input stream
to test with at hand, so just a couple of questions / comments /
suggestions:

- Did you try playing back the stream with GStreamer (e.g. gst-play-
1.0) instead of VLC?

- Have you tried the test-uri example for comparison? You should be
able to pass it the rtmp:// URI directly, and it should relay the data
without transcoding.

- Does the rtmp input stream play with gst-play-1.0 rtmp://.. (quick
sanity check)

- Instead of using flvdemux and two decodebins you should be able to
use a single decodebin which will give you a decoded audio + video
stream (hopefully); or uridecodebin which includes the rtmpsrc as well
then. Or even the (uri)decodebin3 variants.

- How does VLC "fail"? Any errors? Does it show a window in the right
size but without the video?

- If you don't want the audio, you *should* be able to just not link
the audio pad - that *should* work fine as long as the video pad is
linked. (Though I'm only 90% sure that flvdemux will handle this right,
I have a vague memory of a bug about that at some point).

- That fakesink in your rtsp server pipeline could mess up some things
a little, maybe setting it to async=false helps (if just dropping the
audio branch is not possible)

Cheers
 Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

RE: [EXTERNAL] Re: Working example of RTMP stream to Gstreamer RTSP server?

John Deutscher
Thanks Tim,

I tried the gst-play-1.0, but unfortunately I am running this on a container in a cloud instance and would need to setup a linux box to test that out with.

I did check the test-uri example and got the following output. Looks like it "failed reading a tag" as a warning, and then "removed the /test mount point" immediately after that.  The stream is not live any longer for testing, but I can turn it on again.  Stream path is just OBS Studio-> ngnix RTMP server module -> test-uri right now...


./test-uri rtmp://johndeu-gstreamer.westus.azurecontainer.io/live/test
stream ready at rtsp://127.0.0.1:8554/test
0:00:09.452060177   610 0x7fbfd401ed90 WARN                flvdemux gstflvdemux.c:659:gst_flv_demux_parse_tag_script:<flvdemux0> failed reading a tag, skipping
removing /test mount point
0:00:10.230779826   610 0x5563212ea190 ERROR             rtspclient rtsp-client.c:565:find_media: client 0x556321127580: no factory for path /test/stream=0
0:00:10.230940728   610 0x5563212ea190 ERROR             rtspclient rtsp-client.c:1592:handle_setup_request: client 0x556321127580: media '/test/stream=0' not found
0:00:10.255076503   610 0x5563212ea190 ERROR             rtspclient rtsp-client.c:565:find_media: client 0x556321127580: no factory for path /test/stream=1
0:00:10.255181503   610 0x5563212ea190 ERROR             rtspclient rtsp-client.c:1592:handle_setup_request: client 0x556321127580: media '/test/stream=1' not found
0:00:10.311535712   610 0x5563212ea190 ERROR             rtspclient rtsp-client.c:565:find_media: client 0x7fbfd8061f70: no factory for path /test
0:00:10.311642713   610 0x5563212ea190 ERROR             rtspclient rtsp-client.c:1592:handle_setup_request: client 0x7fbfd8061f70: media '/test' not found

-----Original Message-----
From: Tim Müller <[hidden email]>
Sent: Wednesday, July 29, 2020 5:02 PM
To: [hidden email]
Subject: [EXTERNAL] Re: Working example of RTMP stream to Gstreamer RTSP server?

On Mon, 2020-07-27 at 23:30 +0000, John Deutscher wrote:

Hi John,

Bit difficult to know what's going on without having the input stream to test with at hand, so just a couple of questions / comments /
suggestions:

- Did you try playing back the stream with GStreamer (e.g. gst-play-
1.0) instead of VLC?

- Have you tried the test-uri example for comparison? You should be able to pass it the rtmp:// URI directly, and it should relay the data without transcoding.

- Does the rtmp input stream play with gst-play-1.0 rtmp://.. (quick sanity check)

- Instead of using flvdemux and two decodebins you should be able to use a single decodebin which will give you a decoded audio + video stream (hopefully); or uridecodebin which includes the rtmpsrc as well then. Or even the (uri)decodebin3 variants.

- How does VLC "fail"? Any errors? Does it show a window in the right size but without the video?

- If you don't want the audio, you *should* be able to just not link the audio pad - that *should* work fine as long as the video pad is linked. (Though I'm only 90% sure that flvdemux will handle this right, I have a vague memory of a bug about that at some point).

- That fakesink in your rtsp server pipeline could mess up some things a little, maybe setting it to async=false helps (if just dropping the audio branch is not possible)

Cheers
 Tim

--
Tim Müller, Centricular Ltd - https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.centricular.com%2F&amp;data=02%7C01%7CJohn.Deutscher%40microsoft.com%7Ce53cb0b136d149e6df5c08d8341bd86e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637316641483449525&amp;sdata=7VQZWEgaZ3620Qt5%2BrtCQHvYQBbcHy0Hv5eAFEnIFoc%3D&amp;reserved=0

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

RE: [EXTERNAL] Re: Working example of RTMP stream to Gstreamer RTSP server?

evaluat0r
John Deutscher wrote

> Thanks Tim,
>
> I tried the gst-play-1.0, but unfortunately I am running this on a
> container in a cloud instance and would need to setup a linux box to test
> that out with.
>
> I did check the test-uri example and got the following output. Looks like
> it "failed reading a tag" as a warning, and then "removed the /test mount
> point" immediately after that.  The stream is not live any longer for
> testing, but I can turn it on again.  Stream path is just OBS Studio->
> ngnix RTMP server module -> test-uri right now...
>
>
> ./test-uri rtmp://johndeu-gstreamer.westus.azurecontainer.io/live/test
> stream ready at rtsp://127.0.0.1:8554/test
> 0:00:09.452060177   610 0x7fbfd401ed90 WARN                flvdemux
> gstflvdemux.c:659:gst_flv_demux_parse_tag_script:
> <flvdemux0>
>  failed reading a tag, skipping
> removing /test mount point
> 0:00:10.230779826   610 0x5563212ea190 ERROR             rtspclient
> rtsp-client.c:565:find_media: client 0x556321127580: no factory for path
> /test/stream=0
> 0:00:10.230940728   610 0x5563212ea190 ERROR             rtspclient
> rtsp-client.c:1592:handle_setup_request: client 0x556321127580: media
> '/test/stream=0' not found
> 0:00:10.255076503   610 0x5563212ea190 ERROR             rtspclient
> rtsp-client.c:565:find_media: client 0x556321127580: no factory for path
> /test/stream=1
> 0:00:10.255181503   610 0x5563212ea190 ERROR             rtspclient
> rtsp-client.c:1592:handle_setup_request: client 0x556321127580: media
> '/test/stream=1' not found
> 0:00:10.311535712   610 0x5563212ea190 ERROR             rtspclient
> rtsp-client.c:565:find_media: client 0x7fbfd8061f70: no factory for path
> /test
> 0:00:10.311642713   610 0x5563212ea190 ERROR             rtspclient
> rtsp-client.c:1592:handle_setup_request: client 0x7fbfd8061f70: media
> '/test' not found
>
> -----Original Message-----
> From: Tim Müller &lt;

> tim@

> &gt;
> Sent: Wednesday, July 29, 2020 5:02 PM
> To:

> gstreamer-devel@.freedesktop

> Subject: [EXTERNAL] Re: Working example of RTMP stream to Gstreamer RTSP
> server?
>
> On Mon, 2020-07-27 at 23:30 +0000, John Deutscher wrote:
>
> Hi John,
>
> Bit difficult to know what's going on without having the input stream to
> test with at hand, so just a couple of questions / comments /
> suggestions:
>
> - Did you try playing back the stream with GStreamer (e.g. gst-play-
> 1.0) instead of VLC?
>
> - Have you tried the test-uri example for comparison? You should be able
> to pass it the rtmp:// URI directly, and it should relay the data without
> transcoding.
>
> - Does the rtmp input stream play with gst-play-1.0 rtmp://.. (quick
> sanity check)
>
> - Instead of using flvdemux and two decodebins you should be able to use a
> single decodebin which will give you a decoded audio + video stream
> (hopefully); or uridecodebin which includes the rtmpsrc as well then. Or
> even the (uri)decodebin3 variants.
>
> - How does VLC "fail"? Any errors? Does it show a window in the right size
> but without the video?
>
> - If you don't want the audio, you *should* be able to just not link the
> audio pad - that *should* work fine as long as the video pad is linked.
> (Though I'm only 90% sure that flvdemux will handle this right, I have a
> vague memory of a bug about that at some point).
>
> - That fakesink in your rtsp server pipeline could mess up some things a
> little, maybe setting it to async=false helps (if just dropping the audio
> branch is not possible)
>
> Cheers
>  Tim
>
> --
> Tim Müller, Centricular Ltd -
> https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.centricular.com%2F&amp;data=02%7C01%7CJohn.Deutscher%40microsoft.com%7Ce53cb0b136d149e6df5c08d8341bd86e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637316641483449525&amp;sdata=7VQZWEgaZ3620Qt5%2BrtCQHvYQBbcHy0Hv5eAFEnIFoc%3D&amp;reserved=0
>
> _______________________________________________
> gstreamer-devel mailing list

> gstreamer-devel@.freedesktop

> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

You should bump up your logging so you can see if a failure happens
somewhere else. Run your command with GST_DEBUG="*rtsp*:4,*rtmp*:4"
./the_command

Increasing logging on relevant elements to verify everything is working as
expected (ingest rtmp, demux to get video and audio, repackage video and
audio in rtp to be sent out on behalf of rtsp)



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel