Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MediaRecorder mediaRecorder = new MediaRecorder();
- // Configure the input sources
- mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
- mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
- // Set the output format
- mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
- // Specify the audio and video encoding
- mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
- mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.DEFAULT);
- //Specify the outputfile
- mediaRecorder.setOutputFile("/sdcard/Video/myoutputfile.mp4");
- mediaRecorder.start();
- In the AndroidManisfest.xml:
- <user-permission android:name="android.permission.RECORD_AUDIO" />
- <user-permission android:name="android.permission.RECORD_VIDEO" />
- mediaRecorder.prepare();
- setPreviewDisplay();
- setMaxDuration((int) #);
- setOnInfoListener();
- setVideoSize(#, #);
- setVideoFrameRate(15);
Add Comment
Please, Sign In to add comment