Search code examples
androidperformancevideopreviewmotion

Slow motion video preview with Android MediaRecorder


I'm trying to get video preview for recording in my Android application with this code:

    myCamera = getCameraInstance();
    mediaRecorder = new MediaRecorder();
    myCamera.unlock();
    mediaRecorder.setCamera(myCamera);
    mediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
    mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
    mediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH));
    mediaRecorder.setPreviewDisplay(mSurfaceView.getHolder().getSurface());

The result is a video preview in slow motion on all devices. On some devices, the slow motion is bigger. I need a fluid preview, instead. Any suggestions ?


Solution

  • Solved, finally, with the following line:

     p.setRecordingHint(true);