【问题标题】:Camera MediaRecorder / CamcorderProfileCamera MediaRecorder / CamcorderProfile
【发布时间】:2013-04-04 16:29:00
【问题描述】:

这是我的问题,我正在开发一个使用相机和录制视频的软件,一切正常,但我不知道如何管理设置,例如我有一个可以录制视频的三星 Galaxy S 1280x720,但是当我设置此分辨率时:

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

logcat 显示以下消息:

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)

参数自动缩放到800x480

【问题讨论】:

    标签: android camera mediarecorder


    【解决方案1】:

    不完全确定您为什么使用 CamcorderProfile,android 文档提到这是只读的。

    如果您想将视频录制尺寸设置为 1280x720 那么

    • 从相机参数中获取支持的视频大小列表(只是为了确保设备支持您要设置的大小)-

      public List<Camera.Size> getSupportedVideoSizes () 
      
    • 然后在媒体记录器上调用 set video size -

      public void setVideoSize (int width, int height) 
      

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-05-09
      • 2013-04-08
      • 2015-07-30
      • 1970-01-01
      • 2021-08-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多