Skip to content

Instantly share code, notes, and snippets.

@grovertb
Created April 4, 2019 21:47
Show Gist options
  • Select an option

  • Save grovertb/577184d17b3aa4e03f5ce0a380570fd0 to your computer and use it in GitHub Desktop.

Select an option

Save grovertb/577184d17b3aa4e03f5ce0a380570fd0 to your computer and use it in GitHub Desktop.
mediaRecorderAndroid
// int random = new Random().nextInt();
// String fileName = Environment.getExternalStorageDirectory().getPath() + "/Movies/video_" + random + ".mp4";
//
// mediaRecorder = new MediaRecorder();
// mediaRecorder.setCamera(camera); // This camera object got fromCustomVideoCapturer
// mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
// mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
// mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
// mediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH));
// mediaRecorder.setVideoEncodingBitRate(expectedFrameSize);
// mediaRecorder.setVideoFrameRate();
// mediaRecorder.setVideoSize(400, 600);
// mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
// mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
// mediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_LOW));
// mediaRecorder.setVideoEncodingBitRate(10000000);
// mediaRecorder.setOutputFile(fileName);
// mediaRecorder.setMaxDuration(60000);
// mediaRecorder.setMaxFileSize(6000000);
// try {
// mediaRecorder.prepare();
// mediaRecorder.start();
// } catch (IllegalStateException e) {
// e.printStackTrace();
// } catch (IOException e) {
// e.printStackTrace();
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment