Reputation: 145
I am trying to use FFprobe to test if a streaming link is active or not.
For example this is a working streaming link:
ffprobe -loglevel quiet -show_streams rtmp://Lrmh0w.cloud.influxis.com/yoy/_definst_/185
I do get output which mean link is active.
However, once I change link to something not work:
ffprobe -loglevel quiet -show_streams rtmp://Lrmh0w.cloud.influxis.com/yoy/_definst_/18555555555
The command keeps running in background with no result.
Is there a way to bypass this, or is there any ffprobe timeout parameter? I couldn't find it from the official website documentation.
Upvotes: 3
Views: 11595
Reputation: 31
I will +1 on the answers above : Adding a timeout before the ffprobe works.
ffprobe -show_format -timeout 1000000 -loglevel quiet "${ChannelList[$i+1]}"
Would every now and then get stuck on a bad http request resulting in a 503 error (when looking at logs after removing loglevel quiet). Channel list is where all the stream links are loaded.
timeout 5s ffprobe -show_format -timeout 1000000 -loglevel quiet "${ChannelList[$i+1]}"
This worked like a charm - prevented ffprobe from getting stuck indefinitely on a bad url and freezing the entire process.
Upvotes: 0
Reputation: 61
I'm just using *nix timeout:
/usr/bin/timeout 5s /usr/bin/ffprobe $SOURCE
In my case, it was enough.
Upvotes: 6
Reputation: 666
Try adding -timeout n
before the url, where n is the number of seconds. If it doesn't help then you should ask the question without -loglevel quiet
, including all the version info and error messages.
Upvotes: 2