0

I don't know this is a bug of MediaRecorder/ CamcorderProfile or not but let me explain my situation.

My Goal for app
- I want to make one camera module which has basic only front camera not back
- Also it can record only 360p(540 * 360 resolution).

What I do for code

mMediaRecorder = new MediaRecorder();
    mCamera.unlock();
    mMediaRecorder.setCamera(mCamera);
    mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
    mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
    mMediaRecorder.setProfile(CamcorderProfile.get(mCameraId,CamcorderProfile.QUALITY_480P));
    mMediaRecorder.setVideoSize(mCaptureSize.getWidth(), mCaptureSize.getHeight()); 
 //width = 360 & height = 540  it will crash 
//width = 480 & height = 720 it will allow 
    .....
    .....

Where I stuck

So, for pixel of video, I have to change CamcorderProfile

CamcorderProfile.get(mCameraId,CamcorderProfile.QUALITY_480P)

-CamcorderProfile.QUALITY_360P is missing so how can I get video resolution 540*360

enter image description here

-or I have missed something?

Vishal Patel
  • 2,931
  • 3
  • 24
  • 60
  • "Also it can record only 360p(540 * 360 resolution)" -- there is no requirement that a device support that resolution for either camera, let alone the front-facing camera. And, as you note, it is not part of the Android SDK. – CommonsWare Aug 30 '17 at 12:31
  • Then can u plz guide me how can I achieve I am new bee for this multimedia android topic @CommonsWare any little hint or something else – Vishal Patel Aug 30 '17 at 12:34
  • @CommonsWare explain that a device support that resolution. Check this i hope this will help you https://stackoverflow.com/questions/7225571/camcorderprofile-quality-high-resolution-produces-green-flickering-video – Farmer Aug 30 '17 at 12:36
  • 360p is equals to 480 x 360 – RBK Aug 30 '17 at 12:37
  • Achieve *what*? Use `CamcorderProfile` and `hasProfile()` to see what profiles are supported. Choose one. Record using that profile. – CommonsWare Aug 30 '17 at 12:54
  • Thats means suppose i wanna 720*480 px so i have to check hasProfile() first for device? – Vishal Patel Aug 30 '17 at 13:04
  • mediaRecorder.setProfile(CamcorderProfile .get(CamcorderProfile.QUALITY_QVGA)); – Vishal Bhut Aug 30 '17 at 13:14

0 Answers0