How-To

  • Create custom authentication file for HTTP Provider

    Below is some instructions on how you can create a completely separate password file on a per HTTP Provider basis. This may be useful if you want some people to have access to Live stream record or to connection counts etc. In this example, we will be using LSR as our test. You will need to add the Authentication.xml file to your Wowza’s conf/ directory (get this from support or from a previous sub 4.x install). Then modify the LSR entry in the VHost.xml file and change the HTTPLiveStreamRecord HTTPProvider entry to the following: Alter your VHost.xml file and change the livestreamrecord http provider as follows: <HTTPProvider> <BaseClass>com.wowza.wms.livestreamrecord.http.HTTPLiveStreamRecord</BaseClass> <RequestFilters>livestreamrecord*</RequestFilters> <AuthenticationMethod>example-digest</AuthenticationMethod> </HTTPProvider> You will then use “example-digest” in your Authentication.xml file and include the following in that: <Method> <Name>example-digest</Name> <Description>Test Digest Authentication</Description> <Class>com.wowza.wms.authentication.AuthenticateDigest</Class> <Properties> <Property> <Name>passwordFile</Name> <Value>${com.wowza.wms.ConfigHome}/conf/example.password</Value> </Property> <Property> <Name>realm</Name> <Value>Live Stream Record Realm</Value> </Property> </Properties> </Method> Thereafter create an example.password and add your username & password to it as you would the typical admin.password file. Then just simply restart Wowza and test it out.  

  • How to prevent unwanted http access to your origin in Cloudfront workflow

    If you setup the CloudFront workflow, you may want to ensure that only CloudFront requests are able to access the given stream. Since you are in HTTP Origin Mode, you are working with a sessionless environment. Each request can be looked at and validated using the IVHostHTTPStreamerRequestValidator as follows: public class HTTPEventHandler implements IVHostHTTPStreamerRequestValidator{ public boolean validateHTTPStreamerRequest(RtmpRequestMessage req,HostPort hp, String str) { if(!req.getUserAgent().equalsIgnoreCase("amazon cloudfront")){ try{ req.setBody(ByteBuffer.wrap("".getBytes())); req.setContentLength(0); ...

  • How to get a property value in Wowza configuration file

    An article that demonstrates how to obtain a configuration value from a xml file from within your install.

  • REST API – Connect and Disable mediacaster stream

    Below is a couple of useful REST API commands that will allow you to initiate a connect and disable to an inbound stream. Connect: curl -X PUT --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/streamfiles/&appInstance=_definst_&mediaCasterType=rtp" Disconnect: curl -X PUT --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications//actions/disconnectStream"

  • REST API – How to disable and restart push publish endpoint

    You can disable/restart the push publish map entry via a PUT verb.

  • REST API – How to restart an application

    You can restart an application by leveraging the PUT verb with the actions endpoint (per the application).

  • REST API – How to get a list of incoming streams

    A simple way to obtain a list of incoming streams (per vhost) would be to initiate a curl request against that vhost with the /applications/live/instances endpoint

  • How to add support for a single file with multiple tracks for any HLS Protocol

    A question we have received many times over the last several months is can you get Wowza Streaming Engine to support single files with multiple tracks for any HLS Protocol. We have created a workaround for this lack of support via this module. It does require some ‘special’ SMIL file entries as it appears query parameters do not work in SMIL files, so we have replaced them with ##. An example SMIL file that would be used is as follows <?xml version="1.0" encoding="UTF-8"?> <smil title=""> <body> <switch> <video height="240" src="file.mp4##videoindex=0&amp;audioindex=0" system-language="en" title="English" width="424"> <param name="videoBitrate" value="450000" valuetype="data"></param> <param name="audioBitrate" value="64000" valuetype="data"></param> </video> <video height="360" src="file.mp4##audioindex=1" system-language="gr" title="SomethingElse" audio-bitrate="64000"> <param name="audioOnly" value="TRUE" valuetype="data"/> </video> </switch> </body> </smil> You can see we have replaced the ? with ##. It should also be noted that the ampersand sign needs to be specified in html form. In order to use the above special SMIL file the following code has been created. A media reader listener that takes the query parameters provided and then ...

  • HTTP Provider to redirect customers to your website

    This is a small http provider that will allow you to redirect customers to a sepcified URL instead of displaying the current Wowza Streaming Engine version. Set this up in your conf/VHost.xml just before the com.wowza.wms.http.HTTPServerVersion provider within the 8086 port as follows: <HTTPProvider> <BaseClass>guru.thewowza.example.httpprovider.website.Redirection</BaseClass> <RequestFilters>meta*</RequestFilters> <AuthenticationMethod>none</AuthenticationMethod> </HTTPProvider> You will also need to add a property into the last Properties section of your VHost.xml file <Property> <Name>wowzaGuruRedirectHTTPWebURL</Name> <Value>http://www.yourwebsiteurlhere.com</Value> <Type>String</Type> </Property> This property allows you to set the URL where the request will be redirected to. If this is not set it defaults to http://thewowza.guru. You can compile from the source below or download the zip file which has a jar file within it. Redirection Class package guru.thewowza.example.httpprovider.website; import com.wowza.wms.http.*; import com.wowza.wms.vhost.*; public class Redirection extends HTTProvider2Base { public void onHTTPRequest(IVHost vhost, IHTTPRequest req, IHTTPResponse resp) { if (!doHTTPAuthentication(vhost, req, resp)) return; String destinationURL = vhost.getProperties().getPropertyStr("wowzaGuruRedirectHTTPWebURL", "http://thewowza.guru"); resp.setResponseCode(302); resp.setHeader("Location", destinationURL); } } You can download the zip file here.

  • REST API – How to obtain information on inbound stream

    You can obtain information of an inbound stream by running a simple cURL GET command.