2012-07-22 92 views
0

我有Android 4.0的平板電腦acer a500。setrecVideoSize上的媒體記錄器凍結應用程序

我可以(:176×144目標大小):錄製視頻

_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.setVideoSize(640,480)_recorder.setOutputFormat後有問題。視頻開始寫入(我看到文件3 kb)和應用程序凍結。我嘗試不同的尺寸。但只能使用兩個:176x144和352x288。

在凍結我看長堆棧:http://bit.ly/Oa5O0D

請幫幫我,怎麼知道的解決方案。

回答

3

我發現解決方案:問題將會,因爲我使用了視頻編碼器VideoEncoder.Default。對於宏碁默認是h263。如果在MPEG_4_SP或H264上進行更改,可以使用任何分辨率穩定運行。它仍然需要在api少於3.x的設備上進行驗證。