开发者

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 sett开发者_开发知识库ings, 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


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) 
    
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