0

我有 android 4.0 的平板电脑 acer a500。

我可以通过(目标尺寸:176x144)录制视频:

_recorder = new MediaRecorder();
camera.unlock();
_recorder.setCamera(camera);
_recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
_recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
_recorder.setVideoEncoder(MediaRecorder.VideoEncoder.DEFAULT);
_recorder.setOutputFile(outputPath);
_recorder.setPreviewDisplay(surface);
_recorder.prepare();

但我想改变录制视频的大小。

具有下一个支持的尺寸:

front
previewSize support size: width = 176 height = 144 aspect = 1,222222
previewSize support size: width = 320 height = 240 aspect = 1,333333
previewSize support size: width = 352 height = 288 aspect = 1,222222
previewSize support size: width = 640 height = 480 aspect = 1,333333
previewSize support size: width = 672 height = 378 aspect = 1,777778
previewSize support size: width = 720 height = 576 aspect = 1,250000
previewSize support size: width = 800 height = 600 aspect = 1,333333
previewSize support size: width = 1280 height = 720 aspect = 1,777778

videSizes support size: width = 176 height = 144 aspect = 1,222222
videoSizes support size: width = 320 height = 240 aspect = 1,333333
videoSizes support size: width = 352 height = 288 aspect = 1,222222
videoSizes support size: width = 640 height = 480 aspect = 1,333333
videoSizes support size: width = 720 height = 576 aspect = 1,250000
videoSizes support size: width = 1280 height = 720 aspect = 1,777778

back

previewSize support size: width = 176 height = 144 aspect = 1,222222
previewSize support size: width = 320 height = 240 aspect = 1,333333
previewSize support size: width = 352 height = 288 aspect = 1,222222
previewSize support size: width = 640 height = 480 aspect = 1,333333
previewSize support size: width = 672 height = 378 aspect = 1,777778
previewSize support size: width = 720 height = 576 aspect = 1,250000
previewSize support size: width = 800 height = 600 aspect = 1,333333
previewSize support size: width = 1280 height = 720 aspect = 1,777778
previewSize support size: width = 1920 height = 1080 aspect = 1,777778

videoSizes support size: width = 176 height = 144 aspect = 1,222222
videoSizes support size: width = 320 height = 240 aspect = 1,333333
videoSizes support size: width = 352 height = 288 aspect = 1,222222
videoSizes support size: width = 640 height = 480 aspect = 1,333333
videoSizes support size: width = 720 height = 576 aspect = 1,250000
videoSizes support size: width = 1280 height = 720 aspect = 1,777778

在 _recorder.setOutputFormat 之后设置 _recorder.setVideoSize(640, 480) 并且有问题。视频开始写入(我看到文件 3 kb)并且应用程序冻结。我尝试不同的尺寸。但只能使用两个:176x144 和 352x288。

在冻结我看到长堆栈:http ://bit.ly/Oa5O0D

请帮助我,如何知道解决方案。

4

1 回答 1

3

我找到了解决方案:问题将是,因为我使用了视频编码器 VideoEncoder.Default。对于宏碁默认是 h263。如果在 MPEG_4_SP 或 H264 上进行更改,则可以在任何分辨率下稳定工作。在 api less 3.x 的设备上仍有待验证。

于 2012-10-12T19:28:52.333 回答