You've already forked M5Stack_Linux_Libs
mirror of
https://github.com/m5stack/M5Stack_Linux_Libs.git
synced 2026-05-20 11:01:38 -07:00
AXCL Sample Project
This project contains sample applications demonstrating the usage of AXCL (Axera Computing Library) for video processing on Axera AX8850 devices.
Overview
The AXCL Sample project provides three main sample applications:
- System Information Tool (
sys) - Device information and monitoring - Video Decoder (
vdec) - Video decoding functionality - Video Encoder (
venc) - Video encoding functionality
Features
- Device Management: Initialize and manage Axera AX8850 devices
- Video Decoding: Decode H.264/H.265 video streams with hardware acceleration
- Video Encoding: Encode video streams using hardware video encoders
- System Monitoring: Monitor device status, memory usage, CPU utilization, NPU usage, and thermal information
Prerequisites
- Axera AX8850 device
- ARM64 cross-compilation toolchain (
aarch64-none-linux-gnu-) - AXCL MSP (Media Signal Processing) libraries
- FFmpeg libraries for video demuxing
Building
-
Configure the build environment:
# The project uses SCons build system # Ensure your toolchain is properly configured in config_defaults.mk -
Build the project:
scons
Sample Applications
1. System Information Tool (sys)
Displays comprehensive device information including:
- Memory usage (RAM and CMM)
- CPU utilization
- NPU (Neural Processing Unit) utilization
- Device temperature
- Fan speed
Usage:
./sys
2. Video Decoder (vdec)
Decodes video files (MP4, H.264, H.265) using hardware acceleration.
Usage:
./vdec -i <input_file> [options]
Options:
-i, --url: Input video file path (required)-d, --device: Device index (default: 0)--count: Number of decoder groups (default: 1)--json: AXCL configuration file path (default: ./axcl.json)-w, --width: Frame width (default: 1920)-h, --height: Frame height (default: 1080)--VdChn: Channel ID (default: 0)--yuv: Transfer NV12 from device (default: 0)-o, --output: Output file path
Example:
./vdec -i sample.mp4 -o output.yuv --yuv 1
3. Video Encoder (venc)
Encodes video streams using hardware video encoders.
Usage:
./venc [options]
Refer to the help documentation (help.dat) for detailed parameter information.
Configuration
The project uses configuration files:
config_defaults.mk: Build configurationaxcl.json: Runtime AXCL configuration (if needed)
Dependencies
- AXCL Libraries: Core AXCL runtime and MSP libraries
- FFmpeg: For video demuxing and format support
- OpenCV: For image processing (in some components)
- pthread: For multi-threading support
Hardware Support
- Target Platform: Axera AX8850
- Architecture: ARM64 (aarch64)
- Hardware Acceleration: Video encoding/decoding, NPU processing
Notes
- Ensure proper device permissions for accessing Axera hardware
- The applications require root privileges or proper udev rules for device access
- Video formats supported depend on the hardware decoder capabilities
- Output formats are typically NV12 for decoded video and compressed streams for encoded video
Troubleshooting
- Device not found: Ensure the Axera device is properly connected and recognized
- Permission denied: Run with appropriate privileges or configure udev rules
- Library not found: Verify AXCL libraries are properly installed and in the library path
- Decoding errors: Check input file format compatibility and device capabilities