HTML5 MP3 Player Radio KPlayer


Hits: 14829  
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 (svnlabs@gmail.com) (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…







Tagged with:  
  • http://www.facebook.com/profile.php?id=507794377 Sajjad Kassar

    Thank you!!! You are my knight in shining armour :)

    I have changed the script a bit, because need to give it a stop time otherwise rtmpdump keeps on running. I’ve also removed the whole interactive part and made it run on its own.

    Reason being is that I integrated this with the check_http plugin of Nagios and now I FINALLY get notifications for my rtmp feeds :)

    Thank you!

  • Inopuli

     You fool !
    There is a big vuln !

    .$_REQUEST['stream'] is unfiltered !!!

    if i would post ?stream= bla | id i would get a remote execution !

    lame

  • http://www.facebook.com/svnlabs Sandeep Verma

    Wise Man can optimize codes as per security vuln :P

    Post your filtered code here :) 

  • Gtgrtgtr

    Inopuli – you are an idiot if you require filtering in simple example. 

  • Imran Khan

    Hi Sandeep,

    Please provide me step by step procedure to monitor RTMP video stream link.

  • FML

    No, publishers should make an effort to provide secure code examples so their readers don’t get caught out and hacked.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...