Unable to open camera for CSİ Camera

Hi @proventusnova ;

I followed the steps to reinstall OpenCV from the .deb packages, and here are the steps and results:

First, I copied the .deb files to the following directory and installed them:

onur@ubuntu:~/Downloads/open_cv$ sudo apt install ./*.deb

The installation completed without errors. Here is a summary of what was installed:

libopencv is already the newest version (4.8.0-1-g6371ee1).
libopencv-dev is already the newest version (4.8.0-1-g6371ee1).
libopencv-python is already the newest version (4.8.0-1-g6371ee1).
libopencv-samples is already the newest version (4.8.0-1-g6371ee1).
opencv-licenses is already the newest version (4.8.0-1-g6371ee1).
opencv-samples-data is already the newest version (4.8.0-1-g6371ee1).
onur@ubuntu:~/Downloads/open_cv$ sudo apt install ./*.deb
[sudo] password for onur: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'libopencv-dev' instead of './OpenCV-4.8.0-1-g6371ee1-aarch64-dev.deb'
Note, selecting 'libopencv' instead of './OpenCV-4.8.0-1-g6371ee1-aarch64-libs.deb'
Note, selecting 'opencv-licenses' instead of './OpenCV-4.8.0-1-g6371ee1-aarch64-licenses.deb'
Note, selecting 'libopencv-python' instead of './OpenCV-4.8.0-1-g6371ee1-aarch64-python.deb'
Note, selecting 'opencv-samples-data' instead of './OpenCV-4.8.0-1-g6371ee1-aarch64-samples-data.deb'
Note, selecting 'libopencv-samples' instead of './OpenCV-4.8.0-1-g6371ee1-aarch64-samples.deb'
libopencv is already the newest version (4.8.0-1-g6371ee1).
libopencv-dev is already the newest version (4.8.0-1-g6371ee1).
libopencv-dev set to manually installed.
libopencv-python is already the newest version (4.8.0-1-g6371ee1).
libopencv-samples is already the newest version (4.8.0-1-g6371ee1).
opencv-licenses is already the newest version (4.8.0-1-g6371ee1).
opencv-samples-data is already the newest version (4.8.0-1-g6371ee1).
The following packages were automatically installed and are no longer required:
  gdal-data libaec0 libarmadillo10 libarpack2 libavcodec-dev libavformat-dev
  libavutil-dev libblosc1 libcfitsio9 libcharls2 libdc1394-dev libdeflate-dev
  libdouble-conversion3 libexif-dev libfreexl1 libfyba0 libgdal30 libgdcm-dev
  libgdcm3.0 libgeos-c1v5 libgeos3.10.2 libgeotiff5 libgl2ps1.4 libglew2.2
  libgphoto2-dev libhdf4-0-alt libhdf5-103-1 libhdf5-hl-100 libheif1
  libilmbase-dev libjbig-dev libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev
  libkmlbase1 libkmldom1 libkmlengine1 liblept5 libminizip1 libmysqlclient21
  libnetcdf19 libodbc2 libodbcinst2 libogdi4.1 libopencv-calib3d4.5d
  libopencv-contrib4.5d libopencv-dnn4.5d libopencv-features2d4.5d
  libopencv-flann4.5d libopencv-highgui4.5d libopencv-imgcodecs4.5d
  libopencv-imgproc4.5d libopencv-ml4.5d libopencv-objdetect4.5d
  libopencv-photo4.5d libopencv-shape4.5d libopencv-stitching4.5d
  libopencv-superres4.5d libopencv-video4.5d libopencv-videoio4.5d
  libopencv-videostab4.5d libopencv-viz4.5d libopenexr-dev libpng-dev libpq5
  libproj22 libraw1394-dev librttopo1 libsocket++1 libspatialite7 libsuperlu5
  libswresample-dev libswscale-dev libsz2 libtbb-dev libtesseract4 libtiff-dev
  libtiffxx5 liburiparser1 libvtk9.1 libxerces-c3.2 mysql-common proj-data
  unixodbc-common
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 111 not upgraded.

After installing OpenCV, I still see that GStreamer support is not enabled:

Video I/O:
  DC1394:                      NO
  FFMPEG:                      YES
    avcodec:                   YES (59.37.100)
    avformat:                  YES (59.27.100)
    avutil:                    YES (57.28.100)
    swscale:                   YES (6.7.100)
    avresample:                NO
  GStreamer:                   NO
  v4l/v4l2:                    YES (linux/videodev2.h)

Despite installing the recommended packages, OpenCV is still missing GStreamer support. I used the debian packages from the SDK Manager, but the issue remains.

@onurrcifcii,

I believe the Debians did not install.

Please try running the install command like this instead:

sudo apt install --reinstal ./*.deb

regards,
Andrew
Embedded Software Engineer at ProventusNova
https://proventusnova.com/embedded-software-engineering-support/

@proventusnova, @EduardoSalazar96 ,

I’m still getting “GStreamer: NO” when I check the OpenCV build information, so the issue persists.

onur@ubuntu:~$ python3 -c "import cv2; print(cv2.getBuildInformation())"

General configuration for OpenCV 4.10.0 =====================================
  Version control:               4.10.0-dirty

  Platform:
    Timestamp:                   2024-06-17T18:00:16Z
    Host:                        Linux 5.3.0-28-generic aarch64
    CMake:                       3.29.5
    CMake generator:             Unix Makefiles
    CMake build tool:            /bin/gmake
    Configuration:               Release

  CPU/HW features:
    Baseline:                    NEON FP16
    Dispatched code generation:  NEON_DOTPROD NEON_FP16 NEON_BF16
      requested:                 NEON_FP16 NEON_BF16 NEON_DOTPROD
      NEON_DOTPROD (1 files):    + NEON_DOTPROD
      NEON_FP16 (2 files):       + NEON_FP16
      NEON_BF16 (0 files):       + NEON_BF16

  C/C++:
    Built as dynamic libs?:      NO
    C++ standard:                11
    C++ Compiler:                /opt/rh/devtoolset-10/root/usr/bin/c++  (ver 10.2.1)
    C++ flags (Release):         -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
    C++ flags (Debug):           -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
    C Compiler:                  /opt/rh/devtoolset-10/root/usr/bin/cc
    C flags (Release):           -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
    C flags (Debug):             -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
    Linker flags (Release):      -L/ffmpeg_build/lib  -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
    Linker flags (Debug):        -L/ffmpeg_build/lib  -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
    ccache:                      YES
    Precompiled headers:         NO
    Extra dependencies:          /lib64/libopenblas.so Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Test Qt5::Concurrent /usr/local/lib/libpng.so /lib64/libz.so dl m pthread rt
    3rdparty dependencies:       libprotobuf ade ittnotify libjpeg-turbo libwebp libtiff libopenjp2 IlmImf tegra_hal

  OpenCV modules:
    To be built:                 calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo python3 stitching video videoio
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 java python2 ts
    Applications:                -
    Documentation:               NO
    Non-free algorithms:         NO

  GUI:                           QT5
    QT:                          YES (ver 5.15.13 )
      QT OpenGL support:         NO
    GTK+:                        NO
    VTK support:                 NO

  Media I/O: 
    ZLib:                        /lib64/libz.so (ver 1.2.7)
    JPEG:                        build-libjpeg-turbo (ver 3.0.3-70)
      SIMD Support Request:      YES
      SIMD Support:              YES
    WEBP:                        build (ver encoder: 0x020f)
    PNG:                         /usr/local/lib/libpng.so (ver 1.6.43)
    TIFF:                        build (ver 42 - 4.6.0)
    JPEG 2000:                   build (ver 2.5.0)
    OpenEXR:                     build (ver 2.3.0)
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:
    DC1394:                      NO
    FFMPEG:                      YES
      avcodec:                   YES (59.37.100)
      avformat:                  YES (59.27.100)
      avutil:                    YES (57.28.100)
      swscale:                   YES (6.7.100)
      avresample:                NO
    GStreamer:                   NO
    v4l/v4l2:                    YES (linux/videodev2.h)

  Parallel framework:            pthreads

  Trace:                         YES (with Intel ITT)

  Other third-party libraries:
    Lapack:                      YES (/lib64/libopenblas.so)
    Eigen:                       NO
    Custom HAL:                  YES (carotene (ver 0.0.1, Auto detected))
    Protobuf:                    build (3.19.1)
    Flatbuffers:                 builtin/3rdparty (23.5.9)

  OpenCL:                        YES (no extra features)
    Include path:                /io/opencv/3rdparty/include/opencl/1.2
    Link libraries:              Dynamic load

  Python 3:
    Interpreter:                 /opt/python/cp39-cp39/bin/python3.9 (ver 3.9.19)
    Libraries:                   libpython3.9m.a (ver 3.9.19)
    Limited API:                 YES (ver 0x03060000)
    numpy:                       /home/ci/.local/lib/python3.9/site-packages/numpy/_core/include (ver 2.0.0)
    install path:                python/cv2/python-3

  Python (for build):            /opt/python/cp39-cp39/bin/python3.9

  Java:                          
    ant:                         NO
    Java:                        NO
    JNI:                         NO
    Java wrappers:               NO
    Java tests:                  NO

  Install to:                    /io/_skbuild/linux-aarch64-3.9/cmake-install
-----------------------------------------------------------------

I came across this forum post: Unable to Open Camera for CSI Camera where a similar issue I resolved. Would it be a good idea for me to follow the steps mentioned there to try to fix my problem, or could it potentially cause any issues?

I’d appreciate any advice or confirmation before proceeding. Thanks in advance!