Ask Your Question
3

OpenCV_NativeCamera: startPreview() fails on Nexus 5 (Android, Kitkat)

asked 2014-03-20 05:54:27 -0500

jacubsz gravatar image

updated 2014-03-20 05:57:04 -0500

berak gravatar image

Hello,

I've got one issue with Nexus5. I have one project with native access to camera. It works properly on SGS+ (Android 2.3.6), but id does not on Kitkat on Nexus 5.

I tried it also with OpenCV Sample - native-activity, and I receive the same error:

03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Cameras: (null)
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Picture Sizes: 3264x2448,3200x2400,2592x1944,2048x1536,1920x1080,1600x1200,1280x960,1280x768,1280x720,1024x768,800x600,800x480,720x480,640x480,352x288,320x240,176x144
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Picture Formats: jpeg
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Preview Sizes: 1920x1080,1280x960,1280x768,1280x720,1024x768,800x600,800x480,720x480,640x480,352x288,320x240,176x144
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Preview Formats: yuv420p,yuv420sp,
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Preview Frame Rates: 15,24,30
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Thumbnail Sizes: 512x288,480x288,256x154,432x288,320x240,176x144,0x0
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Whitebalance Modes: auto,incandescent,fluorescent,warm-fluorescent,daylight,cloudy-daylight,twilight,shade
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Effects: none,mono,negative,solarize,sepia,posterize,whiteboard,blackboard,aqua
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Scene Modes: auto,landscape,snow,beach,sunset,night,portrait,sports,steadyphoto,candlelight,fireworks,party,night-portrait,theatre,action
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Focus Modes: infinity,auto,macro,continuous-video,continuous-picture
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Antibanding Options: off,60hz,50hz,auto
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Supported Flash Modes: off,auto,on,torch,red-eye
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): initCameraConnect: autofocus is set to mode "continuous-video"
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): initCameraConnect: preview format is set to yuv420sp
03-20 11:37:31.162: D/OpenCV_NativeCamera(3293): Starting preview
03-20 11:37:31.352: D/OpenCV_NativeCamera(3293): Preview started successfully
03-20 11:37:31.352: E/OpenCV::camera(3293): calling (*pGetPropertyC)(0x74ddef50, 2)
03-20 11:37:31.352: D/OpenCV_NativeCamera(3293): CameraHandler::getProperty(2)
03-20 11:37:31.352: D/OpenCV_NativeCamera(3293): CameraHandler::setProperty(0, 1280.000000)
03-20 11:37:31.352: D/OpenCV_NativeCamera(3293): CameraHandler::setProperty(1, 720.000000)
03-20 11:37:31.352: I/OCV:libnative_activity(3293): >>>>>Camera initialized at resolution 1280x720
03-20 11:37:31.352: D/OpenCV_NativeCamera(3293): CameraHandler::applyProperties()
03-20 11:37:41.362: E/OpenCV_NativeCamera(3293): applyProperties: failed setPreviewTexture call; camera might not work correctly
03-20 11:37:41.362: D/OpenCV_NativeCamera(3293): Starting preview
03-20 11:37:46.362: E/OpenCV_NativeCamera(3293): initCameraConnect: startPreview() fails. Closing camera connection...

Is there anything I can do with this?

edit retag flag offensive close merge delete

Comments

After update to 2.4.9 it still fails, but in another way: I/OCV:libnative_activity(6144): Camera initialized at resolution 640x480 D/OpenCV_NativeCamera(6144): CameraHandler::applyProperties() E/OpenCV_NativeCamera(6144): applyProperties: failed setPreviewTexture call; camera might not work correctly D/OpenCV_NativeCamera(6144): Starting preview D/OpenCV_NativeCamera(6144): Preview started successfully E/OpenCV::camera(6144): calling (pGetPropertyC)(0x76407a60, 0) D/OpenCV_NativeCamera(6144): CameraHandler::getProperty(0) E/OpenCV::camera(6144): calling (pGetPropertyC)(0x76407a60, 1) D/OpenCV_NativeCamera(6144): CameraHandler::getProperty(1)

Blank screen on Nexus, and it is extremely hard to kill the app.

jacubsz gravatar imagejacubsz ( 2014-05-05 06:15:10 -0500 )edit

Hello There... I also seeing the same issue in Android 4.4.2. The native camera fails with follwing text in app_error.txt: "

backtrace: #00 pc 00026306 /system/lib/libgui.so (android::BufferQueue::releaseBuffer(int, unsigned long long, void, void, android::sp<android::fence> const&)+141) #01 pc 00018455 /data/app-lib/com.apptouch-1/libnative_camera_r4.4.0.so (CameraHandler::initCameraConnect(bool (* const&)(void, unsigned int, void), int, void, android::CameraParameters)+1948)

" Has any one got this issue resolved. Is there setting in buffer memory to be done in kernel. Hope to hear positively!

trushal gravatar imagetrushal ( 2016-06-22 05:02:49 -0500 )edit

3 answers

Sort by ยป oldest newest most voted
1

answered 2014-05-01 09:31:17 -0500

aQwallovS7 gravatar image

https://github.com/Itseez/opencv/pull/2691 will probably fix this. At least it fixes a similar log for me on Nexus 5 Android 4.4.2.

edit flag offensive delete link more
0

answered 2014-04-24 23:44:14 -0500

Quang Anh gravatar image

I got the same issue on Nexus 5, Android Manager 2.4.9. I can not run the Sample 1 - Camera Preview.

edit flag offensive delete link more
0

answered 2014-05-05 06:19:36 -0500

jacubsz gravatar image

updated 2014-05-05 06:20:08 -0500

With 2.4.9 still doesn't work:

Please open this file as a text file, here is full logcat: LOGCAT_LOG

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2014-03-20 05:54:27 -0500

Seen: 2,435 times

Last updated: May 05 '14