Stream Scanner

Stream Scanner

1. Statement of the Problem

Darwin streaming server contains a number of SDP files - one for each potential broadcast - in its home directory. Depending on whether the source encoder is unicasting or multicasting content, the stream is active or not and ready for delivery to media players.

Stream Scanner is a BASH script that is capable to determine whether a broadcast corresponding to a SDP file is active or not. That could be very useful when creating list of active broadcasts, time scheduled channels etc.

2. Concept of the Solution

The solution is based on the program RTPDUMP from the RTPTOOLS package suite. RTPDUMP parses and prints RTP packets, in a format suitable for further utilization by other RTPTOOLS. RTPDUMP, started with the "ascii" switch, prints out all RTP parameters of the broadcast.

The script parses IP number and the port from the SDP file and checks whether any packages are arriving to the IP number / port combination, and passes the result for further manipulation.

3. BASH Script

#! /bin/bash

ipnum=$(grep "c=" $1 | cut -f3 -d" " | cut -f1 -d/ | uniq) port=$(grep "m=" $1 | grep video | cut -f2 -d" " | cut -f1 -d/ | uniq) porta=$(grep "m=" $1 | grep audio | cut -f2 -d" " | cut -f1 -d/ | uniq)

rtpdump -F ascii $ipnum/$port > /tmp/$1.out & pids="$pids $!"

sleep 5s

if [[ $(grep -c RTP /tmp/$1.out) -gt 0 ]] then echo "ACTIVE!" else echo "NOT ACTIVE" fi

rm -fr /tmp/$1.out kill -9 $pids &> /dev/null

Open_Source_Streaming_Platform

Server_Side
_Darwin_Streaming_Server
_Icecast_Streaming_Server
_RTPTOOLS

Content_Production_Side
_Mbone_-_OpenMash_Tools
_Autostart_Script_VIC
_Live_Encoding_-_Mbone_Tools
_MPEG_4_IP
_MP3_Live_Streaming
_SMIL

Dynamic_Relaying_of_RTSP_Servers
_Dynamic_Relay_-_Flow
_Dynamic_Relay_-_Code
_Dynamic_Relay_&_MP3_alias

OSSA_Streaming_Protocol
_SDP_Exchange_&_Public_Keys
_Stream_Scanner

Logfile_Analyzer