Android 不使用 android 媒体记录器的视频录制

Android Video Recording without using android media recorder

有没有不用mediaRecorder就可以录视频的..

如果没有其他方法,我如何在开始视频录制之前将相机预览到媒体记录器中..

使用相机 google API 您必须设置 MediaRecorder 或 MediaCodec 表面才能为视频创建视频捕获会话。设置视频表面:

createCameraPreviewSession(mMediaRecorder.getSurface(),
                mFrameRate,
                mVideoSize,
                mSize,
                mRetry);

Android developer webpage中您可以看到录制视频的两种方式。 MediaCodec 或 MediaRecorder:

For recording with MediaCodec: Call createInputSurface() after configuring the media codec to use one of the sizes returned by getOutputSizes(MediaCodec.class)

For recording with MediaRecorder: Call getSurface() after configuring the media recorder to use one of the sizes returned by getOutputSizes(MediaRecorder.class), or configuring it to use one of the supported CamcorderProfiles.