How to restart a pipeline after network connection loss?

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

How to restart a pipeline after network connection loss?

Jorne De Smedt | IndigoCare

Hello,

 

I’ve been trying to get an rtsp stream working on Android, based on the tutorials.

Now, the basic stream itself works, but whenever the stream is lost (due to network issues or other reasons), the stream just pauses and I can’t seem to figure out how to restart it without restarting the app. (Sometimes it also shows a “no signal” screen, but I’m unsure if this is part of gstreamer or the source.)
There’s also a light issue that whenever the stream is just a slideshow of static images, it gets stuck on the first frame (unless you put an animation in there somewhere, like a single animated slide or animated pixel). I’m unsure if this is related to the previous issue


The goal is to have the app display the stream 24/7, so it should try to reconnect until it finds the stream again.

 

I’m currently using the following pipeline:

"rtspsrc name=source location=rtsp://192.168.30.4:554/0 ! rtph264depay ! h264parse ! decodebin name=convert ! glimagesink"

 

Which seems to do the same as the previous one I used:

"uridecodebin name=source ! videoconvert name=convert ! glimagesink"

 

What is the right way to restart a pipeline like this?

Do I need to use a dynamic pipeline instead of one like this?


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

Re: How to restart a pipeline after network connection loss?

Daniel Rossi
I'm looking into this project to start and monitor for 24/7 receiver purposes. In my case SRT. I have to use sources for SRT functionality and having difficulty getting it installed right now and finding the prefix path. It might be suitable ? I've yet to test it. 

https://github.com/RidgeRun/gstd-1.x

------ Original Message ------
From: "Jorne De Smedt | IndigoCare" <[hidden email]>
Sent: 8/6/2019 6:17:22 PM
Subject: How to restart a pipeline after network connection loss?

Hello,

 

I’ve been trying to get an rtsp stream working on Android, based on the tutorials.

Now, the basic stream itself works, but whenever the stream is lost (due to network issues or other reasons), the stream just pauses and I can’t seem to figure out how to restart it without restarting the app. (Sometimes it also shows a “no signal” screen, but I’m unsure if this is part of gstreamer or the source.)
There’s also a light issue that whenever the stream is just a slideshow of static images, it gets stuck on the first frame (unless you put an animation in there somewhere, like a single animated slide or animated pixel). I’m unsure if this is related to the previous issue


The goal is to have the app display the stream 24/7, so it should try to reconnect until it finds the stream again.

 

I’m currently using the following pipeline:

"rtspsrc name=source location=rtsp://192.168.30.4:554/0 ! rtph264depay ! h264parse ! decodebin name=convert ! glimagesink"

 

Which seems to do the same as the previous one I used:

"uridecodebin name=source ! videoconvert name=convert ! glimagesink"

 

What is the right way to restart a pipeline like this?

Do I need to use a dynamic pipeline instead of one like this?


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

Re: How to restart a pipeline after network connection loss?

Nicolas Dufresne-5
In reply to this post by Jorne De Smedt | IndigoCare
Le mardi 06 août 2019 à 08:17 +0000, Jorne De Smedt | IndigoCare a
écrit :

> Hello,
>  
> I’ve been trying to get an rtsp stream working on Android, based on the tutorials.
> Now, the basic stream itself works, but whenever the stream is lost (due to network issues or other reasons), the stream just pauses and I can’t seem to figure out how to restart it without restarting the app. (Sometimes it also shows a “no signal” screen, but I’m unsure if this is part of gstreamer or the source.)
> There’s also a light issue that whenever the stream is just a slideshow of static images, it gets stuck on the first frame (unless you put an animation in there somewhere, like a single animated slide or animated pixel). I’m unsure if this is related to the previous issue
>
> The goal is to have the app display the stream 24/7, so it should try to reconnect until it finds the stream again.
>  
> I’m currently using the following pipeline:
> "rtspsrc name=source location=rtsp://192.168.30.4:554/0 ! rtph264depay ! h264parse ! decodebin name=convert ! glimagesink"
>  
> Which seems to do the same as the previous one I used:
> "uridecodebin name=source ! videoconvert name=convert ! glimagesink"
>  
> What is the right way to restart a pipeline like this?
> Do I need to use a dynamic pipeline instead of one like this?

Can't you just cycle the element through NULL/PLAYING, giving it a
grace delay to avoid spinning ?

> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

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

Re: How to restart a pipeline after network connection loss?

Michael Gruner
In reply to this post by Daniel Rossi
Hi Daniel

Full disclosure first: I’m one of gstd developers. 

The way I see it is that there are some use cases where Gstreamer Daemon may save you a lot of development time, and there are other applications where you are way better off with plain GStreamer API.

Gstd abstracts a lot of boilerplate low-level code, exposing instead a set of simpler high-level TCP commands. The tradeoff is, of course, that you give up a lot of flexibility. If your pipelines are fixed (do not grow or shrink) in their lifetime Gstd may help you. On the other hand, if you have a dynamic pipeline, with more sophisticated stream handling, Gstd definitely falls short.

