rtspsrc with protocols="tcp"

1,332 views
Skip to first unread message

lionel mazeyrat

unread,
Jul 12, 2021, 5:11:53 AM7/12/21
to gstreamer-java
When I execute :
gst-launch-1.0 rtspsrc location=rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov protocols="tcp" latency=0 ! rtph264depay ! decodebin ! videoconvert ! autovideosink

it's ok

I try with gstreamer java,

GstVideoComponent vc = new GstVideoComponent();

bin = Gst.parseBinFromDescription( "rtspsrc location=rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov protocols=\"tcp\" ! rtph264depay ! decodebin ! videoconvert",true);

pipeline = new Pipeline();
pipeline.addMany(bin, vc.getElement());
Pipeline.linkMany(bin, vc.getElement());

I get :

pipeline state : READY state1 : PAUSED state2 : VOID_PENDING
pipeline state : READY state1 : PAUSED state2 : VOID_PENDING
pipeline ERROR : Internal data stream error.

Any idea ?

Neil C Smith

unread,
Jul 12, 2021, 5:42:15 AM7/12/21
to gstream...@googlegroups.com
On Mon, 12 Jul 2021 at 10:11, lionel mazeyrat <lionel....@gmail.com> wrote:
> bin = Gst.parseBinFromDescription( "rtspsrc location=rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov protocols=\"tcp\" ! rtph264depay ! decodebin ! videoconvert",true);
>
> pipeline = new Pipeline();
> pipeline.addMany(bin, vc.getElement());
> Pipeline.linkMany(bin, vc.getElement());
>
> I get :
>
> pipeline state : READY state1 : PAUSED state2 : VOID_PENDING
> pipeline state : READY state1 : PAUSED state2 : VOID_PENDING
> pipeline ERROR : Internal data stream error.
>
> Any idea ?

Yes, you're not testing like with like! Although I'm surprised you
see internal data stream error rather than a no more pads error.

Your command line test has all elements in the top level pipeline.
Here you're using a Bin subcontainer. You can only do this if you
don't automatically create ghost pads, otherwise the videoconvert will
be connected to the outer bin before it can be connected to the
decodebin.

You have two choices -

Top level pipeline

pipeline = (Pipeline) Gst.parseLaunch("rtspsrc
location=rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov
protocols=tcp ! decodebin name=decodebin ! videoconvert ! appsink
name=appsink");
vc = new GstVideoComponent((AppSink) pipeline.getElementByName("appsink"));

With bin and manual ghost pads

Bin bin = Gst.parseBinFromDescription("rtspsrc
location=rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov
protocols=tcp ! decodebin ! videoconvert name=videoconvert", false);
vc = new GstVideoComponent();
Pad src = bin.getElementByName("videoconvert").getStaticPad("src");
bin.addPad(new GhostPad("src", src));
pipeline = new Pipeline();
pipeline.addMany(bin, vc.getElement());
Pipeline.linkMany(bin, vc.getElement());


Best wishes,

Neil

--
Neil C Smith
Codelerity Ltd.
www.codelerity.com

Codelerity Ltd. is a company registered in England and Wales
Registered company number : 12063669
Registered office address : Office 4 219 Kensington High Street,
Kensington, London, England, W8 6BD

lionel mazeyrat

unread,
Jul 12, 2021, 5:38:24 PM7/12/21
to gstream...@googlegroups.com
thanks a lot !
it works like a charm with:
pipeline = (Pipeline) Gst.parseLaunch("rtspsrc location=rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov protocols=tcp ! decodebin name=decodebin ! videoconvert ! appsink name=appsink");
GstVideoComponent vc = new GstVideoComponent((AppSink) pipeline.getElementByName("appsink"));
Just another question...
When I pause (pipeline.pause()) and restart (pipeline.play()) it's ok,
But if I stop with pipeline.stop, I can't restart with pipeline.play().
pipeline STATE_CHANGED : NULL state1 : READY state2 : PLAYING
pipeline STATE_CHANGED : READY state1 : PAUSED state2 : PLAYING
pipeline STATE_CHANGED : PAUSED state1 : PLAYING state2 : VOID_PENDING

pipeline ERROR : Internal data stream error.
My aim is to manage network outage and rtsp auto reconnect. Do I need to recreate a new pipeline ?



--
You received this message because you are subscribed to the Google Groups "gstreamer-java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gstreamer-jav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gstreamer-java/CAPxOS5HbU%2BJ_4KtOpER1-d2aTJf_HmMcZ2qqyUcJpfjKmOCQ8Q%40mail.gmail.com.

Neil C Smith

unread,
Jul 13, 2021, 4:30:39 AM7/13/21
to gstream...@googlegroups.com
On Mon, 12 Jul 2021 at 22:38, lionel mazeyrat <lionel....@gmail.com> wrote:
> When I pause (pipeline.pause()) and restart (pipeline.play()) it's ok,
>
> But if I stop with pipeline.stop, I can't restart with pipeline.play().
...
> My aim is to manage network outage and rtsp auto reconnect. Do I need to recreate a new pipeline ?

I think this is expected if you use the parse launch description.
It's similar to the problem you had earlier with the elements like
decodebin inside a Bin. They create pads dynamically, and can only be
connected when the pads have been created on play. If I remember
correctly, the parse launch behaviour only automatically handles this
connection once. You would have to programmatically create the
elements, and add a listener for the added pads and handle the
connections in your own code.

From what I've seen of what you're doing so far, you're probably
better just using a PlayBin for this, and let it handle the setup for
you. You can use listeners (eg. source setup) to configure the
playbin's elements if you have particular additional requirements.

lionel mazeyrat

unread,
Jul 14, 2021, 12:55:55 PM7/14/21
to gstreamer-java
Hi,

Thanks a lot for pointing me in the right direction.
I initially use playbin, but I wanted to custom a bit rtsp.
With source setup listener, it's perfect.

Regards,
Lionel MAZEYRAT

Reply all
Reply to author
Forward
0 new messages