question

Bjorn Kilburn avatar image
Bjorn Kilburn asked

Mediastore.Extra_Video_Quality fails when set to 1 on Kindle Fire HD

Device: Kindle Fire HD (current firmware) Issue: Kindle Fire HD attempts to set an invalid preview resolution on the camera when an app sends MEDIASTORE.MEDIASTORE_EXTRA_VIDEO_QUALITY = 1 (High Definition). The exception is also not handled and the camera crashes. Low quality functions correctly. Intent: Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE); intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, EXTRA_VIDEO_QUALITY); //0 is low (MMS) and 1 is HQ startActivityForResult(intent, CAPTURE_VIDEO_ACTIVITY_REQUEST_CODE); Logcat result: 05-26 06:15:15.257: V/videocamera(12619): mDesiredPreviewWidth=1920. mDesiredPreviewHeight=1080 05-26 06:15:15.257: V/videocamera(12619): startPreview 05-26 06:15:15.264: V/videocamera(12619): Video snapshot size is 1280x720 05-26 06:15:15.272: E/CameraHal(104): (40143488) hardware/ti/omap4xxx/camera/CameraHal.cpp:383 setParameters - Invalid preview resolution 1920 x 1080 05-26 06:15:15.272: W/dalvikvm(12619): threadid=12: thread exiting with uncaught exception (group=0x40b0f1f8) 05-26 06:15:15.272: E/AndroidRuntime(12619): FATAL EXCEPTION: Thread-4221 05-26 06:15:15.272: E/AndroidRuntime(12619): java.lang.RuntimeException: setParameters failed
fire tablet
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Bipin@Amazon avatar image
Bipin@Amazon answered
Hi, The exception looks like the invalid preview resolution and not on Video Quality parameter set in the intent of launching action of video capture. Kindle HD checked, works fine with both low quality (0) and High Quality(1).
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Bjorn Kilburn avatar image
Bjorn Kilburn answered
The point is that the exception is occurring in the android camera app (com.android.camera/.VideoCamera). The bundled camera app looks like it equates High Quality to 1920x1080 but the HAL is saying that 1920x1080 is not a supported resolution. I think you need to check the code in the camera app. There is a mismatch between the resolution requested in the app and the hardware support. Either that or someone has changed the camera hw mid-production and the one you are testing on supports different resolutions than the device I am developing on. This log output is from the android camera app and the camera hw abstraction layer, not from my app. In fact, you can see that the camera app sets the preview size to 1920x1080 and then asks for 1280x720 video from the camera... 06-01 11:04:33.217: V/videocamera(3897): mDesiredPreviewWidth=1920. mDesiredPreviewHeight=1080 06-01 11:04:33.217: V/videocamera(3897): startPreview 06-01 11:04:33.217: V/videocamera(3897): Video snapshot size is 1280x720 06-01 11:04:33.225: E/CameraHal(107): (9a4f98) hardware/ti/omap4xxx/camera/CameraHal.cpp:383 setParameters - Invalid preview resolution 1920 x 1080 06-01 11:04:33.233: D/dalvikvm(3897): GC_CONCURRENT freed 145K, 2% free 12175K/12423K, paused 1ms+4ms 06-01 11:04:33.233: W/dalvikvm(3897): threadid=12: thread exiting with uncaught exception (group=0x40b1a1f8) 06-01 11:04:33.233: E/AndroidRuntime(3897): FATAL EXCEPTION: Thread-384 06-01 11:04:33.233: E/AndroidRuntime(3897): java.lang.RuntimeException: setParameters failed 06-01 11:04:33.233: E/AndroidRuntime(3897): at android.hardware.Camera.native_setParameters(Native Method) 06-01 11:04:33.233: E/AndroidRuntime(3897): at android.hardware.Camera.setParameters(Camera.java:1295) 06-01 11:04:33.233: E/AndroidRuntime(3897): at com.android.camera.VideoCamera.setCameraParameters(VideoCamera.java:1954) 06-01 11:04:33.233: E/AndroidRuntime(3897): at com.android.camera.VideoCamera.startPreview(VideoCamera.java:925) 06-01 11:04:33.233: E/AndroidRuntime(3897): at com.android.camera.VideoCamera.access$600(VideoCamera.java:89) 06-01 11:04:33.233: E/AndroidRuntime(3897): at com.android.camera.VideoCamera$1.run(VideoCamera.java:390) 06-01 11:04:33.233: E/AndroidRuntime(3897): at java.lang.Thread.run(Thread.java:856) 06-01 11:04:33.241: W/ActivityManager(203): Force finishing activity com.android.camera/.VideoCamera Message was edited by: middleseatman
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Bipin@Amazon avatar image
Bipin@Amazon answered
Hi, Thank you for pointing out the issue, we have forwarded the issue to respective team, Kindle Fire HD 8.9 works fine with MediaStore.EXTRA_VIDEO_QUALITY = 1; The alternative way of getting the HD camera working is to create your own camera object inside the application, check this link : https://developer.amazon.com/post/Tx15W4Y9RPRFYD/Optimizing-for-the-Kindle-Fire-HD-8217-s-span-class-matches-Camera-span.html Hope this information helps
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Bjorn Kilburn avatar image
Bjorn Kilburn answered
Hi, Thanks. Actually I did develop a video recorder and video player activity to workaround this problem and found that exactly the same problem exists in the MediaRecorder (next layer down). mMediaRecorder.setProfile(CamcorderProfile.get([Camera ID], [CamcorderProfile])); Camcorder Profile 1 should be set to the "Highest Available Resolution." http://developer.android.com/reference/android/media/CamcorderProfile.html#QUALITY_HIGH . This setting depends on the camera and needs to be properly configured to match the camera. Camcorder Profiles 4 and 5 work but 1 really should be fixed.
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.