Created
June 28, 2014 10:02
-
-
Save a-chernykh/085820f646ad6d5710ab to your computer and use it in GitHub Desktop.
MediaRecorder example
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
MediaRecorder mediaRecorder = new MediaRecorder(); | |
CamcorderProfile profile = CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH); | |
profile.videoFrameWidth = 1280; | |
profile.videoFrameHeight = 720; | |
mediaRecorder.setCamera(Camera.open()); | |
mediaRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT); | |
mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); | |
mediaRecorder.setProfile(profile); | |
mediaRecorder.setOutputFile("/path/to/video.mp4"); | |
mediaRecorder.prepare(); | |
mediaRecorder.start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment