MediaRecorder setProfile - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for MediaRecorder setProfile method.

This code example shows how to use the following methods:setAudioSource, setMaxDuration, setMaxFileSize, setOutputFile, setProfile
		cameraView.setClickable(true);
		cameraView.setOnClickListener(this);
	} 
 
	private void initRecorder() { 
		recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
		recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
 
		CamcorderProfile cpHigh = CamcorderProfile
				.get(CamcorderProfile.QUALITY_HIGH);
		recorder.setProfile(cpHigh);
		recorder.setOutputFile("/sdcard/videocapture_example.mp4");
		recorder.setMaxDuration(50000); // 50 seconds
		recorder.setMaxFileSize(5000000); // Approximately 5 megabytes
	} 
 
	private void prepareRecorder() { 
		recorder.setPreviewDisplay(holder.getSurface());
 
		try { 
8
CodeRank
This code example shows how to use the following methods:setAudioSource, setMaxDuration, setMaxFileSize, setOutputFile, setProfile
		// TODO Auto-generated method stub 
 
	} 
 
	private void initMediaRecorder() { 
		mediaRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
		mediaRecorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
		CamcorderProfile camcorderProfile_HQ = CamcorderProfile
				.get(CamcorderProfile.QUALITY_HIGH);
		CamcorderProfile camcorderProfile_LOW = CamcorderProfile
				.get(CamcorderProfile.QUALITY_LOW);
		mediaRecorder.setProfile(camcorderProfile_LOW);
		mediaRecorder.setOutputFile("/sdcard/hookupvideo.mp4");
		mediaRecorder.setMaxDuration(30000); // Set max duration 60 sec.
		mediaRecorder.setMaxFileSize(5000000); // Set max file size 5M
	} 
 
	private void prepareMediaRecorder() { 
		mediaRecorder.setPreviewDisplay(surfaceHolder.getSurface());
		try { 
7
CodeRank
This code example shows how to use the following methods:setAudioSource, setMaxDuration, setOutputFile, setProfile, setVideoSource
         WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
 
        String videoPath = "";
         
        recorder = new MediaRecorder();// Instantiate our media recording object
        initRecorder(videoPath);
        //setContentView(R.layout.view); 
 
        SurfaceView cameraView = null;// (SurfaceView) findViewById(R.id.surface_view);
        holder = cameraView.getHolder();
        holder.addCallback(this);
        holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
 
        cameraView.setClickable(true);// make the surface view clickable
        cameraView.setOnClickListener((OnClickListener) this);// onClicklistener to be called when the surface view is clicked
    } 
 
 
    private void initRecorder (String path)

7
CodeRank
This code example shows how to use the following methods:setAudioSource, setMaxDuration, setMaxFileSize, setOutputFile, setProfile
		Log.v(TAG, "onCreate finished");
	} 
 
	private void initRecorder() { 
		Log.v(TAG, "in initRecorder");
		recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
		Log.v(TAG, "set audio src");
		recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
		Log.v(TAG, "set video src");
 
		CamcorderProfile cpHigh = CamcorderProfile
				.get(CamcorderProfile.QUALITY_HIGH);
		recorder.setProfile(cpHigh);
		recorder.setOutputFile(Environment.getExternalStorageDirectory().getPath() + "/videocapture_example.mp4");
		recorder.setMaxDuration(50000); // 50 seconds
		recorder.setMaxFileSize(5000000); // Approximately 5 megabytes
		Log.v(TAG, "recorder initialized");
	} 
 
	private void prepareRecorder() { 
		recorder.setPreviewDisplay(holder.getSurface());
7
CodeRank
This code example shows how to use the following methods:setAudioSource, setCamera, setProfile, setVideoSource
 
        setOnTouchListener(this);
    } 
     
    public void PrepareMedia(int wid, int hei) {
        myMediaRecorder =  new MediaRecorder();
        myCamera.stopPreview();
        myCamera.unlock();
         
        myMediaRecorder.setCamera(myCamera);
        myMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
        myMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
	     
        CamcorderProfile targetProfile = CamcorderProfile.get(CamcorderProfile.QUALITY_LOW);
        targetProfile.quality = 60;
        targetProfile.videoFrameWidth = wid;
        targetProfile.videoFrameHeight = hei;
        targetProfile.videoFrameRate = 30;
        targetProfile.videoCodec = MediaRecorder.VideoEncoder.H264;
        targetProfile.audioCodec = MediaRecorder.AudioEncoder.AMR_NB;

6
CodeRank
This code example shows how to use the following methods:setAudioSource, setOutputFile, setProfile, setVideoSource
 
    private String Init()
    { 
    	InitWithoutNewFile(); 
    	String outputFileName = getOutputMediaFile().toString();
        mRecorder.setOutputFile(outputFileName);
    	return outputFileName;
    } 
     
    private void InitWithoutNewFile(){ 
        mRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
        mRecorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
        CamcorderProfile camcorderProfile_HQ = CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH);
        mRecorder.setProfile(camcorderProfile_HQ);
    } 
 
     
    /* Create a File for saving an image or video*/  
    private static File getOutputMediaFile(){
        File mediaStorageDir = Functions.getInstance().fileLocation();

6
CodeRank
This code example shows how to use the following methods:setAudioSource, setMaxDuration, setMaxFileSize, setOutputFile, setProfile
	    
 
	    private void initRecorder()  
	    { 
	    	Log.d(TAG, "initRecorder called");
	        recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
	        recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
 
	        CamcorderProfile cpHigh = CamcorderProfile
	                .get(CamcorderProfile.QUALITY_LOW);
	        recorder.setProfile(cpHigh);
	        recorder.setOutputFile(Environment.getExternalStorageDirectory()+"/videocapture_example.mp4");
	        recorder.setMaxDuration(6000); // 6 seconds
	        recorder.setMaxFileSize(500000); // Approximately 5 megabytes
//	        new Handler().postDelayed(new Runnable() 
//	       	 { 
//	 
//					@Override 
//					public void run()  
//					{ 
6
CodeRank
This code example shows how to use the following methods:setAudioSource, setMaxDuration, setMaxFileSize, setOutputFile, setProfile
		 
	 
	} 
	 
	private void initRecorder() { 
		recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
		recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
 
		CamcorderProfile cpHigh = CamcorderProfile
				.get(CamcorderProfile.QUALITY_HIGH);
		recorder.setProfile(cpHigh);
 
		recorder.setOutputFile(OutputFile.getAbsolutePath()+video+count+".mp4");
		//recorder.setOutputFile("/sdcard/videocapture_example.mp4"); 
		recorder.setMaxDuration(50000); // 50 seconds
		recorder.setMaxFileSize(50000000); // Approximately 5 megabytes
	} 
	 
	private void prepareRecorder() { 
		recorder.setPreviewDisplay(holder.getSurface());
 
6
CodeRank
This code example shows how to use the following methods:setAudioSource, setMaxDuration, setMaxFileSize, setOutputFile, setProfile
    cameraView.setClickable(true);
    cameraView.setOnClickListener(this);
} 
 
private void initRecorder() { 
    recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
    recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
 
    CamcorderProfile cpHigh = CamcorderProfile
            .get(CamcorderProfile.QUALITY_HIGH);
    recorder.setProfile(cpHigh);
    recorder.setOutputFile("/sdcard/capture.mp4");
    recorder.setMaxDuration(5000); // 5 seconds
    recorder.setMaxFileSize(5000000); // Approximately 5 megabytes
     
} 
 
private void prepareRecorder() { 
    recorder.setPreviewDisplay(holder.getSurface());
 
6
CodeRank
This code example shows how to use the following methods:setAudioSource, setMaxDuration, setMaxFileSize, setOutputFile, setProfile
    } 
 
    //CVM01_V01 - to start the recorder... 
    // CVM02_V01 encoding 
    private void initRecorder() { 
        recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
        recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
 
        CamcorderProfile cpHigh = CamcorderProfile
                .get(CamcorderProfile.QUALITY_HIGH);
        recorder.setProfile(cpHigh);
        recorder.setOutputFile(filePath);
        recorder.setMaxDuration(5000); // 50 seconds
        recorder.setMaxFileSize(5000000); // Approximately 5 megabytes
    } 
 
    private void prepareRecorder() { 
        recorder.setPreviewDisplay(holder.getSurface());
 
        try { 
6
CodeRank

Related MediaRecorder setProfile Questions & Answers:

setProfile Method Overview
Uses the settings from a CamcorderProfile object for recording.
See Code Examples for other Android MediaRecorder Methods: