title: How to use android MediaRecorder with new android 10 user privacy improvement
body: <p>I'm trying to record the video and store it in DCIM directory </p>
  
  <p>I have tried to use MediaStore but the problem is the media store returns Uri and MediaRecorder take File, FileDescreptor or file path and I don't have any of these options so I tried to convert Uri to FileDescreptor like this <code>resolver.openFileDescriptor(uri!!, "rw")?.fileDescriptor</code> but exception happens <code>java.lang.RuntimeException: Error retrieving camcorder profile params</code></p>
  
  <pre><code>private fun setUpTimeLapseMediaRecorder(): MediaRecorder {
      val resolver = context.contentResolver
      val contentValues = ContentValues()
      val videoName = "time_lapse_video_" + System.currentTimeMillis() + ".mp4"
      val directoryName = "${Environment.DIRECTORY_DCIM}"
      val filePath = "${directoryName}Videos${File.separator}$videoName"
  
      contentValues.put(MediaStore.MediaColumns.RELATIVE_PATH, filePath)
      val uri = resolver.insert(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, contentValues)
  
      val timeLapseMediaRecorder = MediaRecorder()
      timeLapseMediaRecorder.setVideoSource(MediaRecorder.VideoSource.SURFACE)
      timeLapseMediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_TIME_LAPSE_720P))
      timeLapseMediaRecorder.setOutputFile(/* How i can get file path from media store?*/)
      timeLapseMediaRecorder.setVideoFrameRate(60)
      timeLapseMediaRecorder.setCaptureRate(1.8)
  
      timeLapseMediaRecorder.prepare()
  
      return timeLapseMediaRecorder
  }
  </code></pre>
  
  <p>How I can use MediaStore with MediaRecorder</p>