PDA

View Full Version : Check if RTMP is live or not


jetnine
07-28-2012, 04:56 PM
Using rtmpdump, how can I quickly determine if a rtmp server has a live video being streamed or not?

I'm looking for something like the following to give me a fast result:
rtmpdump -status rtmp://myserver

greenythebeast
07-29-2012, 01:47 AM
Unfortunately, there's no command that does this as of yet. The best way to do it would be to just run the command you want and if it errors out it's probably offline, otherwise it's online and will download.

jetnine
07-29-2012, 02:11 AM
Can you give me an example of a command to use that will return a response quickly? Everything that I have tried takes a few minutes.

Elgero
07-29-2012, 08:06 AM
You can set the timeout in rtmpdump to a few seconds with the -m parameter. If it doesn't connect within 5 seconds, then you can be quite sure that there's no stream.

-r rtmp://website.com −m 5 -o stream.flv

jetnine
07-29-2012, 04:29 PM
Even though the stream is not live, it is still connecting:

Connecting ...
DEBUG: RTMP_Connect1, ... connected, handshaking
DEBUG: HandShake: Type Answer : 03
DEBUG: HandShake: Server Uptime : 1619478894
DEBUG: HandShake: FMS Version : 3.5.6.1
DEBUG: HandShake: Handshaking finished....
DEBUG: RTMP_Connect1, handshaked
DEBUG: Invoking connect
INFO: Connected...
DEBUG: HandleServerBW: server BW = 2500000
DEBUG: HandleClientBW: client BW = 2500000 2
DEBUG: RTMP_ClientPacket, received: invoke 242 bytes


This is followed by much more. How can I determine if this is actually live?

megalivestream
07-29-2012, 05:04 PM
This is what i would do .
find to any swf player , i use jw player wizard

http://www.longtailvideo.com/support/jw-player-setup-wizard?example=204

1- Change Option #1 to flvplayer with an rtmp stream
2- under file properties go change file to the actual playpath file name .flv if it is an flv type
3- change External Communication streamer to your rtmp path

Hope this helps . Thanks

jetnine
07-29-2012, 07:10 PM
I now have it so I can determine if it is live or not, but in the case when it is live, it will run forever until the stream stops. How can I just get the header info and then stop rtmpdump?