Audio/video stream recording forums

Attention Visitor:
You may have to register or log in before you can post:
  • Click the register link to sign up.
  • Registered members please fill in the form below and click the "Log in" button.
To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Audio/video stream recording forums > Streaming media recording forum > rtmpdump
Register FAQ Members List Calendar Mark Forums Read

Reply Post New Thread
 
Thread Tools Display Modes
  #1  
Old 03-16-2012, 09:05 AM
bkosborne bkosborne is offline
Junior Member
 
Join Date: Mar 2012
Posts: 1
bkosborne is on a distinguished road
Default

How to monitor activity on a stream


I'm looking for a way to monitor activity on a stream so that I can determine if there is anything come through the stream or not. If there is, I'll initiate a dump on it.

I imagine this working as running a cron task that checks a stream every 60 seconds. If it determines that a stream is coming through, then call upon rtmpdump to start recording it. If not, then do nothing and check again in 60 seconds.

Since rtmpdump just kind of errors out when there is no stream data, it doesn't seem like it would be a good idea to attempt to use it to monitor a stream.

It would be easy if I was doing this on a case-by-case basis manually, but I'm trying to automate the task of recording streams automatically if they are available.

Has anyone come across a way to do this? Perhaps some other tools I can use in command line (linux)?
Reply With Quote
  #2  
Old 03-17-2012, 08:04 AM
Ed999 Ed999 is offline
Senior Member
 
Join Date: Feb 2009
Posts: 115
Ed999 is on a distinguished road
Default

Re: How to monitor activity on a stream


Quote:
Originally Posted by bkosborne View Post
I'm looking for a way to monitor activity on a stream so that I can determine if there is anything come through the stream or not. If there is, I'll initiate a dump on it.

I imagine this working as running a cron task that checks a stream every 60 seconds. If it determines that a stream is coming through, then call upon rtmpdump to start recording it. If not, then do nothing and check again in 60 seconds.

Since rtmpdump just kind of errors out when there is no stream data, it doesn't seem like it would be a good idea to attempt to use it to monitor a stream.

It would be easy if I was doing this on a case-by-case basis manually, but I'm trying to automate the task of recording streams automatically if they are available.

Has anyone come across a way to do this? Perhaps some other tools I can use in command line (linux)?

RTMPDUMP doesn't necessarily have to be left to 'error out' if the stream pauses or stops streaming.

There are switches you can add to an RTMPDUMP command to allow for this. I add the following to the end of each command -

--resume --timeout 15

The "--timeout 15" switch causes the download attempt to end gracefully if no data is received for 15 seconds. You can specify any length of time, in seconds. If you don't include this switch, most builds of rtmpdump will time out after 120 seconds.

I use this switch to cause rtmpdump to test a url for the presence of actual data, and to time out if none is received.

The inclusion of the '--resume' switch causes the stream to continue the download - if you make a further attempt, after a timeout - from the point at which it left off, instead of going back to the start. The switch has no effect if used with a live stream.
Reply With Quote
  #3  
Old 03-17-2012, 11:01 AM
greenythebeast greenythebeast is offline
Senior Member
 
Join Date: Dec 2011
Posts: 105
greenythebeast is on a distinguished road
Default

Re: How to monitor activity on a stream


Yeah, I'd like a way to monitor for live streams. Any idea how that might be accomplished?
Reply With Quote
  #4  
Old 03-18-2012, 12:00 PM
compn compn is offline
Stream recording expert
 
Join Date: Sep 2006
Posts: 128
compn has a spectacular aura aboutcompn has a spectacular aura aboutcompn has a spectacular aura about
Default

Re: How to monitor activity on a stream


is it a static image on screen in between live events?

if so, you can use rtmpdump to output to mplayer -vo md5sum - to check if the static image is playing.

the command will look something like
rtmpdump rtmp://stream -o - | mplayer -vo md5sum -
and mplayer will output a file called 'md5sums' which is a txt and like this (if the image is perfectly the same image):

a7860a39c88b3ff31ef4f0570aec8432 frame00000000
a7860a39c88b3ff31ef4f0570aec8432 frame00000001
a7860a39c88b3ff31ef4f0570aec8432 frame00000002
a7860a39c88b3ff31ef4f0570aec8432 frame00000003
a7860a39c88b3ff31ef4f0570aec8432 frame00000004
a7860a39c88b3ff31ef4f0570aec8432 frame00000005
a7860a39c88b3ff31ef4f0570aec8432 frame00000006
a7860a39c88b3ff31ef4f0570aec8432 frame00000007
a7860a39c88b3ff31ef4f0570aec8432 frame00000008
a7860a39c88b3ff31ef4f0570aec8432 frame00000009
a7860a39c88b3ff31ef4f0570aec8432 frame00000010

then your script can just check if the md5sums match.

or if the frames arent perfectly the same, you could run mencoder - -ovc lavc -nosound -o file.avi -frames 100, and if mencoder output is highly compressed, like 1minute = 100k, then its probably a static image.
Reply With Quote
Reply Post New Thread
Tags: , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 10:16 AM.


Powered by All-streaming-media.com; 2006-2011
vB forum hacked with Zoints add-ons