Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Camera access in Android Device



  • I'm not able to access android camera in my Qt widget application..i tried QCamera API it's returning error in Debug shown as below

    D libCamera.so: ../Camera/main.cpp:13 (int main(int, char**)): hi
    W linker : /data/data/org.qtproject.example/qt-reserved-files/plugins/imageformats/libqgif.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/data/org.qtproject.example/qt-reserved-files/plugins/imageformats/libqicns.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/data/org.qtproject.example/qt-reserved-files/plugins/imageformats/libqico.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/data/org.qtproject.example/qt-reserved-files/plugins/imageformats/libqjpeg.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/data/org.qtproject.example/qt-reserved-files/plugins/imageformats/libqtga.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/data/org.qtproject.example/qt-reserved-files/plugins/imageformats/libqtiff.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/data/org.qtproject.example/qt-reserved-files/plugins/imageformats/libqwbmp.so: unsupported flags DT_FLAGS_1=0x81
    W linker : /data/data/org.qtproject.example/qt-reserved-files/plugins/imageformats/libqwebp.so: unsupported flags DT_FLAGS_1=0x81
    W libCamera.so: (null):0 ((null)): The video surface is not compatible with any format supported by the camera
    V BoostFramework: BoostFramework() : mPerf = com.qualcomm.qti.Performance@42a0529
    D Camera : app passed NULL surface
    D Camera : app passed NULL surface
    W libCamera.so: (null):0 ((null)): The video surface is not compatible with any format supported by the camera
    D Camera : app passed NULL surface
    D Camera : app passed NULL surface

    "org.qtproject.example" died.


  • Lifetime Qt Champion

    @Vineela Does your app have the permission to use the camera?



  • The problem is as the message tells: "The video surface is not compatible with any format supported by the camera"
    Try putting QVideoFrame::Format_NV21 in the list of supported formats



  • @jsulm Yes I've added other files where in Android Manifest.xml I've given permission like,

    android.permission.CAMERA

    So, is there anything else to add with, to make it work?


  • Lifetime Qt Champion

    @Vineela Take a look at what @mvuori wrote



  • @mvuori How can I use it ? Any examples coz I'm a beginner to Qt...


Log in to reply