相机媒体记录器/摄像机配置文件

发布于 2024-10-12 03:14:12 字数 724 浏览 1 评论 0原文

这是我的问题,我正在开发一个使用相机并录制视频的软件,一切正常,但我无法发现如何管理设置,例如我有一个三星 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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

那些过往 2024-10-19 03:14:12

不太清楚为什么你要使用 CamcorderProfile,android 文档提到这是只读的。

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

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

    公共列表获取支持的视频大小 () 
    
  • 然后在媒体记录器上调用设置视频尺寸-

    public void setVideoSize(int 宽度, int 高度) 
    

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) 
    
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文