com.aliyun.svideosdk.crop

## Class CropParam

- java.lang.Object
- - com.aliyun.svideosdk.crop.CropParam

-     public class CropParam
      extends java.lang.Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CropParam()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getCrf()` Gets the CRF value.
    `Rect` | `getCropRect()` Gets the crop rectangle.
    `long` | `getEndTime()` Gets the end time of cropping.
    `long` | `getEndTime(java.util.concurrent.TimeUnit timeUnit)` Gets the end time of cropping.
    `int` | `getFillColor()` Gets the fill color.
    `int` | `getFrameRate()` Gets the frame rate.
    `int` | `getGop()` Gets the GOP size.
    `java.lang.String` | `getInputPath()` Gets the video file path.
    `MediaType` | `getMediaType()` Gets the media type.
    `int` | `getOutputHeight()` Gets the output height.
    `java.lang.String` | `getOutputPath()` Gets the video output path.
    `int` | `getOutputWidth()` Gets the output width.
    `VideoQuality` | `getQuality()` Gets the video quality.
    `VideoDisplayMode` | `getScaleMode()` Gets the video display mode.
    `long` | `getStartTime()` Gets the start time of cropping.
    `long` | `getStartTime(java.util.concurrent.TimeUnit timeUnit)` Gets the start time of cropping.
    `int` | `getvideobitrate()` Gets the bitrate.
    `VideoCodecs` | `getVideoCodec()` Gets the encoder.
    `java.lang.String` | `getVideoPath()` Deprecated.
    `boolean` | `isUseGPU()` Deprecated.
    `void` | `setCrf(int crf)` Sets the CRF value.
    `void` | `setCropRect(Rect cropRect)` Sets the crop rectangle.
    `void` | `setEndTime(long endTime)` Sets the end time of cropping.
    `void` | `setEndTime(long endTime, java.util.concurrent.TimeUnit timeUnit)` Sets the end time of cropping.
    `void` | `setFillColor(int fillColor)` Sets the fill color.
    `void` | `setFrameRate(int frameRate)` Sets the frame rate.
    `void` | `setGop(int gop)` Sets the GOP size.
    `void` | `setInputPath(java.lang.String inputPath)` Sets the video file path.
    `void` | `setMediaType(MediaType mediaType)` Sets the media type.
    `void` | `setOutputHeight(int outputHeight)` Sets the output height.
    `void` | `setOutputPath(java.lang.String outputPath)` Sets the video output path.
    `void` | `setOutputWidth(int outputWidth)` Sets the output width.
    `void` | `setQuality(VideoQuality quality)` Sets the video quality.
    `void` | `setScaleMode(VideoDisplayMode scaleMode)` Sets the video display mode.
    `void` | `setStartTime(long startTime)` Sets the start time of cropping.
    `void` | `setStartTime(long startTime, java.util.concurrent.TimeUnit timeUnit)` Sets the start time of cropping.
    `void` | `setUseGPU(boolean useGPU)` Deprecated.
    `void` | `setVideoBitrate(int bitrate)` Sets the bitrate.
    `void` | `setVideoCodec(VideoCodecs videoCodec)` Sets the encoder.
    `void` | `setVideoPath(java.lang.String inputPath)` Deprecated.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CropParam

          public CropParam()

  - ### Method Detail

    - #### getQuality

          public VideoQuality getQuality()

      Gets the video quality.
      Returns:
        The video quality.

    - #### setQuality

          public void setQuality(VideoQuality quality)

      Sets the video quality. 0：Very high 1：High 2：Medium 3：Low
      Parameters:
        `quality` -

    - #### setVideoBitrate

          public void setVideoBitrate(int bitrate)

      Sets the bitrate. Unit: Kbit/s
      Parameters:
        `bitrate` -

    - #### getvideobitrate

          public int getvideobitrate()

      Gets the bitrate.
      Returns:
        The bitrate. Unit: Kbit/s

    - #### getFrameRate

          public int getFrameRate()

      Gets the frame rate. Unit: FPS
      Returns:
        The frame rate.

    - #### setFrameRate

          public void setFrameRate(int frameRate)

      Sets the frame rate. Unit: FPS
      Parameters:
        `frameRate` -

    - #### getGop

          public int getGop()

      Gets the GOP size.
      Returns:
        gop大小

    - #### setGop

          public void setGop(int gop)

      Sets the GOP size.
      Parameters:
        `gop` - Unit: frames. The time interval between key frames is calculated by dividing the GOP size by the frame rate.

    - #### getScaleMode

          public VideoDisplayMode getScaleMode()

      Gets the video display mode. When the display mode is set to `VideoDisplayMode.FILL`, `setCropRect(Rect)` is invalid.
      Returns:
        The video display mode.
      See Also:
        `VideoDisplayMode`

    - #### setScaleMode

          public void setScaleMode(VideoDisplayMode scaleMode)

      Sets the video display mode.
      Parameters:
        `scaleMode` -

    - #### getVideoPath

          public java.lang.String getVideoPath()

      Deprecated.
      Gets the video file path. This method is replaced by `getInputPath()`.
      Returns:
        The video file path.

    - #### getInputPath

          public java.lang.String getInputPath()

      Gets the video file path.
      Returns:
        The video file path in a string.

    - #### setVideoPath

          public void setVideoPath(java.lang.String inputPath)

      Deprecated.
      Sets the video file path. This method is replaced by `setInputPath(String)`.
      Parameters:
        `inputPath` -

    - #### setInputPath

          public void setInputPath(java.lang.String inputPath)

      Sets the video file path.
      Parameters:
        `inputPath` -

    - #### getOutputPath

          public java.lang.String getOutputPath()

      Gets the video output path.
      Returns:
        The video output path.

    - #### setOutputPath

          public void setOutputPath(java.lang.String outputPath)

      Sets the video output path.
      Parameters:
        `outputPath` -

    - #### getOutputWidth

          public int getOutputWidth()

      Gets the output width.
      Returns:
        The output width.

    - #### setOutputWidth

          public void setOutputWidth(int outputWidth)

      Sets the output width.
      Parameters:
        `outputWidth` -

    - #### getOutputHeight

          public int getOutputHeight()

      Gets the output height.
      Returns:
        The output height.

    - #### setOutputHeight

          public void setOutputHeight(int outputHeight)

      Sets the output height.
      Parameters:
        `outputHeight` -

    - #### getStartTime

          public long getStartTime()

      Gets the start time of cropping. Unit: microseconds.
      Returns:
        The start time of cropping.

    - #### getStartTime

          public long getStartTime(java.util.concurrent.TimeUnit timeUnit)

      Gets the start time of cropping.

      Added in v3.27.0

      Returns:
        The start time of cropping.

    - #### setStartTime

          public void setStartTime(long startTime)

      Sets the start time of cropping.
      Parameters:
        `startTime` - Unit: microseconds.

    - #### setStartTime

          public void setStartTime(long startTime,
                                   java.util.concurrent.TimeUnit timeUnit)

      Sets the start time of cropping.

      Added in v3.27.0

      Parameters:
        `startTime` -
        `timeUnit` - Time Unit

    - #### getEndTime

          public long getEndTime()

      Gets the end time of cropping. Unit: microseconds.
      Returns:
        The end time of cropping.

    - #### getEndTime

          public long getEndTime(java.util.concurrent.TimeUnit timeUnit)

      Gets the end time of cropping. Unit: milliseconds.

      Added in v3.27.0

      Returns:
        The end time of cropping.

    - #### setEndTime

          public void setEndTime(long endTime)

      Sets the end time of cropping.
      Parameters:
        `endTime` - Unit: microseconds.

    - #### setEndTime

          public void setEndTime(long endTime,
                                 java.util.concurrent.TimeUnit timeUnit)

      Sets the end time of cropping.

      Added in v3.27.0

      Parameters:
        `endTime` -
        `timeUnit` - Time Unit

    - #### getCropRect

          public Rect getCropRect()

      Gets the crop rectangle.
      Returns:
        裁剪区域

    - #### setCropRect

          public void setCropRect(Rect cropRect)

      Sets the crop rectangle.
      Parameters:
        `cropRect` - The size of the crop rectangle must not be larger than the video resolution.

    - #### getMediaType

          public MediaType getMediaType()

      Gets the media type.
      Returns:
        `MediaType.ANY_AUDIO_TYPE` indicates audio. `MediaType.ANY_IMAGE_TYPE` indicates images. `MediaType.ANY_VIDEO_TYPE` indicates video.

    - #### setMediaType

          public void setMediaType(MediaType mediaType)

      Sets the media type.
      Parameters:
        `mediaType` - `MediaType.ANY_AUDIO_TYPE` indicates audio. `MediaType.ANY_IMAGE_TYPE` indicates images. `MediaType.ANY_VIDEO_TYPE` indicates video.

    - #### getFillColor

          public int getFillColor()

      Gets the fill color.
      Returns:
        The fill color in ARGB format. An 8-bit integer.

    - #### isUseGPU

          @Deprecated
          public boolean isUseGPU()

      Deprecated.

    - #### setUseGPU

          @Deprecated
          public void setUseGPU(boolean useGPU)

      Deprecated.

    - #### setFillColor

          public void setFillColor(int fillColor)

      Sets the fill color. This method only takes effect when `mScaleMode` is set to `VideoDisplayMode.FILL`.
      Parameters:
        `fillColor` - 8位，按照ARGB的格式

    - #### getVideoCodec

          public VideoCodecs getVideoCodec()

      Gets the encoder.
      Returns:
        @see VideoCodecs

    - #### setVideoCodec

          public void setVideoCodec(VideoCodecs videoCodec)

      Sets the encoder.
      Parameters:
        `videoCodec` - @see VideoCodecs

    - #### getCrf

          public int getCrf()

      Gets the CRF value.
      Returns:
        The quality setting of ffmpeg video. The lower the CRF value, the higher the video quality and the larger the file size. Default value: 23

    - #### setCrf

          public void setCrf(int crf)

      Sets the CRF value.
      Parameters:
        `crf` - The quality setting of ffmpeg video. The lower the CRF value, the higher the video quality and the larger the file size. Default value: 23