Direct Known Subclasses:
JpgImage, PngImage

public class Image extends Video
Describes the basic properties for generating thumbnails from the input video.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of Image class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the range property: The position relative to transform preset start time in the input video at which to stop generating thumbnails.
    Get the start property: The position in the input video from where to start generating thumbnails.
    Get the step property: The intervals at which thumbnails are generated.
    void
    Validates the instance.
    withKeyFrameInterval(Duration keyFrameInterval)
    Set the keyFrameInterval property: The distance between two key frames.
    Set the label property: An optional label for the codec.
    Set the range property: The position relative to transform preset start time in the input video at which to stop generating thumbnails.
    Set the start property: The position in the input video from where to start generating thumbnails.
    Set the step property: The intervals at which thumbnails are generated.
    Set the stretchMode property: The resizing mode - how the input video will be resized to fit the desired output resolution(s).
    Set the syncMode property: The Video Sync Mode.

    Methods inherited from class com.azure.resourcemanager.mediaservices.models.Video

    keyFrameInterval, stretchMode, syncMode

    Methods inherited from class com.azure.resourcemanager.mediaservices.models.Codec

    label

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Image

      public Image()
      Creates an instance of Image class.
  • Method Details

    • start

      public String start()
      Get the start property: The position in the input video from where to start generating thumbnails. The value can be in ISO 8601 format (For example, PT05S to start at 5 seconds), or a frame count (For example, 10 to start at the 10th frame), or a relative value to stream duration (For example, 10% to start at 10% of stream duration). Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of the video and will only produce one thumbnail, no matter what other settings are for Step and Range. The default value is macro {Best}.
      Returns:
      the start value.
    • withStart

      public Image withStart(String start)
      Set the start property: The position in the input video from where to start generating thumbnails. The value can be in ISO 8601 format (For example, PT05S to start at 5 seconds), or a frame count (For example, 10 to start at the 10th frame), or a relative value to stream duration (For example, 10% to start at 10% of stream duration). Also supports a macro {Best}, which tells the encoder to select the best thumbnail from the first few seconds of the video and will only produce one thumbnail, no matter what other settings are for Step and Range. The default value is macro {Best}.
      Parameters:
      start - the start value to set.
      Returns:
      the Image object itself.
    • step

      public String step()
      Get the step property: The intervals at which thumbnails are generated. The value can be in ISO 8601 format (For example, PT05S for one image every 5 seconds), or a frame count (For example, 30 for one image every 30 frames), or a relative value to stream duration (For example, 10% for one image every 10% of stream duration). Note: Step value will affect the first generated thumbnail, which may not be exactly the one specified at transform preset start time. This is due to the encoder, which tries to select the best thumbnail between start time and Step position from start time as the first output. As the default value is 10%, it means if stream has long duration, the first generated thumbnail might be far away from the one specified at start time. Try to select reasonable value for Step if the first thumbnail is expected close to start time, or set Range value at 1 if only one thumbnail is needed at start time.
      Returns:
      the step value.
    • withStep

      public Image withStep(String step)
      Set the step property: The intervals at which thumbnails are generated. The value can be in ISO 8601 format (For example, PT05S for one image every 5 seconds), or a frame count (For example, 30 for one image every 30 frames), or a relative value to stream duration (For example, 10% for one image every 10% of stream duration). Note: Step value will affect the first generated thumbnail, which may not be exactly the one specified at transform preset start time. This is due to the encoder, which tries to select the best thumbnail between start time and Step position from start time as the first output. As the default value is 10%, it means if stream has long duration, the first generated thumbnail might be far away from the one specified at start time. Try to select reasonable value for Step if the first thumbnail is expected close to start time, or set Range value at 1 if only one thumbnail is needed at start time.
      Parameters:
      step - the step value to set.
      Returns:
      the Image object itself.
    • range

      public String range()
      Get the range property: The position relative to transform preset start time in the input video at which to stop generating thumbnails. The value can be in ISO 8601 format (For example, PT5M30S to stop at 5 minutes and 30 seconds from start time), or a frame count (For example, 300 to stop at the 300th frame from the frame at start time. If this value is 1, it means only producing one thumbnail at start time), or a relative value to the stream duration (For example, 50% to stop at half of stream duration from start time). The default value is 100%, which means to stop at the end of the stream.
      Returns:
      the range value.
    • withRange

      public Image withRange(String range)
      Set the range property: The position relative to transform preset start time in the input video at which to stop generating thumbnails. The value can be in ISO 8601 format (For example, PT5M30S to stop at 5 minutes and 30 seconds from start time), or a frame count (For example, 300 to stop at the 300th frame from the frame at start time. If this value is 1, it means only producing one thumbnail at start time), or a relative value to the stream duration (For example, 50% to stop at half of stream duration from start time). The default value is 100%, which means to stop at the end of the stream.
      Parameters:
      range - the range value to set.
      Returns:
      the Image object itself.
    • withKeyFrameInterval

      public Image withKeyFrameInterval(Duration keyFrameInterval)
      Set the keyFrameInterval property: The distance between two key frames. The value should be non-zero in the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval value will follow the input source setting.
      Overrides:
      withKeyFrameInterval in class Video
      Parameters:
      keyFrameInterval - the keyFrameInterval value to set.
      Returns:
      the Video object itself.
    • withStretchMode

      public Image withStretchMode(StretchMode stretchMode)
      Set the stretchMode property: The resizing mode - how the input video will be resized to fit the desired output resolution(s). Default is AutoSize.
      Overrides:
      withStretchMode in class Video
      Parameters:
      stretchMode - the stretchMode value to set.
      Returns:
      the Video object itself.
    • withSyncMode

      public Image withSyncMode(VideoSyncMode syncMode)
      Set the syncMode property: The Video Sync Mode.
      Overrides:
      withSyncMode in class Video
      Parameters:
      syncMode - the syncMode value to set.
      Returns:
      the Video object itself.
    • withLabel

      public Image withLabel(String label)
      Set the label property: An optional label for the codec. The label can be used to control muxing behavior.
      Overrides:
      withLabel in class Video
      Parameters:
      label - the label value to set.
      Returns:
      the Codec object itself.
    • validate

      public void validate()
      Validates the instance.
      Overrides:
      validate in class Video
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.