com.aliyun.svideosdk.common.struct.recorder

## Class MediaInfo

- java.lang.Object
- - com.aliyun.svideosdk.common.struct.recorder.MediaInfo

-     public class MediaInfo
      extends java.lang.Object

  A class that defines recording parameters.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MediaInfo()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getCrf()` Gets the CRF value.
    `int` | `getEncoderFps()`
    `int` | `getFps()` Gets the capture frame rate.
    `VideoCodecs` | `getVideoCodec()` Gets the encoder type.
    `int` | `getVideoHeight()` Gets the height of the video.
    `int` | `getVideoWidth()` Gets the width of the video.
    `int` | `setCrf(int crf)` Sets the CRF value.
    `int` | `setEncoderFps(int encoderFps)` Sets the encoding frame rate.
    `int` | `setFps(int fps)` Sets the capture frame rate.
    `void` | `setVideoCodec(VideoCodecs videoCodec)` Sets the encoder type.
    `int` | `setVideoHeight(int videoHeight)` Sets the height of the video.
    `int` | `setVideoWidth(int videoWidth)` Sets the width of the video.

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

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

- - ### Constructor Detail

    - #### MediaInfo

          public MediaInfo()

  - ### Method Detail

    - #### getVideoWidth

          public int getVideoWidth()

      Gets the width of the video.
      Returns:
        The width of the video.

    - #### setVideoWidth

          public int setVideoWidth(int videoWidth)

      Sets the width of the video.
      Parameters:
        `videoWidth` - The width of the video.
      Returns:
        OK if the specified width is larger than 0. Otherwise, ERROR_INVALID_ARGUMENTS.

    - #### getVideoHeight

          public int getVideoHeight()

      Gets the height of the video.
      Returns:
        The height of the video.

    - #### setVideoHeight

          public int setVideoHeight(int videoHeight)

      Sets the height of the video.
      Parameters:
        `videoHeight` - The height of the video.
      Returns:
        OK if the specified height is larger than 0. Otherwise, ERROR_INVALID_ARGUMENTS.

    - #### getFps

          public int getFps()

      Gets the capture frame rate.
      Returns:

    - #### setFps

          public int setFps(int fps)

      Sets the capture frame rate. The value must be within the range of to . Otherwise, the default value, 30 fps, is used. The actual video frame rate may not be the same as the capture frame rate because different cameras have different processing capabilities.
      Parameters:
        `fps` - The capture frame rate.

    - #### getVideoCodec

          public VideoCodecs getVideoCodec()

      Gets the encoder type.
      Returns:
        The encoder type.

    - #### setVideoCodec

          public void setVideoCodec(VideoCodecs videoCodec)

      Sets the encoder type.
      Parameters:
        `videoCodec` - The encoder type.
      See Also:
        `VideoCodecs`

    - #### getCrf

          public int getCrf()

      Gets the CRF value.
      Returns:
        The CRF value.

    - #### setCrf

          public int setCrf(int crf)

      Sets the CRF value. Default value:
      Parameters:
        `crf` - The value must be within the range of to ]. If an invalid value is specified, the nearest threshold value is used.
      Returns:
        OK if a valid value is specified. Otherwise, ERROR_INVALID_ARGUMENTS.

    - #### getEncoderFps

          public int getEncoderFps()

    - #### setEncoderFps

          public int setEncoderFps(int encoderFps)

      Sets the encoding frame rate. The value must be within the range of to . Otherwise, the default value, 30 fps, is used. The actual video frame rate may not be the same as the encoding frame rate because the actual frame rate is also affected by the capture frame rate and the camera's processing capabilities.
      Parameters:
        `encoderFps` - The encoding frame rate.
      Returns:
        OK if a valid value is specified. Otherwise, ERROR_INVALID_ARGUMENTS.