ビデオ録画に関しまして

207 views
Skip to first unread message

Yusuke Hirano

unread,
Aug 20, 2009, 4:09:48 AM8/20/09
to android-g...@googlegroups.com
初めまして、u-sukeといいます。
動画の保存に関して質問させてください。

現在、練習として動画を保存するアプリを作成しています。
ですが、どうしても録画をする事が出来ず、エラーとなってしまいます。
なお、test.3pg というゼロバイトのファイルが出力されています。

以下、そのソースです。

File file = Environment.getExternalStorageDirectory();
String path = file.getPath() + "/test.3gp";

recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setVideoSize(176, 144); // QCIF
recorder.setVideoFrameRate(15);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile(path);

try {
    recorder.prepare();
} catch (IllegalStateException e) {
    // TODO 自動生成された catch ブロック
    e.printStackTrace();
} catch (IOException e) {
    // TODO 自動生成された catch ブロック
    e.printStackTrace();
}
recorder.start();


エラーログは以下です。

08-20 11:02:03.130: ERROR/(35): Dynamically Loading the library : libOmxVidEnc.so
08-20 11:02:03.510: ERROR/OMXVenc(35): get_parameter::788 unsupported index 267887431
08-20 11:02:03.520: ERROR/VENC_DRV(35): venc_drv_malloc::1138 phys lookup success 0x41538000 -- 0x2880000 -- size - 524288
08-20 11:02:03.520: DEBUG/OpenCore(35): PVMFOMXVideoEncNode::CallbackEventHandler: event(0), data1(0) and data2(2)
08-20 11:02:03.530: DEBUG/CameraService(35): Connect E from ICameraClient 0x4c70c
08-20 11:02:03.530: DEBUG/CameraService(35): new client (0x4c70c) attempting to connect - rejected
08-20 11:02:03.530: ERROR/CameraInput(35): Camera is not available
08-20 11:02:03.530: ERROR/MediaRecorder(17341): prepare failed: -2147483648
08-20 11:02:03.530: WARN/System.err(17341): java.io.IOException: prepare failed.
08-20 11:02:03.710: WARN/System.err(17341):     at android.media.MediaRecorder._prepare(Native Method)

~中略~

08-20 11:02:03.750: ERROR/MediaRecorder(17341): start called in an invalid state: 0
08-20 11:02:03.760: DEBUG/AndroidRuntime(17341): Shutting down VM
08-20 11:02:03.760: WARN/dalvikvm(17341): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)
08-20 11:02:03.760: ERROR/AndroidRuntime(17341): Uncaught handler: thread main exiting due to uncaught exception
08-20 11:02:03.780: ERROR/AndroidRuntime(17341): java.lang.IllegalStateException
08-20 11:02:03.780: ERROR/AndroidRuntime(17341):     at android.media.MediaRecorder.start(Native Method)

setVideoEncoder でエラーとなっているようなのですが、コーデックの指定を変えても駄目でした。
原因に関してご教授頂ければと思います。


Reply all
Reply to author
Forward
0 new messages