Class StreamRecorderParameters


  • public class StreamRecorderParameters
    extends Object
    This class is used to configure the recording parameters for the StreamRecorder class.
    All members of this class are public and therefore can be accessed and modified directly.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      long backBufferTime
      Configures the number of milliseconds of packets to pull from the incoming stream buffer and write to file, before before beginning the recording.
      boolean defaultAudioSearchPosition
      Configures the default search position for audio before starting to record.
      String fileFormat
      Configures the output file format
      String fileTemplate
      Configures the file version template string used by the default fileVersionDelegate, to generate a versioned file name for the recorder
      NOTE: if set to null then a default file template string, as defined by StreamRecorderFileVersionDelegate, will be used
      IStreamRecorderFileVersionDelegate fileVersionDelegate
      Configures the fileVersionDelegate for the recorder
      Valid values are the fully qualified class path to the class which implements the IStreamRecorderFileVersionDelegate interface.
      Default value is com.wowza.wms.livestreamrecord.manager.StreamRecorderFileVersionDelegate
      boolean moveFirstVideoFrameToZero
      Configures whether or not the recorder will set the first packet's timecode to 0, when recording fileFormat is FORMAT_MP4
      IStreamRecorderActionNotify notifyListener
      Configures the StreamRecorder listener for the recorder
      Valid values are the fully qualified class path to the class which implements the IStreamRecorderActionNotify interface.
      String outputFile
      Configures the output file name used for the recording
      If segmentationType is not SEGMENT_NONE, then this value is used as the base file name for the file segments when using either of the fileVersionDelegates
      NOTE 1: When set to null or "", the recorder will create the filename based upon the stream name and the value of fileFormat.
      String outputPath
      Configures the output directory where recorded file will be written
      NOTE: When set to null or "", the recorder will write files to the default content directory for the application.
      boolean recordData
      Configures whether or not the recorder will write data packets to the output file.
      String segmentationType
      Configures the type of recording segmentation the recorder will use
      Segmentation provides a means by which the recording of an incoming live stream can be split into a series of files in order to manage them more easily.
      long segmentDuration
      Configures the output file size in milliseconds for each recording segment, when segmentationType is SEGMENT_BY_DURATION.
      This value is specified in milliseconds
      String segmentSchedule
      Configures the crontab schedule used to segment a recording, when segmentationType is SEGMENT_BY_SCHEDULE.
      long segmentSize
      Configures the output file size in bytes for each recording segment, when segmentationType is SEGMENT_BY_SIZE.
      This value is specified in bytes
      int skipKeyFrameUntilAudioTimeout
      Configures the audio timeout when waiting for audio sync.
      boolean splitOnTcDiscontinuity
      Configures whether or not the recorder will create a new segment for a recording when packet timecode discontinuities are detected
      A discontinuity is said to occur when 10 consecutive packets have timecodes which jump backward in time.
      boolean startOnKeyFrame
      Configures whether or not the recorder will wait until a video key frame is received to start writing packets to the output file, thus ensuring the first packet in the file contains a video key frame.
      long timeScale
      Configures the timescale in milliseconds for the recording
      String versioningOption
      Configures the behavior when a new recording file is created with a name that already exists
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • startOnKeyFrame

        public boolean startOnKeyFrame
        Configures whether or not the recorder will wait until a video key frame is received to start writing packets to the output file, thus ensuring the first packet in the file contains a video key frame.

        Valid values are true, false
        default value is true

      • recordData

        public boolean recordData
        Configures whether or not the recorder will write data packets to the output file.

        Valid values are true, false
        default value is false

      • moveFirstVideoFrameToZero

        public boolean moveFirstVideoFrameToZero
        Configures whether or not the recorder will set the first packet's timecode to 0, when recording fileFormat is FORMAT_MP4

        Valid values are true, false
        default value is true

      • splitOnTcDiscontinuity

        public boolean splitOnTcDiscontinuity
        Configures whether or not the recorder will create a new segment for a recording when packet timecode discontinuities are detected
        A discontinuity is said to occur when 10 consecutive packets have timecodes which jump backward in time. i.e. the current packet's timecode is less than the previous packet's timecode.

        Valid values are true, false
        default value is false

      • backBufferTime

        public long backBufferTime
        Configures the number of milliseconds of packets to pull from the incoming stream buffer and write to file, before before beginning the recording. This parameter is typically used with manual recordings to mitigate the delay between a start recording request and when data is actually written to file, thus ensuring that the beginning of an event is recorded to file.

        This value is in milliseconds.
        default value is 0
        NOTE: The incoming stream buffer contains approximately 8 seconds of packets

      • segmentSize

        public long segmentSize
        Configures the output file size in bytes for each recording segment, when segmentationType is SEGMENT_BY_SIZE.
        This value is specified in bytes

        Valid values are any positive long value greater than 0, however a minimum size of 1048576 bytes (1 MB) is highly recommended to ensure the recorded file segments can start on a video key frame if configured to do so.
        default value is 10485760 bytes (10 MB)

      • segmentDuration

        public long segmentDuration
        Configures the output file size in milliseconds for each recording segment, when segmentationType is SEGMENT_BY_DURATION.
        This value is specified in milliseconds

        Valid values are any positive long value greater than 0, however a minimum size of 60000 ms (1 minute) is highly recommended to ensure the recorded file segments can start on a video key frame if configured to do so.
        default value is 900000 ms (15 minutes)

      • segmentSchedule

        public String segmentSchedule
        Configures the crontab schedule used to segment a recording, when segmentationType is SEGMENT_BY_SCHEDULE.

        Crontab expressions
        A crontab expression specifies the segmentation 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 segmentation occurs.
        Hour - Specifies the hour (between 0 and 23 based on a 24-hour clock) at which the segmentation occurs.
        Day_of_the_Month - Specifies the day (between 0 and 31) at which the split occurs. To specify that live recordings always be segmentation on the last day of the month, specify 31.
        Month_of_the_Year - Specifies the month at which the segmentation 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 segmentation 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 segmentation occurs (for example, 2013).

        Example
        To segmentation a live recording every 30 minutes (at the top of each hour and every half-hour):
        0,30 * * * * *
        0,30 (simplified version)

        for more details see (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 NOT currently supported.

        Valid values are any valid crontab expression exception for '?'
        default value is "0 * * * * *" (segment every hour at the top of the hour)

      • outputFile

        public String outputFile
        Configures the output file name used for the recording
        If segmentationType is not SEGMENT_NONE, then this value is used as the base file name for the file segments when using either of the fileVersionDelegates
        NOTE 1: When set to null or "", the recorder will create the filename based upon the stream name and the value of fileFormat. NOTE 2: The fileFormat will be appended to the file name to ensure the file extension matches the actual file format written.

        Example mytestRecording, with no fileFormat specified will result in the default fileFormat being used and a recorded file name of mytestRecording.mp4 myOtherTest.mp4, with the the fileFormat specified as 1 (FLV), will result in the recorded file name of myOtherTest.mp4.flv

        Valid values are any valid filename
        default value is null

      • outputPath

        public String outputPath
        Configures the output directory where recorded file will be written
        NOTE: When set to null or "", the recorder will write files to the default content directory for the application.

        Examples c:\myfiles\recordings /home/user/myfiles/recordings

        Valid values are any valid path.
        default value is null

      • notifyListener

        public IStreamRecorderActionNotify notifyListener
        Configures the StreamRecorder listener for the recorder
        Valid values are the fully qualified class path to the class which implements the IStreamRecorderActionNotify interface. default value is null

        See Also:
        IStreamRecorderActionNotify
      • fileTemplate

        public String fileTemplate
        Configures the file version template string used by the default fileVersionDelegate, to generate a versioned file name for the recorder
        NOTE: if set to null then a default file template string, as defined by StreamRecorderFileVersionDelegate, will be used

        Valid values are null or a valid file version template string
        Default value is null

        See Also:
        StreamRecorderFileVersionDelegate
      • timeScale

        public long timeScale
        Configures the timescale in milliseconds for the recording

        This value is in milliseconds.
        default value is 90000
        NOTE: There are only two valid values 90000 and 100000

      • defaultAudioSearchPosition

        public boolean defaultAudioSearchPosition
        Configures the default search position for audio before starting to record.
        Default value is LiveStreamRecorderBase.DEFAULT_FORCE_AUDIO_SEARCH
      • skipKeyFrameUntilAudioTimeout

        public int skipKeyFrameUntilAudioTimeout
        Configures the audio timeout when waiting for audio sync. This value is in milliseconds.
        default balue is LiveStreamRecorderBase.DEFAULT_SKIPKEYFRAMESUNTILAUDIOTIMEOUT
    • Constructor Detail

      • StreamRecorderParameters

        public StreamRecorderParameters​(IApplicationInstance appInstance)
        The constructor will read any defaults set via properties in application.xml and will use those values as the default values for this class.
        Parameters:
        appInstance -
      • StreamRecorderParameters

        public StreamRecorderParameters​(IApplicationInstance appInstance,
                                        StreamRecorderParameters params)
        The constructor will copy another StreamRecorderParameters object.
        Parameters:
        appInstance -
        params -