How to check RTMP source stream is live or not?


Hits: 21816  
RTMP Source Check RTMP Source RTMP Live Stream

Dear Friends,
You can check RTMP Source is live or not using socket programming, but that will not give you exact output. Today I have tried Linux utility “rtmpdump” to test & check RTMP Source it produced quite interesting results on command line….

# rtmpdump -v -r rtmp://giraldatvlivefs.fplive.net/giraldatvlive-live/stream001 -o /tmp/rtmp-checker.log

RTMP Output
<?php

/* 
 * 
 * RTMPChecker - by S V N L A B S () (blog.svnlabs.com)
 * You can use and modify this code as long as the above reference to me still exists 😉
 * 
 */

if(isset($_REQUEST['stream']) && $_REQUEST['stream']!="")
{

  exec("/usr/bin/rtmpdump -V  -v -r '".$_REQUEST['stream']."' -o /tmp/rtmp-checker.log 2>&1", $pp);
  echo implode("<br>", $pp);

}


?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Check RTMP is live or not?</title>
</head>
<body>

<form name="rtmp" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input type="text" name="stream" value="rtmp://164.100.49.14:80/live/dd2" /><br />
<input type="submit" name="check" value="check" />
</form>

</body>
</html>

Output may be…

Night is longer than day for those who dream & Day is longer than nights for those who MAKE their DREAMS come true…

Published by

Sandeep Verma

I’m an Entrepreneur. I’m proud to work as Blogger, LAMP Programmer, Linux Admin, Web Consultant, Cloud Manager, Apps Developer, Searcher. Concentrate > Observe > Imagine > Launch