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_1080P Quality level corresponding to the 1080p (1920 x 1088) resolution.
int QUALITY_480P Quality level corresponding to the 480p (720 x 480) resolution.
int QUALITY_720P Quality level corresponding to the 720p (1280 x 720) resolution.
int QUALITY_CIF Quality level corresponding to the cif (352 x 288) resolution.
int QUALITY_HIGH Quality level corresponding to the highest available resolution.
int QUALITY_LOW Quality level corresponding to the lowest available resolution.
int QUALITY_QCIF Quality level corresponding to the qcif (176 x 144) resolution.
int QUALITY_TIME_LAPSE_1080P Time lapse quality level corresponding to the 1080p (1920 x 1088) resolution.
int QUALITY_TIME_LAPSE_480P Time lapse quality level corresponding to the 480p (720 x 480) resolution.
int QUALITY_TIME_LAPSE_720P Time lapse quality level corresponding to the 720p (1280 x 720) resolution.
int QUALITY_TIME_LAPSE_CIF Time lapse quality level corresponding to the cif (352 x 288) resolution.
int QUALITY_TIME_LAPSE_HIGH Time lapse quality level corresponding to the highest available resolution.
int QUALITY_TIME_LAPSE_LOW Time lapse quality level corresponding to the lowest available resolution.
int QUALITY_TIME_LAPSE_QCIF Time lapse quality level corresponding to the qcif (176 x 144) resolution.
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.
static boolean hasProfile(int quality)
Returns true if camcorder profile exists for the first back-facing camera at the given quality level.
static boolean hasProfile(int cameraId, int quality)
Returns true if camcorder profile exists for the given camera at the given quality level.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int QUALITY_1080P

Since: API Level 11

Quality level corresponding to the 1080p (1920 x 1088) resolution.

Constant Value: 6 (0x00000006)

public static final int QUALITY_480P

Since: API Level 11

Quality level corresponding to the 480p (720 x 480) resolution.

Constant Value: 4 (0x00000004)

public static final int QUALITY_720P

Since: API Level 11

Quality level corresponding to the 720p (1280 x 720) resolution.

Constant Value: 5 (0x00000005)

public static final int QUALITY_CIF

Since: API Level 11

Quality level corresponding to the cif (352 x 288) resolution.

Constant Value: 3 (0x00000003)

public static final int QUALITY_HIGH

Since: API Level 8

Quality level corresponding to the highest available resolution.

Constant Value: 1 (0x00000001)

public static final int QUALITY_LOW

Since: API Level 8

Quality level corresponding to the lowest available resolution.

Constant Value: 0 (0x00000000)

public static final int QUALITY_QCIF

Since: API Level 11

Quality level corresponding to the qcif (176 x 144) resolution.

Constant Value: 2 (0x00000002)

public static final int QUALITY_TIME_LAPSE_1080P

Since: API Level 11

Time lapse quality level corresponding to the 1080p (1920 x 1088) resolution.

Constant Value: 1006 (0x000003ee)

public static final int QUALITY_TIME_LAPSE_480P

Since: API Level 11

Time lapse quality level corresponding to the 480p (720 x 480) resolution.

Constant Value: 1004 (0x000003ec)

public static final int QUALITY_TIME_LAPSE_720P

Since: API Level 11

Time lapse quality level corresponding to the 720p (1280 x 720) resolution.

Constant Value: 1005 (0x000003ed)

public static final int QUALITY_TIME_LAPSE_CIF

Since: API Level 11

Time lapse quality level corresponding to the cif (352 x 288) resolution.

Constant Value: 1003 (0x000003eb)

public static final int QUALITY_TIME_LAPSE_HIGH

Since: API Level 11

Time lapse quality level corresponding to the highest available resolution.

Constant Value: 1001 (0x000003e9)

public static final int QUALITY_TIME_LAPSE_LOW

Since: API Level 11

Time lapse quality level corresponding to the lowest available resolution.

Constant Value: 1000 (0x000003e8)

public static final int QUALITY_TIME_LAPSE_QCIF

Since: API Level 11

Time lapse quality level corresponding to the qcif (176 x 144) resolution.

Constant Value: 1002 (0x000003ea)

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
See Also

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. Quality levels QUALITY_LOW, QUALITY_HIGH are guaranteed to be supported, while other levels may or may not be supported. The supported levels can be checked using hasProfile(int, int). QUALITY_LOW refers to the lowest quality available, while QUALITY_HIGH refers to the highest quality available. QUALITY_LOW/QUALITY_HIGH have to match one of qcif, cif, 480p, 720p, or 1080p. E.g. if the device supports 480p, 720p, and 1080p, then low is 480p and high is 1080p. The same is true for time lapse quality levels, i.e. QUALITY_TIME_LAPSE_LOW, QUALITY_TIME_LAPSE_HIGH are guaranteed to be supported and have to match one of qcif, cif, 480p, 720p, or 1080p. A camcorder recording session with higher 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 lower quality level.

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

public static boolean hasProfile (int quality)

Since: API Level 11

Returns true if camcorder profile exists for the first back-facing camera at the given quality level.

Parameters
quality the target quality level for the camcorder profile

public static boolean hasProfile (int cameraId, int quality)

Since: API Level 11

Returns true if camcorder profile exists 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