Skip to main content

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
tip

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:

SettingDescription
Vin/Vout resolutionInput/output frame dimensions
Frame rateFPS for each stream
DewarpGeometric distortion correction
Flip/MirrorImage orientation transforms
HDRHigh dynamic range processing
Low-light AI denoiseAI-powered noise reduction

Encoder Config

Example: /usr/bin/frontend_encoders_sink*.json (sink0, sink1, ...)

Each encoder config corresponds to a Vout with matching resolution:

SettingDescription
Encoder formatH.264, HEVC (H.265), or MJPEG
Subtitle overlayText overlay on video
Image overlayLogo/watermark insertion
MaskPrivacy masking regions
Bitrate controlVBR (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

  1. Install toolchain on development host
  2. Activate environment before each build session
  3. Develop application using HML API
  4. Cross-compile for ARM target
  5. Deploy to Silight AI Camera board
  6. Test with appropriate JSON configurations

Next Steps