Added in API level 31

EncoderProfiles


class EncoderProfiles
kotlin.Any
   ↳ android.media.EncoderProfiles

Describes a set of encoding profiles for a given media (audio and/or video) profile. These settings are read-only.

Currently, this is used to describe camera recording profile with more detail than CamcorderProfile, by providing encoding parameters for more than just the default audio and/or video codec.

The compressed output from a camera recording session contains two tracks: one for audio and one for video.

In the future audio-only recording profiles may be defined.

Each media profile specifies a set of audio and a set of video specific settings.

  • The file output format
  • Default file duration

    Video-specific settings are:

  • Video codec format
  • Video bit rate in bits per second
  • Video frame rate in frames per second
  • Video frame width and height,
  • Video encoder profile.

    Audio-specific settings are:

  • Audio codec format
  • Audio bit rate in bits per second,
  • Audio sample rate
  • Number of audio channels for recording.

Summary

Nested classes

Configuration for an audio encoder.

Configuration for a video encoder.

Public methods
MutableList<EncoderProfiles.AudioProfile!>

Returns the defined audio encoder profiles.

Int

Default recording duration in seconds before the session is terminated.

Int

Recommended output file format

MutableList<EncoderProfiles.VideoProfile!>

Returns the defined video encoder profiles.

Public methods

getAudioProfiles

Added in API level 31
fun getAudioProfiles(): MutableList<EncoderProfiles.AudioProfile!>

Returns the defined audio encoder profiles.

The list may be empty. This means there are no audio encoder profiles defined. Otherwise, the first profile is the default audio profile.

Return
MutableList<EncoderProfiles.AudioProfile!> This value cannot be null.

getDefaultDurationSeconds

Added in API level 31
fun getDefaultDurationSeconds(): Int

Default recording duration in seconds before the session is terminated. This is useful for applications like MMS that have a limited file size requirement. This could be 0 if there is no default recording duration.

getVideoProfiles

Added in API level 31
fun getVideoProfiles(): MutableList<EncoderProfiles.VideoProfile!>

Returns the defined video encoder profiles.

The list may be empty. This means there are no video encoder profiles defined. Otherwise, the first profile is the default video profile.

Return
MutableList<EncoderProfiles.VideoProfile!> This value cannot be null.