Tuesday, May 27, 2025

a lot of github workflows

Learnt a lot about many different workflows, how to get various things done, which can be used in future for incorporating into various projects.


automated deb creation with auto dependency detection

Apparently, CMake can do some automation for us - with CMake,
set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)

for more info

Example of multi-package build on github actions - 

build opencv with cuda support

Package 'libtbb2' has no installation candidate
Trying
libtbbmalloc2


https://gist.github.com/kanaryayi/115731930a9767d8607374552993bad3 - Install OpenCV 4.9 with CUDA support - this gist has some build flags which are useful, and also dependencies.

CUDA backend requires CUDA Toolkit - we need to download it from the NVIDIA website.
https://developer.nvidia.com/cuda-toolkit

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get -y install cudnn cuda-toolkit

get url from
(deb network install)

More options are at

CMake Warning at /home/sssvv/opencv_contrib/modules/cudacodec/CMakeLists.txt:26 (message):
  cudacodec::VideoReader requires Nvidia Video Codec SDK.  Please resolve
  dependency or disable WITH_NVCUVID=OFF


CMake Warning at /home/sssvv/opencv_contrib/modules/cudacodec/CMakeLists.txt:30 (message):
  cudacodec::VideoWriter requires Nvidia Video Codec SDK.  Please resolve
  dependency or disable WITH_NVCUVENC=OFF

But this page says,
"FFMPEG is a cross-platforms solution to record, convert, and stream audio and video. FFMPEG supports video hardware acceleration on NVIDIA GPUs."

So do we really need cuda support? (for using NVidia nvenc codec with opencv)
I've put in a question at the OpenCV forum, no answers so far.

Maybe I can try downloading the Nvidia Video Codec SDK, compile OpenCV with that, and then try again.

Learnt how to build with Windows / Linux, building the latest OpenCV and ffmpeg from source, 
Windows workflow - setting PKG_CONFIG_PATH is important here.
Linux workflow - uses actions/cache to cache OpenCV once it is built.

ffmpeg linking on Windows


choco install ffmpeg has the issue that the pc files are not present - mention of pc files here,

Solution was to download from https://github.com/BtbN/FFmpeg-Builds/



Make CMake display a message on the console

Equivalent of echo "our hello world" would be message("our hello world")https://cmake.org/cmake/help/book/mastering-cmake/chapter/Writing%20CMakeLists%20Files.html

android apps without android studio

Directly building android apps on github actions - for learning, there is gradle init as mentioned at https://medium.com/@sdiony/can-you-really-develop-android-apps-without-android-studio-cdd9b951de65
but copy-pasting from existing projects, samples, is much easier - 
https://github.com/hn-88/OpenCV-android-samples
https://github.com/hn-88/android-ndk-samples/








No comments:

Post a Comment