[Development] 答复: QCamera don't capture video in android

Ayberk Özgür ayberk.ozgur at epfl.ch
Fri Oct 24 11:29:30 CEST 2014


I know that VideoCapture runs on Android by itself. There are good 
reasons why I forked CvCapture_Android (horrible Android backend for 
VideoCapture) and wrote CVCaptureAndroid. If you want to see how bad is 
the original, try to run VideoCapture by itself on Android, you will see 
that it' not even capable of delivering 30 FPS due to color space 
conversions. This is to conform to the even more horrible and 
undocumented VideoCapture API where a lot of performance is traded away 
for a bit of simplicity.

About the native camera libs, see the Android build notes here: 
https://github.com/chili-epfl/qml-cvcamera/blob/master/samples/README.md.

On 24. 10. 14 05:41, kl222 wrote:
> OK. It is run.
> I tested cv::VideoCapture, it can run in android. so your 
> CVCaptureAndroid is can delete.
> my code:
> https://github.com/KangLin/rabbitim/blob/Reconstruction/Widgets/FrmVideo/CameraOpencv.h
> https://github.com/KangLin/rabbitim/blob/Reconstruction/Widgets/FrmVideo/CameraOpencv.cpp
>
> In addition, android native camera library is chosen autmatically?
>
>
>
>
>
> At 2014-10-23 20:12:35, "Ayberk Özgür" <ayberk.ozgur at epfl.ch> wrote:
>
>     It's because you're trying to use libnative_camera_r4.0.0.so while
>     your device is not 4.0.0. Use the closest available library; for
>     example if your device is 4.1.2, you should use
>     libnative_camera_r4.1.1.so. This is a limitation of relying on
>     OpenCV Manager that keeps around the correct library for your
>     device, but we don't want to rely on it ourselves and for now we
>     have to manually provide the library.
>
>     On 23. 10. 14 13:38, kl222 wrote:
>>
>>     I use your qml-cvcamera, but the followingerroroccurs, and the
>>     programcore. Tell me It depends onwhatopencvlibrary.
>>
>>     D/dalvikvm(20935): Added shared lib
>>     /data/data/com.KangLinStudio.RabbitIm/lib/libQt5Xml.so 0x417d36d0
>>
>>     D/dalvikvm(20935): No JNI_OnLoad found in
>>     /data/data/com.KangLinStudio.RabbitIm/lib/libQt5Xml.so
>>     0x417d36d0, skipping init
>>
>>     D/dalvikvm(20935): Trying to load lib
>>     /data/data/com.KangLinStudio.RabbitIm/qt-reserved-files/plugins/platforms/android/libqtforandroid.so
>>     0x417d36d0
>>
>>     D/dalvikvm(20935): Added shared lib
>>     /data/data/com.KangLinStudio.RabbitIm/qt-reserved-files/plugins/platforms/android/libqtforandroid.so
>>     0x417d36d0
>>
>>     I/Qt (20935): qt start
>>
>>     D/dalvikvm(20935): Trying to load lib
>>     /data/data/com.KangLinStudio.RabbitIm/qt-reserved-files/plugins/mediaservice/libqtmedia_android.so
>>     0x417d36d0
>>
>>     D/dalvikvm(20935): Added shared lib
>>     /data/data/com.KangLinStudio.RabbitIm/qt-reserved-files/plugins/mediaservice/libqtmedia_android.so
>>     0x417d36d0
>>
>>     D/dalvikvm(20935): Trying to load lib
>>     /data/data/com.KangLinStudio.RabbitIm/lib/libnative_camera_r4.0.0.so
>>     0x417d36d0
>>
>>     W/System.err(20935): java.lang.reflect.InvocationTargetException
>>
>>     W/System.err(20935): at
>>     java.lang.reflect.Method.invokeNative(Native Method)
>>
>>     W/System.err(20935): at
>>     java.lang.reflect.Method.invoke(Method.java:511)
>>
>>     W/System.err(20935): at
>>     org.qtproject.qt5.android.bindings.QtActivity.loadApplication(QtActivity.java:248)
>>
>>     W/System.err(20935): at
>>     org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:649)
>>
>>     W/System.err(20935): at
>>     org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:880)
>>
>>     W/System.err(20935): at
>>     android.app.Activity.performCreate(Activity.java:4479)
>>
>>     W/System.err(20935): at
>>     android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1050)
>>
>>     W/System.err(20935): at
>>     android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2041)
>>
>>     W/System.err(20935): at
>>     android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2104)
>>
>>     W/System.err(20935): at
>>     android.app.ActivityThread.access$600(ActivityThread.java:134)
>>
>>     W/System.err(20935): at
>>     android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
>>
>>     W/System.err(20935): at
>>     android.os.Handler.dispatchMessage(Handler.java:99)
>>
>>     W/System.err(20935): at android.os.Looper.loop(Looper.java:154)
>>
>>     W/System.err(20935): at
>>     android.app.ActivityThread.main(ActivityThread.java:4624)
>>
>>     W/System.err(20935): at
>>     java.lang.reflect.Method.invokeNative(Native Method)
>>
>>     W/System.err(20935): at
>>     java.lang.reflect.Method.invoke(Method.java:511)
>>
>>     W/System.err(20935): at
>>     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)
>>
>>     W/System.err(20935): at
>>     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
>>
>>     W/System.err(20935): at dalvik.system.NativeStart.main(Native Method)
>>
>>     W/System.err(20935): Caused by: java.lang.UnsatisfiedLinkError:
>>     Cannot load library: reloc_library[1311]: 102 cannot locate
>>     '_ZN7android14SurfaceTextureC1Ejbj'...
>>
>>     W/System.err(20935): at java.lang.Runtime.load(Runtime.java:340)
>>
>>     W/System.err(20935): at java.lang.System.load(System.java:521)
>>
>>     W/System.err(20935): at
>>     org.qtproject.qt5.android.QtNative.loadBundledLibraries(QtNative.java:151)
>>
>>     W/System.err(20935): at
>>     org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:424)
>>
>>     W/System.err(20935): ... 19 more
>>
>>     D/ActivityThread(20935): ACT-AM_ON_RESUME_CALLED
>>     ActivityRecord{417d1810 token=android.os.BinderProxy at 417d0b00
>>     {com.KangLinStudio.RabbitIm/org.qtproject.qt5.android.bindings.QtActivity}}
>>
>>     D/ActivityThread(20935): ACT-LAUNCH_ACTIVITY handled : 0 /
>>     ActivityRecord{417d1810 token=android.os.BinderProxy at 417d0b00
>>     <mailto:token=android.os.BinderProxy at 417d0b00>
>>
>>     *发件人:*development-bounces+kl222=126.com at qt-project.org
>>     [mailto:development-bounces+kl222=126.com at qt-project.org] *代表
>>     *Ayberk ?zgür
>>     *发送时间:*2014年10月23日14:47
>>     *收件人:*development at qt-project.org
>>     *主题:*Re: [Development] QCamera don't capture video in android
>>
>>     QCamera being buggy on Android is one of the reasons why we wrote
>>     qml-cvcamera. The other is support for various devices, such as
>>     Kinect and PointGrey cameras.
>>
>>     On 23. 10. 14 08:19, Kojo Tero wrote:
>>
>>         Hello,
>>
>>         Please take a look at the Qt bugreports.
>>
>>         For example this:
>>         https://bugreports.qt-project.org/browse/QTBUG-37525
>>
>>         Or maybe this:
>>         https://bugreports.qt-project.org/browse/QTBUG-41273
>>
>>         It seems that video recording on Android depends on the
>>         device manufacturer.
>>
>>         I suggest trying to get a log out of the device and opening a
>>         new bug (if it isn’t a known bug).
>>
>>         Best regards,
>>
>>         Tero
>>
>>         *From:*development-bounces+tero.kojo=theqtcompany.com at qt-project.org
>>         <mailto:development-bounces+tero.kojo=theqtcompany.com at qt-project.org>[mailto:development-bounces+tero.kojo=theqtcompany.com at qt-project.org]
>>         *On Behalf Of *kl222
>>         *Sent:* 22. lokakuuta 2014 15:53
>>         *To:* development at qt-project.org
>>         <mailto:development at qt-project.org>
>>         *Subject:* [Development] QCamera don't capture video in android
>>
>>         *Description*
>>
>>         QCamera don't capture video in android. Run the attached example.
>>
>>         But it can work in windows and linux.
>>
>>         Is it bug or codeis wrong?If code is wrong, tall me how to write.
>>
>>         ·*Environment:*
>>
>>         operating system:android
>>         qt version:
>>         qt 5.3.1
>>         qt 5.3.2
>>         qt 5.4.0-beta1
>>
>>
>>
>>
>>         _______________________________________________
>>
>>         Development mailing list
>>
>>         Development at qt-project.org  <mailto:Development at qt-project.org>
>>
>>         http://lists.qt-project.org/mailman/listinfo/development
>>
>>
>>
>>     -- 
>>     Ayberk Özgür, Ph.D. Student
>>     Member of the Robotics Group in the CHILI Laboratory, EPFL
>>     www.ayberkozgur.com  <http://www.ayberkozgur.com>
>>
>>
>>     _______________________________________________
>>     Development mailing list
>>     Development at qt-project.org
>>     http://lists.qt-project.org/mailman/listinfo/development
>
>     -- 
>     Ayberk Özgür, Ph.D. Student
>     Member of the Robotics Group in the CHILI Laboratory, EPFL
>     www.ayberkozgur.com
>
>
>

-- 
Ayberk Özgür, Ph.D. Student
Member of the Robotics Group in the CHILI Laboratory, EPFL
www.ayberkozgur.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20141024/e5b2102d/attachment.html>


More information about the Development mailing list