Skip to content

Implementing AidStream-gst via USB Camera

Introduction

AidStream SDK is a streaming media data processing toolkit, suitable for building AI-based video analytics applications and services. It can fully leverage hardware acceleration technologies (such as GPU, VPU, NPU) to achieve end-to-end application acceleration.

In this case study, we focus on how to configure a USB camera to implement a complete streaming media data processing method based on the AidStream SDK.

SDK Details

Before testing this case, you can view the detailed introduction of the AidStream SDK.

Supported Platforms

PlatformRuntime Environment
Rhino Pi-X1Ubuntu 22.04, AidLux

Preparations

  1. Rhino Pi-X1 Hardware

  2. Ubuntu 22.04 System or AidLux System

  3. USB Camera

Configuration File Modification

  1. Execute the command to open the configuration file
shell
sudo vim /usr/local/share/aidstream-gst/conf/aidstream-gst.conf
  1. The content at the very bottom of the configuration file, i.e., the key-value pair with id 12, provides a reference example. You can modify the following content accordingly:
    1. inputAddr : Change to the actual device tree name of the connected USB camera
    2. outputAddr : Change to the actual streaming server address
    3. width/height : Change to the required resolution

Note

The code provides an example of the key-value pair with id 12 by default. You can also add or modify key-value pairs of other ids as needed, ensuring they remain in JSON format.

Code Compilation

  1. Execute the command to enter the example code directory
shell
cd /usr/local/share/aidstream-gst/example/cxx
  1. Create and enter the build directory
shell
sudo mkdir build && cd build
  1. Compile
shell
sudo cmake .. && sudo make

Execute Code Examples

After compilation in the previous step, multiple executable programs will be generated. We can execute the following programs for example verification based on whether the AI algorithm is run.

Note

Since the key-value pair with id 12 was modified in the steps above, the parameter passed in the following examples is 12. You can also pass other parameters based on your actual configuration.

Execute Example Without AI Algorithm

shell
sudo ./start 12

Execute Example With AI Algorithm

shell
sudo ./qnn_rtsp 12

[file content end]