Adelchi
Adelchi

Reputation: 63

Camera MediaRecorder / CamcorderProfile

This is my problem, I'm developing a software that uses the camera and records video, everything is working but I cannot spot how to manage the settings, for example I've got a Samsung galaxy S that can record video at 1280x720, but when I set this resolution with:

CamcorderProfile profile;
profile = CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH);
profile.videoFrameWidth = 1280;
profile.videoFrameHeight = 720;
profile.videoFrameRate = 30;
recorder.setProfile(profile);

the logcat shows these messages:

01-17 14:22:28.706: WARN/AuthorDriver(2782): Intended video encoding frame width (1280) is too large and will be set to (128849019680)

01-17 14:22:28.706: WARN/AuthorDriver(2782): Intended video encoding frame height (720) is too large and will be set to (1078895784755680)

and the parameters are automatically scaled to 800x480

Upvotes: 2

Views: 3671

Answers (1)

bluefalcon
bluefalcon

Reputation: 4235

Not exactly sure why you are using CamcorderProfile, the android doc mentions that this is read only.

If you want to set the video recording size to 1280x720 then

  • Get the list of supported video size from the camera parameters (just to be sure chk the size you want to set is supported by the device)-

    public List<Camera.Size> getSupportedVideoSizes () 
    
  • Then call set video size on the media recorder -

    public void setVideoSize (int width, int height) 
    

Upvotes: 2

Related Questions