Created
April 4, 2019 21:47
-
-
Save grovertb/577184d17b3aa4e03f5ce0a380570fd0 to your computer and use it in GitHub Desktop.
mediaRecorderAndroid
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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