Skip to content
This repository has been archived by the owner on Jun 16, 2023. It is now read-only.

Error retrieving camcorder profile params #1018

Closed
sm2017 opened this issue Dec 2, 2017 · 6 comments
Closed

Error retrieving camcorder profile params #1018

sm2017 opened this issue Dec 2, 2017 · 6 comments

Comments

@sm2017
Copy link

sm2017 commented Dec 2, 2017

In the following line
https://github.com/lwansbrough/react-native-camera/blob/master/android/src/main/java/com/lwansbrough/RCTCamera/RCTCamera.java#L266

If we set captureQuality as RCT_CAMERA_CAPTURE_QUALITY_MEDIUM and device camera don't support CamcorderProfile.QUALITY_720P , App will crash at

java.lang.RuntimeException: Error retrieving camcorder profile params
	 at android.media.CamcorderProfile.native_get_camcorder_profile(Native Method)
	 at android.media.CamcorderProfile.get(CamcorderProfile.java:384)
	 at com.lwansbrough.RCTCamera.RCTCamera.setCaptureVideoQuality(RCTCamera.java:266)
	 at com.lwansbrough.RCTCamera.RCTCameraModule.prepareMediaRecorder(RCTCameraModule.java:264)
	 at com.lwansbrough.RCTCamera.RCTCameraModule.record(RCTCameraModule.java:350)
	 at com.lwansbrough.RCTCamera.RCTCameraModule.captureWithOrientation(RCTCameraModule.java:514)
	 at com.lwansbrough.RCTCamera.RCTCameraModule.access$100(RCTCameraModule.java:38)
	 at com.lwansbrough.RCTCamera.RCTCameraModule$2.orientationEvent(RCTCameraModule.java:498)
	 at com.lwansbrough.RCTCamera.RCTSensorOrientationChecker$Listener.onSensorChanged(RCTSensorOrientationChecker.java:64)
	 at android.hardware.SystemSensorManager$SensorEventQueue.dispatchSensorEvent(SystemSensorManager.java:405)

We have issue with RCT_CAMERA_CAPTURE_QUALITY_LOW too

Just a suggest , We can use the following code

if(CamcorderProfile.hasProfile(_cameraTypeToIndex.get(cameraType), CamcorderProfile.QUALITY_720P)){
	cm = CamcorderProfile.get(_cameraTypeToIndex.get(cameraType), CamcorderProfile.QUALITY_720P);
}
@sm2017
Copy link
Author

sm2017 commented Dec 9, 2017

Hello ... ??

@sibelius
Copy link
Collaborator

sibelius commented Dec 9, 2017

@sm2017 send a pr to fix this please

@Polidoro
Copy link

Getting the same error on the simulator. Running an S7 with 6.0.0

@sibelius
Copy link
Collaborator

Try to use RNCamera

@Polidoro
Copy link

Thanks for the quick reply! Gave it a shot and it looks like I'll need to update Gradle to take advantage of RNCamera, which is a project for another day.

Really appreciate it though, I'll report back once I'm done updating!

@SimonErm
Copy link
Collaborator

#1835

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants