- Get the source code and go to the project directory
git clone https://github.com/kontex-neuro/libxvc.git
cd libxvc-
Create python virtual environment
.venvin the project directory and activate itpy -m venv .venv .venv\Scripts\activate
python -m venv .venv source .venv/bin/activate -
Install build tools in
.venvvia pip
pip install cmake conan ninja- Install dependencies via Conan
conan install . -b missing -pr:a <profile> -s build_type=Release- Generate the build files with CMake
cmake -S . -B build/Release --preset conan-release -G "Ninja" -DCMAKE_BUILD_TYPE=Release- Build the project
cmake --build build/Release --preset conan-release- Export as conan package to local cache
conan export-pkg . -pr:a <profile> -s build_type=Release- Install dependencies with option
build_testingenabled
conan install . -b missing -pr:a <profile> -s build_type=Release -o build_testing=True- Generate the build files with CMake
cmake -S . -B build/Release --preset conan-release -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON- Build the project
cmake --build build/Release --preset conan-release- Run tests
cd ./build/Release/test
ctest --output-on-failure./build/Release/tool/tvcli --helpExample output:
Thor Vision CLI
tvcli [OPTIONS] [SUBCOMMAND]
OPTIONS:
-h, --help Print this help message and exit
SUBCOMMANDS:
stream Stream camera
list List cameras
logs Show server logs./build/Release/tool/tvcli listExample output:
Discovered Cameras:
Camera ID : 0
Name : DF100
Capabilities :
- image/jpeg,width=1280,height=720,framerate=30/1
- image/jpeg,width=1280,height=720,framerate=25/1
- image/jpeg,width=1280,height=720,framerate=20/1
- image/jpeg,width=1280,height=720,framerate=15/1
- image/jpeg,width=1280,height=720,framerate=10/1
- image/jpeg,width=1280,height=720,framerate=5/1
- image/jpeg,width=800,height=600,framerate=30/1
- image/jpeg,width=800,height=600,framerate=25/1
- image/jpeg,width=800,height=600,framerate=20/1
- image/jpeg,width=800,height=600,framerate=15/1
- image/jpeg,width=800,height=600,framerate=10/1
- image/jpeg,width=800,height=600,framerate=5/1
- image/jpeg,width=640,height=480,framerate=30/1
- image/jpeg,width=640,height=480,framerate=25/1
- image/jpeg,width=640,height=480,framerate=20/1
- image/jpeg,width=640,height=480,framerate=15/1
- image/jpeg,width=640,height=480,framerate=10/1
- image/jpeg,width=640,height=480,framerate=5/1
- video/x-raw,format=YUY2,width=1280,height=720,framerate=10/1
- video/x-raw,format=YUY2,width=1280,height=720,framerate=5/1
- video/x-raw,format=YUY2,width=800,height=600,framerate=15/1
- video/x-raw,format=YUY2,width=800,height=600,framerate=10/1
- video/x-raw,format=YUY2,width=800,height=600,framerate=5/1
- video/x-raw,format=YUY2,width=640,height=480,framerate=30/1
- video/x-raw,format=YUY2,width=640,height=480,framerate=25/1
- video/x-raw,format=YUY2,width=640,height=480,framerate=20/1
- video/x-raw,format=YUY2,width=640,height=480,framerate=15/1
- video/x-raw,format=YUY2,width=640,height=480,framerate=10/1
- video/x-raw,format=YUY2,width=640,height=480,framerate=5/1Stream from a camera with device ID 0, using the capability "image/jpeg,width=1280,height=720,framerate=30/1", with codec set to jpeg.
Enable recording with --record, split the recording with -s, and limit the split files with --max-size-time (1 minute) and --max-files (4).
./build/Release/tool/tvcli stream --id 0 --cap "image/jpeg,width=1280,height=720,framerate=30/1" --codec "jpeg" --record -s --max-size-time 1 --max-files 4Example output:
[2025-04-28 13:19:51.524] [info] Received buffer: size=2764800, pts=238181123, width=1280, height=720, fpga_timestamp=163344901787, rhythm_timestamp=0, ttl_in=0, ttl_out=0, spi_perf_counter=136144539, reserved=0- boost (Boost Software License 1.0)
- CMake (New BSD License)
- cpr (MIT License)
- fmt (MIT License)
- GStreamer (LGPL-2.1)
- GoogleTest (BSD 3-Clause)
- Ninja (Apache License 2.0)
- nlohmann/json (MIT License)
- spdlog (MIT License)