We like to think of Gstd as a gst-launch-1.0 under steroids. Besides creating and playing pipelines, you can query/set properties at runtime, check for bus messages, listen to element signals (limited though), etc…  Again, I’d like to insist in that it’s not suitable for all applications. Internally, we handle both approaches: for simpler, static media servers we use gstd, for complex highly dynamic media servers we use GStreamer API instead. Another big use we give to Gstd is to automate testing. Since it is controlled via TCP commands, the test can be controlled from a host PC while everything is running on an embedded platform, for example...

Long story short, my rule of thumb is:
Whatever pipeline that can be built and played using gst-launch-1.0 can be properly handled by Gstreamer Daemon.

Michael


On Aug 6, 2019, at 8:30 AM, Daniel Rossi <[hidden email]> wrote:

I'm looking into this project to start and monitor for 24/7 receiver purposes. In my case SRT. I have to use sources for SRT functionality and having difficulty getting it installed right now and finding the prefix path. It might be suitable ? I've yet to test it. 

https://github.com/RidgeRun/gstd-1.x

------ Original Message ------
From: "Jorne De Smedt | IndigoCare" <[hidden email]>
Sent: 8/6/2019 6:17:22 PM
Subject: How to restart a pipeline after network connection loss?

Hello,
 
I’ve been trying to get an rtsp stream working on Android, based on the tutorials.
Now, the basic stream itself works, but whenever the stream is lost (due to network issues or other reasons), the stream just pauses and I can’t seem to figure out how to restart it without restarting the app. (Sometimes it also shows a “no signal” screen, but I’m unsure if this is part of gstreamer or the source.)
There’s also a light issue that whenever the stream is just a slideshow of static images, it gets stuck on the first frame (unless you put an animation in there somewhere, like a single animated slide or animated pixel). I’m unsure if this is related to the previous issue

The goal is to have the app display the stream 24/7, so it should try to reconnect until it finds the stream again.
 
I’m currently using the following pipeline:
"rtspsrc name=source location=<a href="rtsp://192.168.30.4:554/0" class="">rtsp://192.168.30.4:554/0 ! rtph264depay ! h264parse ! decodebin name=convert ! glimagesink"
 
Which seems to do the same as the previous one I used:
"uridecodebin name=source ! videoconvert name=convert ! glimagesink"
 
What is the right way to restart a pipeline like this?
Do I need to use a dynamic pipeline instead of one like this?
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


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

RE: How to restart a pipeline after network connection loss?

Jorne De Smedt | IndigoCare
In reply to this post by Nicolas Dufresne-5
I've been trying this, but after setting the pipeline to NULL, it'll go to ready and paused, but it won't go to playing after that.

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

Le mardi 06 août 2019 à 08:17 +0000, Jorne De Smedt | IndigoCare a écrit :

> Hello,
>  
> I’ve been trying to get an rtsp stream working on Android, based on the tutorials.
> Now, the basic stream itself works, but whenever the stream is lost
> (due to network issues or other reasons), the stream just pauses and I
> can’t seem to figure out how to restart it without restarting the app.
> (Sometimes it also shows a “no signal” screen, but I’m unsure if this
> is part of gstreamer or the source.) There’s also a light issue that
> whenever the stream is just a slideshow of static images, it gets
> stuck on the first frame (unless you put an animation in there
> somewhere, like a single animated slide or animated pixel). I’m unsure
> if this is related to the previous issue
>
> The goal is to have the app display the stream 24/7, so it should try to reconnect until it finds the stream again.
>  
> I’m currently using the following pipeline:
> "rtspsrc name=source location=rtsp://192.168.30.4:554/0 ! rtph264depay ! h264parse ! decodebin name=convert ! glimagesink"
>  
> Which seems to do the same as the previous one I used:
> "uridecodebin name=source ! videoconvert name=convert ! glimagesink"
>  
> What is the right way to restart a pipeline like this?
> Do I need to use a dynamic pipeline instead of one like this?

Can't you just cycle the element through NULL/PLAYING, giving it a grace delay to avoid spinning ?

> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

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

RE: How to restart a pipeline after network connection loss?

virtually_me
I have an application where the IP for an RTP source can be down or go down. I am also using the command line (testing) version of gstreamer. I wrote a small script to ping the IP address every few seconds. If the ping reaches the machine the return code is zero and I start up the pipeline if it not already running. Otherwise I kill gst-launch-1.0. When the IP is up again I re-launch the pipeline.

-----Original Message-----
From: gstreamer-devel <[hidden email]> On Behalf Of Jorne De Smedt | IndigoCare
Sent: Thursday, August 22, 2019 6:07 AM
To: Discussion of the development of and with GStreamer <[hidden email]>
Subject: RE: How to restart a pipeline after network connection loss?

