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.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `mBitrate`
    `protected int` | `mGop`
    `protected VideoQuality` | `mVideoQuality`

  - ### 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.
    `int` | `getGop()` Gets the GOP size in frames
    `int` | `getVideoBitrate()` Get the video bitrate.
    `VideoCodecs` | `getVideoCodec()` Gets the encoder type.
    `int` | `getVideoHeight()` Gets the height of the video.
    `VideoQuality` | `getVideoQuality()` Get the video quality.
    `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.
    `int` | `setGop(int gop)` Sets the GOP size in frames, that is, the number of frames between two I-frames.
    `int` | `setVideoBitrate(int bitrate)` Sets the video bitrate.
    `void` | `setVideoCodec(VideoCodecs videoCodec)` Sets the encoder type.
    `int` | `setVideoHeight(int videoHeight)` Sets the height of the video.
    `void` | `setVideoQuality(VideoQuality quality)` Sets the video quality.
    `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`

- - ### Field Detail

    - #### mGop

          protected int mGop

    - #### mBitrate

          protected int mBitrate

    - #### mVideoQuality

          protected VideoQuality mVideoQuality

  - ### 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.

    - #### getVideoQuality

          public VideoQuality getVideoQuality()

      Get the video quality.

      Added in v3.27.0

      See Also:
        `VideoQuality`

    - #### setVideoQuality

          public void setVideoQuality(VideoQuality quality)

      Sets the video quality. This setting affects the video bitrate.

      Added in v3.27.0

      Parameters:
        `quality` - The quality of the video.
      See Also:
        `VideoQuality`

    - #### getGop

          public int getGop()

      Gets the GOP size in frames

      Added in v3.27.0

    - #### setGop

          public int setGop(int gop)

      Sets the GOP size in frames, that is, the number of frames between two I-frames. In hardware encoders, the GOP is measured in seconds, that is, the time interval between two I-frames. The acutal GOP is calculated by dividing the GOP size in frames by the frame rate and rounding the result down to the nearest integer. For example, if the frame rate is set to 25 FPS and this method sets the GOP size to 125 frames. The acutal GOP is 5 seconds, that is, one I-frame per 5 seconds. If the GOP size in frames is smaller than the frame rate value, the acutal GOP is 1.

      Added in v3.27.0

      Parameters:
        `gop` - Valid values: [0, 9,000] When this parameter is set to 0, full I-frames may be possible depending on the device type.

    - #### getVideoBitrate

          public int getVideoBitrate()

      Get the video bitrate.

      Added in v3.27.0

    - #### setVideoBitrate

          public int setVideoBitrate(int bitrate)

      Sets the video bitrate. Valid values: [200, 20,000]. Unit: kbit/s. If the bitrate exceeds the recommended maximum value, the bitrate specified in the input parameter may not take effect in some hardware encoders. For example, for a resolution of 1280 x 720 pixels, a bitrate of 4 Mbit/s should be enough. If the bitrate is set to 10 Mbit/s, the acutal bitrate may still be 4 Mbit/s depending on the encoder.
      Parameters:
        `bitrate` -