媒体服务器死了。,相机死了,错误100

时间:2013-05-25 17:13:44

标签: android

正在运行&录制视频3到4个薄荷。稍后它会停止视频录制。 在日志文件中显示。媒体服务器死了,相机死机,错误100。

录像机问题,CamcorderProfile设置。

我正在使用Android Emulator& Nexus 7 AVD,

视频设置为:

private void StartVideoRecording(Camera videoCamera){

videoRecorder = new MediaRecorder();
videoRecorder.setCamera(videoCamera);               
videoRecorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);

videoRecorder.setOutputFormat(cameraProfile.fileFormat); // look at ARTPWriter.cpp     //   videoRecorder.setOutputFormat(1); // look at ARTPWriter.cpp

videoRecorder.setVideoEncoder(cameraProfile.videoCodec);

videoRecorder.setVideoFrameRate(cameraProfile.videoFrameRate);
videoRecorder.setVideoSize(cameraProfile.videoFrameWidth, cameraProfile.videoFrameHeight);
videoRecorder.setVideoEncodingBitRate(cameraProfile.videoBitRate);

videoRecorder.setOutputFile("/mnt/sdcard/.Y3KVideo"); // File not used, but is needed for prepare to succeed.

videoRecorder.setPreviewDisplay(cameraViewSurfaceHolder.getSurface());
videoRecorder.setOrientationHint(90);

try {
    videoRecorder.prepare();
} catch (IllegalStateException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
} catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}
videoRecorder.start();  
}

CamcorderProflie设置:

private void configureCameraProfile() {
    cameraProfile = CamcorderProfile.get(CamcorderProfile.QUALITY_LOW);
    cameraProfile.videoCodec = MediaRecorder.VideoEncoder.H264;
    // cameraProfile.fileFormat = MediaRecorder.OutputFormat.THREE_GPP;
    cameraProfile.fileFormat = 7; // RTP
    cameraProfile.videoFrameWidth = 176; // QCIF PAL
    cameraProfile.videoFrameHeight = 144;
    cameraProfile.videoBitRate = 128000;
    cameraProfile.videoFrameRate = 15;  //15

    Log.i(TAG, " bitrate=" + cameraProfile.videoBitRate + ",width=" + cameraProfile.videoFrameWidth + ",height=" + cameraProfile.videoFrameHeight);

}

1 个答案:

答案 0 :(得分:0)

媒体录制器可能在模拟器中工作。

但您提供的设置是错误的。

请验证此链接

http://developer.android.com/reference/android/media/MediaRecorder.html

并相应地配置设置。