title: Recording video with MediaRecorder parallel to image processing
body: <p>Most of the questions I found on the forum are related to recording processed image. Like here:</p>
  <p><a href="https://stackoverflow.com/questions/28663864/recording-live-opencv-processing-on-android">Recording Live OpenCV Processing on Android</a></p>
  <p>However, my goal is to record the camera view while the processed frames are displayed on the screen. I tried recording with VideoWriter provided by OpenCV, but the FPS dropped twice while recording. I thought about adding MediaRecorder to JavaCameraView, but then I have to unlock the camera, which disables the preview.</p>
  <pre><code>public void startRecord() {
      mCamera.unlock();
      mediaRecorder = new MediaRecorder();
      mediaRecorder.setCamera(mCamera);
      mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
      mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
  
      mediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH));
      mediaRecorder.setOutputFile(&quot;/storage/emulated/0/Android/data/com.ms.carcam/files/video1.mp4&quot;);
      mediaRecorder.setVideoSize(1280,720);
      try {
          mediaRecorder.prepare();
      } catch (IOException e) {
          e.printStackTrace();
      }
      mediaRecorder.start();
  }
  </code></pre>
  <p>How can I achive this?</p>