Cross-Compilation Setup
This guide covers setting up the cross-compilation environment and building applications using the Hailo Media Library (HML) for the Silight AI Camera.
SDK Download
The software package contains the cross-compilation toolchain and board utilities. Download the Vision Processor Software Package from the resources section.
Package Contents
hailo_vision_processor_sw_package/
├── prebuilt/
│ ├── sbc/
│ │ ├── sdk/
│ │ │ └── poky-glibc-x86_64-*-hailo15-sbc-toolchain-4.0.23.sh
│ │ └── ...
│ └── images/
│ └── hailo15-yocto-image.wic
└── tools/
└── hailo15_board_tools_*.whl
Cross-Compilation Toolchain
Install Toolchain
Locate the toolchain installer in the SDK package:
# Navigate to SDK location
cd hailo_vision_processor_sw_package/prebuilt/sbc/sdk/
# Run installer (default path: /opt/poky/4.0.23)
./poky-glibc-x86_64-*-hailo15-sbc-toolchain-4.0.23.sh
Activate Environment
Before compiling HML applications, activate the cross-compilation environment:
. /opt/poky/4.0.23/environment-setup-armv8a-poky-linux
Add this to your shell profile or run it in each terminal session before building.
Hailo Media Library (HML)
HML provides the API for developing video processing applications on the Silight AI Camera.
Download Source
git clone https://github.com/hailo-ai/hailo-media-library
cd hailo-media-library
Compile HML
With the cross-compilation environment activated:
meson build
ninja -C build
HML Application Development
Configuration Files
HML applications require JSON configuration files at runtime. You can use:
- System presets:
/usr/bin/*.json(on the target board) - Custom configs: Specify your own path when loading
Most JSON settings can be dynamically adjusted via HML API during program execution.
Frontend Config
Example: /usr/bin/frontend_config_example.json
Configures video input and output processing:
| Setting | Description |
|---|---|
| Vin/Vout resolution | Input/output frame dimensions |
| Frame rate | FPS for each stream |
| Dewarp | Geometric distortion correction |
| Flip/Mirror | Image orientation transforms |
| HDR | High dynamic range processing |
| Low-light AI denoise | AI-powered noise reduction |
Encoder Config
Example: /usr/bin/frontend_encoders_sink*.json (sink0, sink1, ...)
Each encoder config corresponds to a Vout with matching resolution:
| Setting | Description |
|---|---|
| Encoder format | H.264, HEVC (H.265), or MJPEG |
| Subtitle overlay | Text overlay on video |
| Image overlay | Logo/watermark insertion |
| Mask | Privacy masking regions |
| Bitrate control | VBR (Variable Bitrate) or CVBR (Constant Variance Bitrate) |
Loading Configuration
#include <hailo_media_library.hpp>
// Load from system preset
PipelineConfig config;
config.load_from_json("/usr/bin/frontend_config.json");
// Or load custom configuration
config.load_from_json("/path/to/custom_config.json");
// Start pipeline
MediaPipeline pipeline(config);
pipeline.start();
Dynamic Configuration
Most settings can be adjusted at runtime via HML API:
// Example: Adjust bitrate dynamically
pipeline.set_encoder_bitrate(sink_id, new_bitrate);
// Example: Toggle HDR
pipeline.set_hdr_enabled(true);
Development Workflow
- Install toolchain on development host
- Activate environment before each build session
- Develop application using HML API
- Cross-compile for ARM target
- Deploy to Silight AI Camera board
- Test with appropriate JSON configurations
Next Steps
- Media Library API - Detailed API reference
- YOLO Demo - Object detection example
- WebUI - Browser-based camera control