• Advanced Java API Code Examples

    Published on 06-23-2016 11:00 AM     Number of Views: 2345 
    1. Categories:
    2. Apple iOS,
    3. Live

    The Stream Targets feature in Wowza Streaming Engine™ media server software enables you to send live streams to widely distributed destinations such as content delivery networks and services. In addition to the variety of Stream Target destinations that are supported by built-in push-publishing profiles, you can develop your own Apple HLS (cupertino) Stream Target to support custom destinations.

    Our wse-example-pushpublishing-hls GitHub project provides documentation and a source code example implementation to help you create a custom implementation. An abstract base class, which you must extend in your custom implementation, enables you to create and maintain playlists, and to gather audio/video content from Wowza Streaming Engine live stream packetizers and package it into media segments. For your convenience, we've also modeled the playlists and media segments in Java classes and provided utility classes and code examples that demonstrate how to convert the models into content that can be transmitted to the destination and consumed by any player. ...
    Published on 06-23-2016 10:30 AM     Number of Views: 13 
    1. Categories:
    2. Live,
    3. MPEG-DASH

    This article demonstrates the API to use so you can adjust the chunk IDs and timecodes of live MPEG-DASH streams as they're packetized by Wowza Streaming Engine live streaming software. This can be useful for synchronizing streams between Wowza media servers for redundancy. ...
    Published on 12-24-2015 01:05 PM     Number of Views: 1838 
    1. Categories:
    2. Adobe Flash,
    3. Live

    This article describes how to send Flash data to and from a Wowza Streaming Engine™ media server by implementing the IExternalizable interface. This can be used for object serialization, a method for transferring and storing data, validating data, sending remote procedure calls, distributing objects, and detecting changes in time-varying data. The example in this article demonstrates an echo of the Example class from the client to the media server and back. ...
    Published on 11-20-2013 08:30 AM     Number of Views: 3479 
    1. Categories:
    2. IP Camera,
    3. RTSP/RTP

    Use this application module to set the RTP/AVSyncMethod for live RTSP streams (such as IP cameras or MPEG-TS encoders) on a per-stream basis. If you add a text file with a list of streams and their intended sync methods, the module deciphers this list when published. The code can be compiled and used without modification or extended by developers and implemented within a custom workflow. ...
    Published on 11-08-2012 07:35 PM     Number of Views: 3887 
    1. Categories:
    2. Video On Demand

    This article demonstrates how you can implement your own custom RandomAccessReadOptimizer. The RandomAccessReadOptimizer class is an abstraction in Wowza™ media server software that tries to optimize file read access when streaming using the HTTP streaming protocols (Adobe HDS, Apple HLS, MPEG-DASH, and Smooth Streaming). You can implement your own RandomAccessReadOptimizer to control how bytes are read from the file source when using these protocols to stream content. ...
    Published on 12-07-2015 04:28 PM     Number of Views: 5050 
    1. Categories:
    2. RTSP/RTP,
    3. Security

    Sample code that shows how to intercept the incoming UDP packets of an RTP or MPEG-TS stream and control which packets are passed to the depacketizer. To intercept UDP packets in an incoming RTP or MPEG-TS stream, create a class that implements the IRTPDePacketizerWrapper interface. This enables decryption, filtering, or re-ordering of the individual UDP packets before they're processed by Wowza Streaming Engine: ...
    Published on 10-03-2010 05:30 AM     Number of Views: 16081 
    1. Categories:
    2. Live

    The following is a quick example of how to use JSpeex with the Publisher API to send raw audio data to a Wowza media server.

    First, download a sample 16000Hz, stereo wav file and copy it to the [install-dir]/content folder: Extremists.wav

    Note: This file was created from the Extremists.flv file using the following ffmpeg command:
    cd [install-dir]/content
    ffmpeg -i Extremists.flv -vn -ac 2 -ar 16000 Extremists.wav
    ...
    Published on 10-03-2010 06:31 AM     Number of Views: 9885 

    Any integer read-only value in the MBeans section of JConsole can be graphed by double-clicking on its value. This graph will be updated every 5 seconds and will be maintained even if you view a different panel of attributes. To stop graphing a value, click Discard chart.

    To graph the current number connections to the Wowza Media Server, follow these steps: ...
    Published on 10-03-2010 06:30 AM     Number of Views: 23518 

    The following is a server listener class that is invoked when a Wowza media server starts. You can download a pre-built version of this web service.

    ServerListenerWowzaServerWS.java
    package com.wowza.wms.plugin.test.ws;
    
    import com.wowza.wms.logging.*;
    ...
    Published on 10-03-2010 05:38 AM     Number of Views: 10071 
    1. Categories:
    2. Mobile,
    3. RTSP/RTP,
    4. Set-top Box

    The following code snippet illustrates how to use the RTPUtils function to push an MPEG-TS or native RTP stream out of a Wowza media server. The stream can be sent out over UDP unicast or multicast.

    MPEG-TS out:
    To start the stream:
    RTPPushPublishSession rtpPullSession= RTPUtils.startRTPPull(appInstance, streamName, true, dstAddress, dstPort, false);
    ...
    Published on 10-03-2010 05:30 AM     Number of Views: 15231 

    The following shows a Java class that uses the JMX interface to implement virtual, appInstance, and MediaCaster stream startup/shutdown from the command line. ...
    Published on 10-03-2010 06:35 AM     Number of Views: 7353 
    1. Categories:
    2. Adobe Flash,
    3. Video On Demand

    The following snippet of code uses the internal FLVUtils class to read a .flv file:

    public void debugFLVFile(File file)
    {
    	try
    	{
    		BufferedInputStream inStream = new BufferedInputStream(new FileInputStream(file));
    		FLVUtils.readHeader(inStream);
    ...
    Published on 10-03-2010 06:24 AM     Number of Views: 8907 
    1. Categories:
    2. Live

    The following code snippet enables you to modify the onMetaData data that's associated with an on demand stream. The class extends the MediaReaderFLV class and overrides the getMetaData method. It then calls the MediaReaderFLV getMetadata method, deserializes the data into an AMFDataList object, allows you to inject or modify the metadata, serializes the packet and returns it to the streamer.

    package com.wowza.wms.plugin.test.mediareader;
    
    import java.util.*;
    ...
    Published on 10-03-2010 06:37 AM     Number of Views: 13643 
    1. Categories:
    2. Adobe Flash

    The following is the basic code to track connected users in a shared object:

    package com.wowza.wms.plugin.test.module;
    
    import com.wowza.wms.module.*;
    ...
    Published on 10-03-2010 01:26 AM     Number of Views: 23198 
    1. Categories:
    2. Video Recording

    You can use the IMediaWriterActionNotify listener interface to be notified when file writes are completed. Listeners are added to an application instance using the IApplicationInstance.addMediaWriterListener(IMediaWriterActionNotify listener) method. Below is a module for that illustrates how to use this interface.

    Note: You can use the built-in ModuleMediaWriterFileMover module as a simpler alternative for copying or moving files after recording.

    package com.wowza.wms.plugin.test.module;
    
    import java.io.*;
    ...
    Published on 10-03-2010 04:33 AM     Number of Views: 8976 

    The following module gets performance stats for Cupertino, Smooth, SanJose, and RTP sessions:

    package
    ...
    Published on 10-03-2010 06:30 AM     Number of Views: 6543 

    The following code example illustrates a method for iterating through all the clients connected to an application instance. ...