• How to add an audio track to a video-only stream (ModuleAddAudioTrack)

    This module can be used to add an audio track to a live stream that does not already have audio. Microsoft Smooth Streaming and some service providers such as Akamai and YouTube require streams to have both video and audio. You can use this module to insert audio from a file into the video before pushing it out to Akamai or providing playback to Smooth Streaming clients. Conversion of a video-only stream from an IP camera into a video-and-audio stream is an example of how this module can be used.

    Note: Wowza Streaming Engine™ 4.0.0 or later is required.
    A compiled version of this module is included in the Wowza Modules Collection.

    Configuration


    To enable this module, add the following module definition to your application. See Configure modules for details.

    Name
    Description
    Fully Qualified Class Name
    ModuleAddAudioTrack Adds audio to a video-only stream. com.wowza.wms.plugin.collection.module.ModuleAddAudioTrack

    Properties


    After enabling the module, you can adjust the default settings by adding the following property to your application. See Configure properties for details.

    Path
    Name
    Type
    Value
    Notes
    Root/Application addAudioTrackAudioSourceFilename String myAudioFile.mp4 Name of file that contains the audio track. The same file is used for all streams (default: mp4:sample.mp4).

    Usage


    The module creates two additional streams for every input stream connected to the application. The new streams created are suffixed with "-audiodestin" and "-audiodestin-audiosource." For example, in the input stream named myStream, additional new streams will be created named myStream-audiodestin and myStream-audiodestin-audiosource.

    Note: If you have a Developer or Trial license and use this module, you can only create one inbound connection to your Wowza media server. The two module-created streams count towards the maximum of three inbound connections included with these license types.
    The stream suffixed "-audiodestin" is the playback stream. This is the name that should be used in players and for pushing out to a CDN. This stream will contain the video from the original source stream and the audio from the file specified by the addAudioTrackAudioSourceFilename property.

    The stream suffixed with "-audiodestin-audiosource" is used internally and will loop continuously while the source stream is running. The audio track is read from this stream. By default, the module will look for sample.mp4 in the StorageDir of the running application.


    Originally Published: 02-26-2014.
    Updated: For Wowza Streaming Engine 4.0.6 on 08-11-2014.

    If you're having problems or want to discuss this article, post in our forum.