Profile

Starting with Android 2.2 (API Level 8), MediaRecorder has a method, setProfile, which takes in an instance of CamcorderProfile. CamcorderProfile has a static method, CamcorderProfile.get, which takes in an integer with the possible values being defined as constants, CamcorderProfile.QUALITY_HIGH or CamcorderProfile.QUALITY_LOW. Using this method allows us to set an entire set of configuration variables according to preset values. Of course, QUALITY_HIGH refers to settings for high-quality video capture, and QUALITY_LOW refers to settings for low-quality video capture.

QUALITY_HIGH has the following settings:

■ Audio Bit Rate: 12,200 bits per second

■ Audio Sample Rate: 8000 Hz

■ Duration: 60 seconds

■ Video Bit Rate: 3,000,000 bits per second

■ Video Frame Width: 720 pixels

■ Video Frame Height: 480 pixels

■ Video Frame Rate: 24 frames per second

Take note that as described previously, many of the settings are maximum or requested and the capabilities of the device will dictate the results. For instance, a sample video captured using the QUALITY_HIGH settings on a Nexus 1 running Android 2.2.1 yielded video at 12.6 frames per second and a total bitrate of 1,617.34 kb/second.

Here are the QUALITY_LOW settings:

■ Audio Bit Rate: 12,200 bits per second

■ Audio Sample Rate: 8000 Hz

■ Duration: 30 seconds

■ Video Bit Rate: 256,000 bits per second

■ Video Frame Width: 176 pixels

■ Video Frame Height: 144 pixels

■ Video Frame Rate: 15 frames per second

As with the QUALITY_HIGH version, these settings yield slightly different results as well. The resulting video was captured at 16.06 frames per second with a bitrate of 207.96 kb/second.

Was this article helpful?

0 0

Post a comment