public class

CamcorderProfile

extends Object
java.lang.Object
   ↳ android.media.CamcorderProfile

Class Overview

The CamcorderProfile class is used to retrieve the predefined camcorder profile settings for camcorder applications. These settings are read-only. The compressed output from a recording session with a given CamcorderProfile contains two tracks: one for auido and one for video.

Each profile specifies the following set of parameters:

  • The file output format
  • Video codec format
  • Video bit rate in bits per second
  • Video frame rate in frames per second
  • Video frame width and height,
  • Audio codec format
  • Audio bit rate in bits per second,
  • Audio sample rate
  • Number of audio channels for recording.

Summary

Constants
int QUALITY_HIGH
int QUALITY_LOW The output from camcorder recording sessions can have different quality levels.
Fields
public int audioBitRate The target audio output bit rate in bits per second
public int audioChannels The number of audio channels used for the audio track
public int audioCodec The audio encoder being used for the audio track.
public int audioSampleRate The audio sampling rate used for the audio track
public int duration Default recording duration in seconds before the session is terminated.
public int fileFormat The file output format of the camcorder profile
public int quality The quality level of the camcorder profile
public int videoBitRate The target video output bit rate in bits per second
public int videoCodec The video encoder being used for the video track
public int videoFrameHeight The target video frame height in pixels
public int videoFrameRate The target video frame rate in frames per second
public int videoFrameWidth The target video frame width in pixels
Public Methods
static CamcorderProfile get(int quality)
Returns the camcorder profile for the first back-facing camera on the device at the given quality level.
static CamcorderProfile get(int cameraId, int quality)
Returns the camcorder profile for the given camera at the given quality level.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int QUALITY_HIGH

Since: API Level 8

Constant Value: 1 (0x00000001)

public static final int QUALITY_LOW

Since: API Level 8

The output from camcorder recording sessions can have different quality levels. Currently, we define two quality levels: high quality and low quality. A camcorder recording session with high quality level usually has higher output bit rate, better video and/or audio recording quality, larger video frame resolution and higher audio sampling rate, etc, than those with low quality level. Do not change these values/ordinals without updating their counterpart in include/media/MediaProfiles.h!

Constant Value: 0 (0x00000000)

Fields

public int audioBitRate

Since: API Level 8

The target audio output bit rate in bits per second

public int audioChannels

Since: API Level 8

The number of audio channels used for the audio track

public int audioCodec

Since: API Level 8

The audio encoder being used for the audio track.

public int audioSampleRate

Since: API Level 8

The audio sampling rate used for the audio track

public int duration

Since: API Level 8

Default recording duration in seconds before the session is terminated. This is useful for applications like MMS has limited file size requirement.

public int fileFormat

Since: API Level 8

The file output format of the camcorder profile

public int quality

Since: API Level 8

The quality level of the camcorder profile

public int videoBitRate

Since: API Level 8

The target video output bit rate in bits per second

public int videoCodec

Since: API Level 8

The video encoder being used for the video track

public int videoFrameHeight

Since: API Level 8

The target video frame height in pixels

public int videoFrameRate

Since: API Level 8

The target video frame rate in frames per second

public int videoFrameWidth

Since: API Level 8

The target video frame width in pixels

Public Methods

public static CamcorderProfile get (int quality)

Since: API Level 8

Returns the camcorder profile for the first back-facing camera on the device at the given quality level. If the device has no back-facing camera, this returns null.

Parameters
quality the target quality level for the camcorder profile

public static CamcorderProfile get (int cameraId, int quality)

Since: API Level 9

Returns the camcorder profile for the given camera at the given quality level.

Parameters
cameraId the id for the camera
quality the target quality level for the camcorder profile