相机媒体记录器/摄像机配置文件
这是我的问题,我正在开发一个使用相机并录制视频的软件,一切正常,但我无法发现如何管理设置,例如我有一个三星 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不太清楚为什么你要使用 CamcorderProfile,android 文档提到这是只读的。
如果您想将视频录制尺寸设置为 1280x720,则
从相机参数中获取支持的视频尺寸列表(只是为了确保设备支持您要设置的尺寸)-
然后在媒体记录器上调用设置视频尺寸-
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)-
Then call set video size on the media recorder -