0

私はアンドロイド4.0でタブレットエイサー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の2つでしか機能しません。

フリーズすると、長いスタックが表示されます:http: //bit.ly/Oa5O0D

どうか、私を助けてください、どのように解決策を知っていますか。

4

1 に答える 1

3

私は解決策を見つけました:ビデオエンコーダーVideoEncoder.Defaultを使用したため、問題が発生します。acerのデフォルトはh263です。MPEG_4_SPまたはH264で変更した場合、どの解像度でも安定して動作しました。APIが3.x未満のデバイスで検証する必要があります。

于 2012-10-12T19:28:52.333 に答える