Android摄像头捕获生产绿色环保和斑驳的 [英] Android camera capture produces green and blocky video

查看:103
本文介绍了Android摄像头捕获生产绿色环保和斑驳的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要拍摄与摄像头的Andr​​oid视频,但任何输出格式,我把生产绿色和斑驳的(尽管与正常的声音)。

I'm trying to record video with camera in android, but any output format i put produces a green and blocky video (though with normal sound)..

因此​​,这里有我的参数设置(我试过H264和mpeg_4_sp太)

So here are the parameters i set (i tried h264 and mpeg_4_sp too)

mediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263);

本机的摄像头采集程序不保存录像确定(并已在配置H263设置)

The native camera capture app does save the video ok (and it has h263 in configurations set)

任何想法,为什么它会发生在我的应用程序?还有没有其他特殊的设置放到这里?

Any ideas why it may occur in my app? Is there any other special settings to put here?

PS:我的Andr​​oid版本,我使用的测试是2.2.1 BiffMod V2.1

ps: my android version i use for test is 2.2.1 with BiffMod v2.1

修改

这是它的外观在Android和PC媒体播放器:

this is how it looks on both Android and PC media players:

推荐答案

好吧,我解决了这个问题我自己。

Ok, i solved the issue myself..

这个问题是在视频分辨率,应该显式设置为320×240(也许还有其他标准尺寸640×480一样都OK了,但是对我来说只有这一个工作得很好) 所以 recorder.setVideoSize(320240); 解决整个绿斑驳的错误

The problem was in the video resolution, it should be explicitly set to 320x240 (perhaps other standard sizes like 640x480 are ok too, but only this one worked fine for me) so recorder.setVideoSize(320,240); solved the whole green blocky video bug

这篇关于Android摄像头捕获生产绿色环保和斑驳的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