I'm able to play a rtsp stream from an ip camera in linux with following:
gst-launch -v rtspsrc location="rtsp://admin:pw@192.168.3.106/live1.sdp" name=demux demux. ! queue max-size-buffers=2 ! rtph264depay ! ffdec_h264 ! ffmpegcolorspace ! autovideosink sync=false
how do one checks if the rtsp stream is actually available over network before attempting to play. I want my stream playback to detect if rtsp stream is down, so that i will not attempt to play a stream until available.
You would need to write a client application to do that, I don't think its possible on the command line. With the application you can try to play from the rtsp source and if it times out you can try again or provide a suitable message to the user that the stream is not available or retry.
Having said that there are many open source github projects with such a player for various platforms Android, Windows, Linux QT based etc. A simple google search with 'gstreamer rtsp viewer github' will list a lot.