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
| Platform | Runtime Environment |
|---|---|
| Rhino Pi-X1 | Ubuntu 22.04, AidLux |
Preparations
Rhino Pi-X1 Hardware
Ubuntu 22.04 System or AidLux System
USB Camera
Configuration File Modification
- Execute the command to open the configuration file
sudo vim /usr/local/share/aidstream-gst/conf/aidstream-gst.conf- 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:
- inputAddr : Change to the actual device tree name of the connected USB camera
- outputAddr : Change to the actual streaming server address
- 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
- Execute the command to enter the example code directory
cd /usr/local/share/aidstream-gst/example/cxx- Create and enter the build directory
sudo mkdir build && cd build- Compile
sudo cmake .. && sudo makeExecute 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
sudo ./start 12Execute Example With AI Algorithm
sudo ./qnn_rtsp 12[file content end]