Any way to detect loss of rtsp stream in ffplay?

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

Any way to detect loss of rtsp stream in ffplay?

discarn8-2
I'm using multiple instances of ffplay, on a linux distro, to play multiple
rtsp streams from multiple security cameras.  However, due to the crowded
wifi environment I'm in and the 2.4ghz limitations of the cameras, I
occasionally drop / lose connection to one or more cameras, and thus lose
the rtsp stream.  Other than watching for motion or staring at the time
display in the stream, to see if it's still "ticking", I have no way to know
if the stream is active or not.  Barring switching to a UDP rtsp stream
(which provides for horrible video quality), is there a known, existing
error message or process flag that I can filter on, to be made aware of the
stream loss?  I've seemingly tried every warning level, but I don't see a
message alerting me to the stream drop.  ffplay just keeps on ticking.

Currently, I am stuck with scripting a shutdown and restart of ffplay every
1/2 hour, for the most common "offenders", but I'm thinking that someone
else must have crossed this bridge before, and resolved the issue.  

Anyone?



--
Sent from: http://www.ffmpeg-archive.org/
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Any way to detect loss of rtsp stream in ffplay?

Zoltan Kerenyi Nagy
I would pull 1 jpg from the stream, on failure, it changes state and does
something. on success drop jpeg and do nothing.

On 2019. Jan 30., Wed at 18:30, discarn8 <[hidden email]>
wrote:

> I'm using multiple instances of ffplay, on a linux distro, to play multiple
> rtsp streams from multiple security cameras.  However, due to the crowded
> wifi environment I'm in and the 2.4ghz limitations of the cameras, I
> occasionally drop / lose connection to one or more cameras, and thus lose
> the rtsp stream.  Other than watching for motion or staring at the time
> display in the stream, to see if it's still "ticking", I have no way to
> know
> if the stream is active or not.  Barring switching to a UDP rtsp stream
> (which provides for horrible video quality), is there a known, existing
> error message or process flag that I can filter on, to be made aware of the
> stream loss?  I've seemingly tried every warning level, but I don't see a
> message alerting me to the stream drop.  ffplay just keeps on ticking.
>
> Currently, I am stuck with scripting a shutdown and restart of ffplay every
> 1/2 hour, for the most common "offenders", but I'm thinking that someone
> else must have crossed this bridge before, and resolved the issue.
>
> Anyone?
>
>
>
> --
> Sent from: http://www.ffmpeg-archive.org/
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Any way to detect loss of rtsp stream in ffplay?

discarn8-2
Thanks, Zoltan. I had not thought of that. I'll test it tonight and report
back.  Thanks very much.



--
Sent from: http://www.ffmpeg-archive.org/
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Any way to detect loss of rtsp stream in ffplay?

Zoltan Kerenyi Nagy
I did this and it works:

ffmpeg -i rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov
-y -f image2 -qscale 0 -frames 1 test.jpg

On Wed, 30 Jan 2019 at 19:34, discarn8 <[hidden email]>
wrote:

> Thanks, Zoltan. I had not thought of that. I'll test it tonight and report
> back.  Thanks very much.
>
>
>
> --
> Sent from: http://www.ffmpeg-archive.org/
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Any way to detect loss of rtsp stream in ffplay?

discarn8-2
Zoltan:

Ok, I tested this and you are correct - it works.  Thank you, very much.

I unplugged the camera and ran the ffmpeg command, you suggested and I
promptly received a:

"Connection to tcp://192.168.0.2 failed: Connection refused
http://192.168.0.2: Connection refused"

I can work with this.  Scripting a loop of ffmpeg tests for each one of the
cameras, every 5 minutes should suffice.  I'll admit, however - it feels
like a bit of overkill to accomplish such a (seemingly) simple task.  Like
I'm using a forklift to move a kleenex tissue.

How does one go about submitting a feature request for ffplay - to include a
loss of input stream detection?



--
Sent from: http://www.ffmpeg-archive.org/
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Any way to detect loss of rtsp stream in ffplay?

discarn8-2
In reply to this post by Zoltan Kerenyi Nagy
Zoltan - the only problem with this, that I just realized is this:

As I mentioned before, the cameras intermittently lose connection.
Supposing that I send the ffmpeg test command while the camera connection is
good, and then the camera stream input to ffplay drops.  Ffplay will
continue displaying the last frame it received.  Now, if the camera
connection is restored a minute or two later, and I send the ffmpeg command
again - I would never know that ffplay has "stopped working".  I may not
ever know, unless I specifically test the camera when the connection has
dropped and it is currently down.  My results would most likely be
hit-or-miss.



--
Sent from: http://www.ffmpeg-archive.org/
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".