• How to record live streams (HTTPLiveStreamRecord)

    Live Stream Record, formerly a free AddOn, is incorporated into Wowza Media Server 3.5 as an API that gives you more control over recording live streams to video on demand files. This feature enables you to control the live stream recording process using a web-based user interface, HTTP URL queries, or programmatically. Powerful APIs are included to support splitting of in-process live streams into multiple on-demand MP4 (QuickTime container) files or FLV (Flash Video container) files, with the split points based on video duration, clock time, or file size.

    Notes:

    Contents


    Prerequisites
    Recording live streams using the web-based user interface
    Recording live streams using URL queries
    Viewing available live streams and recording status
    Recording live streams programmatically
    Overriding Live Stream Record parameters using properties
    Troubleshooting
    How to get LiveStreamRecord AddOn, API, and examples
    Related articles
    Appendix: Understanding crontab expressions

    Prerequisites


    Specifying an authentication method

    Live Stream Record functionality in Wowza Media Server is enabled by an HTTP Provider that's configured on a per-port basis in the [install-dir]/conf/VHost.xml file. The default HTTP Provider configuration in VHost.xml for Live Stream Record is:
    <HTTPProvider>
    	<BaseClass>com.wowza.wms.livestreamrecord.http.HTTPLiveStream  Record</BaseClass>
    	<RequestFilters>livestreamrecord*</RequestFilters>
    	<AuthenticationMethod>admin-digest</AuthenticationMethod>
    </HTTPProvider>
    The AuthenticationMethod property specifies the authentication method that's used to control access to this HTTP Provider. The default value (admin-digest) specifies that Digest authentication (a challenge/response system to authenticate users—credentials are never sent in cleartext) is used to control access to the HTTP Provider and is recommended if you access the Live Stream Record web-based user interface from a remote computer. To use this authentication method, you must specify a user name and password for Digest authentication in the [install-dir]/conf/admin.password file. Open this file in a text editor and enter a new line with a user name and password. For example, to add the user name myuser and the password mypassword:
    # Admin password file (format [username][space][password])
    #username password
    myuser mypassword
    To enable unauthenticated access to this HTTP Provider, open the VHost.xml file in a text editor and change the AuthenticationMethod property value to none. This isn't recommended if you'll be accessing the web-based UI from a remote computer.

    Publishing a live stream

    You must configure an application for live streaming and then publish a live stream from an encoder to Wowza Media Server in order for it to be recorded for later video on demand playback.

    On Wowza Media Server:

    1. Create an application folder [install-dir]/applications/live.

    2. Create a configuration folder [install-dir]/conf/live and copy [install-dir]/conf/Application.xml to this new folder.

    3. Open the newly copied [install-dir]/conf/live/Application.xml file in a text editor and make the following changes (some of these settings may already be present):

      1. Set the Streams/StreamType property to:
        <StreamType>live</StreamType>
      2. Set the HTTPStreamers property to:
        <HTTPStreamers>cupertinostreaming,smoothstreaming,sanjosestreamin  g</HTTPStreamers>
      3. Set the Streams/LiveStreamPacketizers property to:
        <LiveStreamPacketizers>cupertinostreamingpacketizer,smoothstreamingpacket  izer,sanjosestreamingpacketizer</LiveStreamPacketizers>
      4. Set the RTP/Authentication/PlayMethod property to:
        <PlayMethod>none</PlayMethod>
    4. Start Wowza Media Server.


    On the encoder:

    • Enter the Wowza Media Server URL and stream name information, and then click the Publish or Start button on the encoder. The following example shows information that you might enter for an RTMP-based encoder.
      Server URL: rtmp://[wowza-ip-address]/live
      Stream Name: myStream

    Note: The steps for publishing a stream from your encoder to Wowza Media Server may vary depending on the encoder that's used. For more information about how to configure your encoder, see Specific Encoding Technologies or your encoder documentation.

    Supported file formats

    Live Stream Record supports recording live streams to MP4 (QuickTime container) files or FLV (Flash Video container) files.

    Live streams must be encoded with the following video and audio codecs to enable recording to MP4 format:

    Video

    • H.264

    Audio
    • AAC
    • MPEG-1 Layer 3 (MP3)
    • Speex


    Recording live streams using the web-based user interface


    Wowza Media Server includes a web-based user interface (UI) that has basic options for recording live streams to video on demand files. You can use the UI to control the recording process either locally or from a remote computer and specify when the recording starts and stops, the filename and location, the container format, and other details. To split in-process live stream recording archives into multiple files, with the split points based on video duration, clock time, or file size, do the following:

    1. Make sure that you have fulfilled all prerequisite requirements. For more information, see the Prerequisites section.

    2. Start Wowza Media Server.

    3. On the Wowza Media Server or from a remote computer, open the following URL in a web browser: http://[wowza-ip-address]:8086/livestreamrecord.

    4. In the Live Stream Record webpage, click start recording.



      After you click start recording, the web-based Start Recording dialog box is displayed.



    5. In the Start Recording dialog box, select options to specify how the live stream is split to on-demand recorded files.

      Record the live stream to a single file

      In Action, select Start Recording to record the live stream to a single video on demand file (this is the default setting). Then in Recording Options, select one of the following options that specify what to do if the live stream is restarted:

      • Version existing file. Start recording the live stream to a new file after it's restarted (this is the default setting). For example, if you were recording a live stream to the file myStream.mp4, the live stream will be recorded to a new file named myStream_2013-05-12-15.08.10.645-PDT_0.mp4 after it's restarted.

      • Append to existing file. Resume recording the live stream to the existing file (for example, myStream.mp4) after it's restarted.

      • Overwrite existing file. Start recording the live stream to a new file with the same name as the existing file (for example, myStream.mp4) after it's restarted. This option will replace the previously recorded file with a new one.


      Record the live stream to a multiple segmented files

      To record the live stream to multiple video on demand files, select one of the following combination of options to specify how to split the recorded files:

      • To split the live stream into multiple on-demand files with a maximum size, in Action, select Start Recording Segment By Size. Then in the Segment Size box, specify the maximum file size in megabytes (MB). The default size is 10 MB.

      • To split the live stream into multiple on-demand files with a maximum duration, in Action, select Start Recording Segment By Duration. Then in the Segment Duration box, specify the maximum duration in <hours>:<minutes>:<seconds>.<milliseconds>. The default value is 15 minutes (00:15:00.000).

      • To split the live stream into multiple on-demand files based on a schedule, in Action, select Start Recording Segment By Schedule. Then in the Segment Schedule box, specify the schedule parameters by entering a crontab expression. The default value is to split the recording into a new file at the top of each hour.

    6. (Optional). In the Start Recording dialog box, you can specify output options for the recorded files. In the Custom Output Path and File Name area, click Enable and then configure the following options:

      • Stream Format. Select the video on demand format of the recorded file, either MP4 (the default value) or FLV.

      • Path. Specify the physical path of a location on the computer where the recorded files are stored. By default, the files are stored in the [install-dir]/content directory. If you want to store files in a different location, make sure that the folder exists on the computer and then specify its physical path.

      • File Name. To change the default output filenames of your recorded files, update the default template string. You can add any valid filename characters and change the template keys in the string value. For more information about how to use template strings, see Defining filenames of recorded segments with template strings.

    7. Click Submit.

    After you click Submit, Wowza Media Server will start recording the live stream and the Wowza Media Server: Live Stream Record webpage will display the selected options.



    Note: The Wowza Media Server: Live Stream Record webpage may incorrectly display the status Waiting for stream after you click Submit. Refresh the webpage to view the current status, which should be Recording in progress.
    In the Live Stream Record webpage, you can click stop recording to stop recording the live stream. If you click split recording, Wowza Media Server will continue to record the live stream to new file.

    Note: When you click split recording, Wowza Media Server immediately stops writing data for the live stream to the currently recording segmented file and closes it, and then opens a new segmented file to continue the recording. If you specified that the segmented files not exceed a maximum duration, data will be written to the new file until either the duration value specified in Segment Duration is reached or you click split recording again.

    Recording live streams using URL queries


    You can use the HTTP get method and URL querystring parameters to record live streams. The following URL querystring shows the minimum required URL parameters for recording live streams:
    http://[wowza-ip-address]:8086/livestreamrecord?app=live&streamname=myStream&action=startRecording
    Where the required URL parameters are:

    • app=[app-name]
    • streamname=[stream-name] (must be a live stream)
    • action=startRecording | stopRecording | splitRecordingNow | startRecordingSegmentByDuration | startRecordingSegmentBySize | startRecordingSegmentBySchedule


    You can add the following optional URL parameters to the URL querystring:

    • option=version | append | overwrite
      The default value is version.

    • startonkeyframe=true | false
      The default value is false.

    • recorddata=true | false
      The default value is true.

    • outputPath=[path]
      The default value is left blank, which means that files are recorded to the default Wowza Media Server content folder ([install-dir]/content). If you specify another location on the server for recorded files, you must use the fully qualified path location (for example, C:/Content). You must not include a filename in the path value.

    • outputFile=[filename].[extension]
      The default value is left blank, which means that the [filename] is the same as the [stream-name] and [extension] takes on the specified format value.

    • format=1 | 2
      1 = FLV and 2 = MP4. The default value is 2.

    • segmentSize=[megabytes]
      The default value is 10 (10 megabytes).

    • segmentDuration=[seconds]
      The default is 900 (15 minutes).

    • segmentSchedule=[crontab string]

    • fileTemplate=[file template string]


    If you set up an authentication method (see Specifying an authentication method) that requires a username and password, add the username and password to the URL querystring as follows:
    http://[username]:[password]@[wowza-ip-address]:8086/livestreamrecord?app=live&streamname=myStream&action=startRecording

    Viewing available live streams and recording status


    You can view a list of live streams that are available to record, as well as the status of live streams that are being recorded, in a webpage. To do this, use the following URL:
    http://[wowza-ip-address]:8086/livestreamrecord/index.html
    The above URL will open a webpage that displays all available live streams, including those that are being recorded, for all Wowza Media Server applications.

    Wowza Media Server 3.6 offers the ability to filter the list of live streams by application name. To view a list of live streams that are available to record and the status of live streams that are being recorded for a specific application, add the URL parameter appFilter=[app-name] to the above URL. For example, the URL:
    http://[wowza-ip-address]:8086/livestreamrecord/index.html?appFilter=live
    will open a webpage that displays all available live streams, including those that are being recorded, for the Wowza Media Server live application.

    You can require that an application name be included in the above URL, which will turn off the ability to list all available live streams across all applications in the webpage. To do this, add the following property to the <Properties> container at the end of the [install-dir]/conf/VHost.xml file (be sure to get the correct <Properties> container—there are several in VHost.xml):
    <Property>
        <Name>liveStreamRecordRequireApplicationFilters</Name>
        <Value>true</Value>
        <Type>boolean</Type>
    </Property>

    Recording live streams programmatically


    Wowza Media Server includes the following Application Programming Interfaces (APIs) that enable you to have more programmatic control over live stream recordings:

    • public void startRecording(IMediaStream stream, String filePath, boolean append, Map<String, Object> extraMetadata, int splitOnTcDiscontinuity). Start recording a live stream and indicate if the recording should be split when timecode discontinuities occur.

      The default for the startRecording API is to not split the recording (append).

      Valid options for splitting the recording on timecode discontinuties are:
      • SPLIT_ON_DISCONTINUITY_DEFAULT
      • SPLIT_ON_DISCONTINUITY_ALWAYS
      • SPLIT_ON_DISCONTINUITY_NEVER

    • public void startRecordingSegmentByDuration(IMediaStream stream, String filePath, Map extraMetadata, long duration). Start recording a live stream and split the recording into segmented files of a specified duration (in milliseconds). For example, pass in 15000 to get 15 second files.

    • public void startRecordingSegmentBySize(IMediaStream stream, String filePath, Map extraMetadata, long size). Start recording a live stream and split the recording into multiple segmented files of a specified size (in bytes). For example, pass in 1048576 to get 1 megabyte (MB) files.

    • public void startRecordingSegmentBySchedule(IMediaStream stream, String filePath, Map extraMetadata, String schedule). Start recording a live stream and split the recording into segmented files on a schedule specified by a crontab string. The crontab string specifies the split interval in minutes, hours, months, years, days of the month, or days of the week. For more information, see Appendix: Understanding crontab expressions.

    • public void splitRecordingNow(). Split an active recording immediately. This action stops writing data to the currently recording segmented file and closes it, and then opens a new segmented file to continue the recording. If the startRecordingSegmentByDuration API is being used to split the live stream into segmented files, data will be written to the new file until either the duration value specified by startRecordingSegmentByDuration is reached or splitRecordingNow() is called again.

    • public void setFileVersionDelegate(ILiveStreamRecordFileVersio nDelegate delegate). Specify a custom file version naming convention.

    • public void getCurrentDuration(). Get the current segment file duration, in seconds.

    • public void getCurrentSize(). Get the current segment file size, in bytes.

    • public void stopRecording(). Stop recording the specified stream.

    For more information about the Live Stream Record APIs, see the installed Javadocs ([install-dir]/documentation/serverapi) or download the Wowza Media Server Server-Side API documentation in PDF file format.

    Specifying the file version naming convention

    You can implement the ILiveStreamRecordFileVersionDelegate interface to override the default file version naming convention used for the recorded segmented files of a live stream.

    • public abstract String getFilename(ILiveStreamRecord recorder). Returns a String that will be used to name the next recorded segment. The String that's returned should include the fully qualified path along with the filename (for example: c:\temp\saved\mystream_123.mp4).

    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    
    public class MyDelegate implements ILiveStreamRecordFileVersionDelegate
    {
    	public String getFilename(ILiveStreamRecord recorder)
    	{
    		String name;
    		DateFormat dateFormat = new SimpleDateFormat("yyyy_MM_dd_HHmmssSSS");
    		Date date = new Date();
    		try
    		{
    			File file = new File(recorder.getBaseFilePath());
    			String oldBasePath = file.getParent();
    			String oldName = file.getName();
    			String oldExt = "";
    			int oldExtIndex = oldName.lastIndexOf(".");
    			if (oldExtIndex >= 0)
    			{
    				oldExt = oldName.substring(oldExtIndex);
    				oldName = oldName.substring(0, oldExtIndex);
    			}
    			
    			name = oldBasePath+"/"+oldName+"_"+dateFormat.format(date)+oldExt;
    			file = new File(name);
    			if (file.exists())
    			{
    				file.delete();
    			}
    		}
    		catch (Exception e)
    		{
    			WMSLoggerFactory.getLogger(null).error("MyDelegate.getFilename: "+e.toString());
    			// return a temp filename
    			name = "temp"+dateFormat.format(date)+".tmp";
    		}
    		return name; 
    	}
    }

    Defining filenames of recorded segments with template strings

    The default delegate allows you to specify a template string that defines the filenames of the recorded segments.

    • public void setFileTemplate(String template). Enables a custom filename template string to be specified.

    • public String getFileTemplate(). Returns the current filename template string.


    The template string can contain any valid filename characters as well as any valid template key, in any order.

    These strings are for use with:

    • Start Recording Segment By Size
    • Start Recording Segment By Duration
    • Start Recording Segment By Schedule


    Valid template keys are:

    • ${SourceStreamName}. The name of the live stream.

    • ${SegmentNumber}. An incrementing value that represents the current number of recorded segments that have been created for this live stream, starting at 0.

    • ${RecordingStartTime}. The time at which the recording was started.

    • ${SegmentTime}. The time at which the recorded segment was created.

    Note: ${RecordingStartTime} and ${SegmentTime} use the date time format yyyy-MM-dd-HH.mm.ss.SSS-zzz (<year>-<month>-<day>-<hour>.<minute>.<second>.<millisecond>-<time zone>).
    The default file template string is ${SourceStreamName}_${RecordingStartTime}_${Segmen tNumber}, which generates recorded MP4 filenames such as the following:

    myStream_2013-05-12-08.51.31.104-PDT_0.mp4
    myStream_2013-05-12-08.51.31.104-PDT_1.mp4
    myStream_2013-05-12-08.51.31.104-PDT_2.mp4

    Example template strings:

    ${SourceStreamName}_${SegmentNumber}:

    mystream_0
    mystream_1
    mystream_2

    ${SourceStreamName}_t${RecordingStartTime}_ct${Seg mentTime}:

    mystream_t2013-05-12-02.34.53.102-PDT_ct2013-05-12-02.00.00.000-PDT
    mystream_t2013-05-12-02.34.53.102-PDT_ct2013-05-12-02.15.00.000-PDT
    mystream_t2013-05-12-02.34.53.102-PDT_ct2013-05-12-02.30.00.000-PDT

    Configuring notifications

    You can implement the ILiveStreamRecordNotify interface to receive notifications when a new file is opened for writing and when the current recorded segment has been closed. (See the code snippet later in this section for an example listener.)

    • public abstract void onSegmentStart(ILiveStreamRecord recorder). Receive a notification that a new file has been opened for writing.

    • public abstract void onSegmentEnd(ILiveStreamRecord recorder). Receive a notification that the current recorded file has been closed (data is no longer being written to the file).

    public class MyListener implements ILiveStreamRecordNotify 
    {
    	public void onSegmentStart(ILiveStreamRecord recorder)
    	{
    		// Nothing to do here
    	}
    	public void onSegmentEnd(ILiveStreamRecord recorder)
    	{
    		// move completed file to storage location
    		File file = new File (recorder.getCurrentFile());
    		if (!file.renameTo(new File("c:/storage"+file.getName()))) 
    		{
    			WMSLoggerFactory.getLogger(null).error("MyListener.onSegmentEnd: file move failed for "+file.getAbsolutePath());
    		}
    	}
    }

    Splitting live recordings at timecode discontinuities

    You can change the default behavior for splitting live recordings when a timecode discontinuity is encountered in the source stream by adding the following property to the <Properties> container at the end of the [install-dir]/conf/[application]/Application.xml file (be sure to get the correct <Properties> container—there are several in Application.xml):
    <Property>
        <Name>liveStreamRecorderSplitOnTcDiscontinuity</Name>
        <Value>true</Value>
        <Type>boolean</Type>
    </Property>
    Note: This property only applies to the startRecording API. The onSegment* APIs will always split live recordings at timecode discontinuities.

    Overriding Live Stream Record parameters using properties


    Note: For use with Wowza Media Server 3.6.2 and later.
    You can use the following properties to override the values set when using the Live Stream Record web-based user interface or the Live Stream Record APIs. These properties can be used by adding them to the <Properties> container at the end of the [install-dir]/conf/[application]/Application.xml file (be sure to get the correct <Properties> container—there are several in Application.xml).

    Caution: When an override property is set in Application.xml, its value is always used and can't be changed via the web-based UI or the API.
    liveStreamRecordOption
    <Property>
        <Name>liveStreamRecordOption</Name>
        <Value>overwrite</Value>
        <Type>String</Type>
    </Property>
    A valid Value is one of the following: append, overwrite, or version.

    liveStreamRecordStartOnKeyFrame
    <Property>
        <Name>liveStreamRecordStartOnKeyFrame</Name>
        <Value>false</Value>
        <Type>boolean</Type>
    </Property>
    liveStreamRecordRecordData
    <Property>
        <Name>liveStreamRecordRecordData</Name>
        <Value>false</Value>
        <Type>boolean</Type>
    </Property>
    liveStreamRecordFilePath
    <Property>
        <Name>liveStreamRecordFilePath</Name>
        <Value>c:/content</Value>
        <Type>String</Type>
    </Property>
    The Value should only include the path where the recordings are stored. It must not include a filename.

    liveStreamRecordSegmentSize
    <Property>
        <Name>liveStreamRecordSegmentSize</Name>
        <Value>102400</Value>
        <Type>long</Type>
    </Property>
    The Value is the number of bytes.

    liveStreamRecordSegmentDuration
    <Property>
        <Name>liveStreamRecordSegmentDuration</Name>
        <Value>10000</Value>
        <Type>long</Type>
    </Property>
    The Value is the number of milliseconds.

    liveStreamRecordSegmentSchedule
    <Property>
        <Name>liveStreamRecordSegmentSchedule</Name>
        <Value>2 * * * * *</Value>
        <Type>String</Type>
    </Property>
    The Value is a valid crontab string.

    Troubleshooting


    • Wowza Media Server must be actively ingesting a live stream before you can start recording it.

    • You can't use separate instances of the web-based user interface to record the same live stream. If a recording for a live stream is started and another recording request for the same stream is submitted, the first recording is terminated and a new one is started to honor the second recording request.

    • A recording must be completed before it can be played back.

    • The Live Stream Recording APIs are designed for server-side recording. Client-side recording, where multiple recording requests can be made for the same stream, isn't supported.

    • When using the onSegment* APIs:
      • The Version flag must be set to true for the recorded files to be created correctly.
      • Setting the Overwrite flag to true can cause previously recorded files to be overwritten.
      • The Append flag is ignored.


    Verifying settings by enabling additional debug logging

    You can enable additional debug logging for Live Stream Record by adding the following property to the <Properties> container at the end of the [install-dir]/conf/[application]/Application.xml file (be sure to get the correct <Properties> container—there are several in Application.xml):
    <Property>
        <Name>liveStreamRecorderDebugLog</Name>
        <Value>true</Value>
        <Type>boolean</Type>
    </Property>
    The debug log messages are recorded to the [install-dir]/logs/wowzamediaserver_access.log file.

    The following is an example log message with the liveStreamRecorderDebugLog property enabled. If you get unexpected results while using Live Stream Record, you can use the log message to confirm the settings that are being used.
    comment	server	INFO	200	-	[com.wowza.wms.vhost.VHost@62345ce0]HttpLiveStreamRecord.recordStream: action:startRecording stream:myStream format:mp4 append:false outputPath:C:\Program Files (x86)\Wowza Media Systems\Wowza Media Server 3.6.0\content outputFile:myStream.mp4 versionFile:true startOnKeyFrame:true recordData:true segmentDuration:900000 segmentSize:10485760 segmentSchedule:0 1 * * * * fileTemplate:null
    Note that if you followed the instructions in Overriding Live Stream Record parameters using properties to override recording settings that were specified in the web-based user interface or API with properties in Application.xml, be sure to look for log messages similar to the following examples to verify Live Stream Record settings.
    filePath has been overridden in application.xml, value=C:/content/myStream.mp4
    versionFile has been overridden in application.xml by liveStreamRecordOption=overwrite
    appendFile has been overridden in application.xml by liveStreamRecordOption=overwrite
    startOnKeyFrame has been overridden in application.xml, value=false
    recordData has been overridden in application.xml, value=false
    segmentSize has been overridden in application.xml, value=102400
    segmentDuration has been overridden in application.xml, value=10000
    segmentSchedule string has been overridden in application.xml, value=2 * * * * *

    How to get LiveStreamRecord AddOn, API, and examples


    The following downloadable LiveStreamRecord AddOn packages work with Wowza Media Server 3.1.2 or earlier. These AddOn packages don't provide the full capabilities for recording live streams to on-demand files that are available in Wowza Media Server 3.5 or later. To learn more about how to use the LiveStreamRecord AddOn package with your version of Wowza Media Server, see the ReadMe.html file in the compressed (zipped) folder.

    Version for Wowza Media Server 3.0.3.08 to 3.1.2.*
    LiveStreamRecord_3.0.zip

    Version for Wowza Media Server 2.0.0.04 to 2.2.4.*
    LiveStreamRecord_2.0.zip

    Version for Wowza Media Server Pro 1.7.x
    LiveStreamRecord.zip

    Appendix: Understanding crontab expressions


    In Wowza Media Server, you can use crontab expressions to split a recording into multiple segmented files, based on a schedule. The crontab expression specifies the split interval in minutes, hours, months, years, days of the month, or days of the week. The available crontab fields are (in order):

    <Minute> <Hour> <Day_of_the_Month> <Month_of_the_Year> <Day_of_the_Week> <Year>

    where:

    • <Minute> - Specifies the minute value (between 0 and 59) at which the split occurs.

    • <Hour> - Specifies the hour (between 0 and 23 based on a 24-hour clock) at which the split occurs.

    • <Day_of_the_Month> - Specifies the day (between 0 and 31) at which the split occurs. To specify that live recordings always be split on the last day of the month, specify 31.

    • <Month_of_the_Year> - Specifies the month at which the split occurs. You can specify the month by using the abbreviated name of the month (for example, Jan) or a numerical equivalent (for example, 1).

    • <Day_of_the_Week> - Specifies the day in a week at which the split occurs. You can specify the day by using the abbreviated name of the day (for example, Mon) or a numerical equivalent (for example, 1).

    • <Year> - Specifies the year at which the split occurs (for example, 2013).

    The crontab fields are meant to be used in combination in a cron expression (a string comprising the field values separated by white space) to give you a powerful mechanism for splitting your live recordings. You can also use special characters as field values to give you even more flexibility. Wowza Media Server 3.5 supports the nnCcron cron format (http://www.nncron.ru/help/EN/working/cron-format.htm).

    Note: The nnCron nonstandard question mark character (?), which specifies that the server startup time is substituted into the cron expression, is currently not supported.
    Example cron expressions:

    The following are some simple examples that introduce cron expressions. For more advanced examples, see the nnCcron cron format page (http://www.nncron.ru/help/EN/working/cron-format.htm).

    To split a live recording every 30 minutes (at the top of each hour and every half-hour):

    0,30 * * * * *
    0,30
    (simplified version)

    To split a live recording every 15 minutes on even hours:

    */15 */2 * * * *
    */15 */2
    (simplified version)

    To split a live recording at 8AM and 6PM:

    0 8,18 * * * *
    0 8,18
    (simplified version)

    Originally Published: 10-02-2010.
    Updated: For Wowza Media Server 3.6.2 on 06-10-2013.

    If you're having problems or want to discuss this article, post in our forum.
    If this article has an error or needs improvement, leave a comment below.

    Comments 356 Comments
    1. dardarlt -
      In documentation it's not clear, where I can find recorded files
    1. rogerlittin -
      The files will be recorded to the content folder. [wowza-path]/content. You can change this path to where ever you want by editing the Streams / StorageDirectory in your Application.xml.
    1. notreg -
      This module is big problem. It don't work correct. When I have problem with network this module don't record properly and I have file without some packets. So difference between timecodes can be huge. Flash don't play such file. If I use live-record application I don't have this problem. What is difference between algorithm this module and algorithm live-record application. Can I fix this module?
    1. rrlanham -
      I think the problem is the network outage. Source code is included in the package which you could add packet checking to and stop recording if necessary, adapting code from this:
      http://www.wowza.com/forums/content....tream-Watchdog

      Richard
    1. alexportella -
      But if we have Wooza 2.2.3 with the live-recording, why do we need this module? What's the difference?
    1. rrlanham -
      With StreamType "live-record" every live stream that is published to an application will be recorded from start to finish. With LiveStreamRecord you start and stop recording on a stream by stream basis. So only portions of some streams are recorded.

      Richard
    1. rrlanham -
      Instructions are in the package. You use StreamType "live" in the Application.xml

      Richard
    1. digibones -
      Hi Richard,

      Is there indeed a difference between the *-record application algorithm and the livestreamrecord module as notreg asks? or do they use the same underlying record class..

      Also can i put the livestreamrecord properties ie 'format=mp4' in Application.xml rather than sending record options in the flash client nc.call

      Thanks
      Henry
    1. rrlanham -
      Henry,

      I think it's the same at that level.

      You can't use Application.xml Property for that way with the LiveStreamRecord package as-is. But you can modify it to do that. Source code is available. You need the Wowza IDE

      Richard
    1. notreg -
      Hey, there!

      If I use MP4 recorder from this module is it means f4v? So it can't be play in QT locally in many cases. What a difference between FLV and MP4 recorders provided by this module?

      If I use FLV recorder for h264 or MP4 recorder for h264 what make difference between files? Can I use either FLV or MP4 recorders or specific one?
    1. rrlanham -
      Wowza records to mp4 container. somefile.mp4 You should use mp4 container if the video is h.264 and you want to playback on iOS devices, Silverlight, RTSP, etc. If you record to flv you can only play in Flash.

      Richard
    1. Chabalab -
      Do you have a AS3 version of the client for Flex
    1. rrlanham -
      All Flex apps are AS3.

      Richard
    1. davidlgood -
      Richard

      I'm using the Live Stream Recorder to record my live streams to the "content" directory. Everything works perfectly. Re-streaming using VOD works perfectly as well.

      When the event is over, however, I pull the file from the server to my personal computer. The file doesn't seem to want to play, or even open, in anything other than QuickTime OSX. So, while I can technical view the file on my computer (using QT OSX) I can not edit it with any other application (if I wanted to trim the beginning/end of the clip, for example).

      When I try to open the file in a Quicktime-compliant application I get an error, like the following from QuickTime (non-OSX version): "An invalid public movie atom was found in the movie."

      I'd like to keep these files for archival purposes, or place them elsewhere for download/viewing (non-streaming) should they be required, but I can't do that with the files I'm getting from the Live Stream Record.

      Is there anything I can do within the Wowza server to create properly-formed .MP4 containers for playback in a non-streaming environment (which I assume requires a proper atom in the file).

      Thanks!
    1. mustihi83 -
      Hello,

      I want to set the output file name as [streamname]-[date].[extension]

      in which of the functions recordStream() or startRecording() should I change? They seem to be calling each other and I'm confused.

      bye,
      Mustafa
    1. rrlanham -
      I can't remember off-hand. Try it in different places to see what works. This method also should work for changing a name after recording:

      http://www.wowza.com/forums/content....write-listener


      Richard
    1. mustihi83 -
      Hi Richard,

      I tried many places, but couldn't make it work as desired. Can you please have a look?

      Is it possible to change the name of the recorded file according to the date with the ModuleMediaWriterFileMover?

      bye,
      Mustafa
    1. rrlanham -
      I don't see a way to append date to the name using the built-in/configurable version of ModuleMediaWriterFileMover.

      You would have to build the example code in the Wowza IDE to do it.

      Richard
    1. mustihi83 -
      Hi Richard,

      yes I wisht to edit the code and build it in the Wowza IDE. But I don't know what to edit? What should I change in the code?

      bye,
      Mustafa
    1. rrlanham -
      Mustafa,

      You can control outputPath in the Flash client. See the recordOptions that are passed to Wowza in netConnection.call("startRecording",null, recordOptions)

      Richard