I've been trying this, but after setting the pipeline to NULL, it'll go to ready and paused, but it won't go to playing after that.

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

Le mardi 06 août 2019 à 08:17 +0000, Jorne De Smedt | IndigoCare a écrit :

> Hello,
>  
> I’ve been trying to get an rtsp stream working on Android, based on the tutorials.
> Now, the basic stream itself works, but whenever the stream is lost
> (due to network issues or other reasons), the stream just pauses and I
> can’t seem to figure out how to restart it without restarting the app.
> (Sometimes it also shows a “no signal” screen, but I’m unsure if this
> is part of gstreamer or the source.) There’s also a light issue that
> whenever the stream is just a slideshow of static images, it gets
> stuck on the first frame (unless you put an animation in there
> somewhere, like a single animated slide or animated pixel). I’m unsure
> if this is related to the previous issue
>
> The goal is to have the app display the stream 24/7, so it should try to reconnect until it finds the stream again.
>  
> I’m currently using the following pipeline:
> "rtspsrc name=source location=rtsp://192.168.30.4:554/0 ! rtph264depay ! h264parse ! decodebin name=convert ! glimagesink"
>  
> Which seems to do the same as the previous one I used:
> "uridecodebin name=source ! videoconvert name=convert ! glimagesink"
>  
> What is the right way to restart a pipeline like this?
> Do I need to use a dynamic pipeline instead of one like this?

Can't you just cycle the element through NULL/PLAYING, giving it a grace delay to avoid spinning ?

> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

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

Re[2]: How to restart a pipeline after network connection loss?

Daniel Rossi
After a bit of thought, trialing bus read with gstd. I am going to have
a look at python bindings and reading the bus messages, but it might
have to sit there in a loop after starting the pipeline waiting for EOS.
With SRT it will produce an EOS message. Which can be used to restart
the pipeline. Polling with a ping test could also be used I suppose.
Maybe on an EOS message.

------ Original Message ------
From: [hidden email]
To: "Discussion of the development of and with GStreamer"
<[hidden email]>
Sent: 8/22/2019 9:50:38 PM
Subject: RE: How to restart a pipeline after network connection loss?

>I have an application where the IP for an RTP source can be down or go down. I am also using the command line (testing) version of gstreamer. I wrote a small script to ping the IP address every few seconds. If the ping reaches the machine the return code is zero and I start up the pipeline if it not already running. Otherwise I kill gst-launch-1.0. When the IP is up again I re-launch the pipeline.
>
>-----Original Message-----
>From: gstreamer-devel <[hidden email]> On Behalf Of Jorne De Smedt | IndigoCare
>Sent: Thursday, August 22, 2019 6:07 AM
>To: Discussion of the development of and with GStreamer <[hidden email]>
>Subject: RE: How to restart a pipeline after network connection loss?
>
>I've been trying this, but after setting the pipeline to NULL, it'll go to ready and paused, but it won't go to playing after that.
>
>-------------------------------------
>
>Le mardi 06 août 2019 à 08:17 +0000, Jorne De Smedt | IndigoCare a écrit :
>>  Hello,
>>
>>  I’ve been trying to get an rtsp stream working on Android, based on the tutorials.
>>  Now, the basic stream itself works, but whenever the stream is lost
>>  (due to network issues or other reasons), the stream just pauses and I
>>  can’t seem to figure out how to restart it without restarting the app.
>>  (Sometimes it also shows a “no signal” screen, but I’m unsure if this
>>  is part of gstreamer or the source.) There’s also a light issue that
>>  whenever the stream is just a slideshow of static images, it gets
>>  stuck on the first frame (unless you put an animation in there
>>  somewhere, like a single animated slide or animated pixel). I’m unsure
>>  if this is related to the previous issue
>>
>>  The goal is to have the app display the stream 24/7, so it should try to reconnect until it finds the stream again.
>>
>>  I’m currently using the following pipeline:
>>  "rtspsrc name=source location=rtsp://192.168.30.4:554/0 ! rtph264depay ! h264parse ! decodebin name=convert ! glimagesink"
>>
>>  Which seems to do the same as the previous one I used:
>>  "uridecodebin name=source ! videoconvert name=convert ! glimagesink"
>>
>>  What is the right way to restart a pipeline like this?
>>  Do I need to use a dynamic pipeline instead of one like this?
>
>Can't you just cycle the element through NULL/PLAYING, giving it a grace delay to avoid spinning ?
>
>>  _______________________________________________
>>  gstreamer-devel mailing list
>>  [hidden email]
>>  https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>_______________________________________________
>gstreamer-devel mailing list
>[hidden email]
>https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>_______________________________________________
>gstreamer-devel mailing list
>[hidden email]
>https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>_______________________________________________
>gstreamer-devel mailing list
>[hidden email]
>https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel