Detect if the stream being published to Wowza is an SRT stream or not.

The latest version of Wowza adeptly supports SRT ingest. Here is an article from Wowza that explains how to publish an SRT stream from Wirecast and get it into Wowza through Mediacaster. It is a fairly simple step by step to getting started with SRT. But now we are left with the dilemma of how to detect this on the server-side within a module. In other words how to know in a module if the publishing stream is an SRT stream or not. Here is a code snippet from the onPublish method of an IMediaStreamActionNotify implementation that demonstrates how to check if the stream is an SRT stream.


@Override
public void onPublish(IMediaStream stream, String arg1, boolean arg2, boolean arg3) {
   
    getLogger().info(".onPublish => stream " + arg1);
   
    RTPStream rtpStream = stream.getRTPStream();
    if (rtpStream != null)
    {      
        if(rtpStream.isSRT())
        {
            getLogger().info("SRT stream detected => stream name : " + arg1);
        }
    }
}

Read a text file from Wowza’s conf directory

Reading configuration files from the conf directory within a module is a very common occurring in wowza. the following code snippet shows how to read a text file as string from the conf directory. If the file does not exist the code throws an IOException. this example makes use of the environment variable WMSCONFIG_HOME,


/**
 * Read a text file as string from the wowza conf directory give the filename
 *
 * @param filename file name of the file to read
 * @return
 * @throws IOException
 */
private String readFileFromConfigDirectory(String filename) throws IOException
{
    String conf_home = System.getenv("WMSCONFIG_HOME");
    File conf_dir = new File(conf_home + File.separator + "conf");
    if(conf_dir.exists()) {
        // read the file contents here
        File file_to_read= new File(conf_dir.getAbsolutePath() + File.separator + filename);
        if(file_to_read.exists()) {
            String content = new String(Files.readAllBytes(Paths.get(file_to_read.getAbsolutePath())));
            return content;
        }
        else {
            throw new IOException("oops! file "+filename+" not found!!");
        }
    }
    else {
        throw new IOException("oops! conf directory was not found!!");
    }
}

OpenCaster – A free media file broadcaster for rtmp servers

OpenCaster is a free desktop tool for windows (soon to be available on mac), which allows you to broadcast commonly used media files (mp4,mp4,flv,avi,etc…) from your desktop to your favourite RTMP server, such as Flash media server / Wowza media server / Red5 Media Server. Create playlists with your fav media files and stream them to the internet like a live tv / radio show .

(more…)

Android Broadcaster : multipurpose streamer out of beta !!

Android Broadcaster is a multi-purpose, multi-protocol live video/audio encoder for android platform. Android Broadcaster carries forward the legacy of Adobe Flash based live broadcasting on desktop onto the android ecosystem. Now use your Android smart phone/tablet to do live broadcasting from anywhere ,at any-time. Android broadcaster supports both media server based broadcasting(RTMP, RTMPT, RTMPE, RTMPS) and server-less P2P multicast (RTMFP). Android Broadcaster is also capable of playing live/recorded content of various formats.  Android Broadcaster is the one stop RTMP broadcaster/recorder/player that you will ever need.

last comments
vnezapno
vnezapno

Hi, great stuff there. What did you use for UI Flex or Feathers ? Can we get the sources ?…