🛠 Network Automation and Streaming on AIWorld P1

AIWorld P1 AI Module for BPI-M2 Ultra and Berry · intermediaire · Configurez le streaming vidéo RTSP et l'automatisation des tâches sur la carte AIWorld P1 en exploitant Gstreamer et le système Vecoo.

Objectives

This tutorial aims to transform your AIWorld P1 module into an intelligent surveillance node. You will learn to configure real-time video streaming via the RTSP protocol and automate service startup at boot. By combining the OV5640 camera, OpenMax hardware decoding, and the Gstreamer framework, you will create a robust solution for distributed computer vision. This intermediate use case requires a basic understanding of Linux command lines and networking.

Required Materials

Steps

Connect the board via USB. Use the VecooAT tool to transfer configuration files if necessary. Verify network connectivity with the following command to confirm the board is reachable on the local network: ``bash ifconfig ping 8.8.8.8 `` Note the IP address assigned to the wlan0 or eth0 interface.

  1. Connection and Network Configuration

Before automating, validate that the video pipeline works. The kit integrates Gstreamer V1.10 with RTSP support. Launch a simple RTSP server capturing the OV5640 camera feed at 720P 30fps. This step uses OpenMax hardware decoding to minimize CPU load: ``bash gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,framerate=30/1 ! videoconvert ! rtspclientsink location=rtsp://127.0.0.1:8554/stream `` *Note: Ensure the RTSP server is started or use a direct UDP pipeline to a client for the initial test.*

  1. Gstreamer Pipeline Test

Create a shell script to launch the stream automatically. Use a text editor to create the file /usr/local/bin/start_stream.sh: ``bash #!/bin/sh # Start AIWorld streaming service export GST_DEBUG=0 gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720 ! videoconvert ! rtspclientsink location=rtsp://0.0.0.0:8554/stream ` Make the script executable: `bash chmod +x /usr/local/bin/start_stream.sh ``

  1. Creating the Automation Script

To have the script run at boot under Vecoo Linux, create a systemd service. Create the file /etc/systemd/system/aiworld-stream.service: ```ini [Unit] Description=AIWorld P1 Video Stream After=network.target

  1. Configuring Auto-Start

[Service] ExecStart=/usr/local/bin/start_stream.sh Restart=always

[Install] WantedBy=multi-user.target `` Enable the service: `bash systemctl enable aiworld-stream.service systemctl start aiworld-stream.service ``

Verification

On your host PC, open VLC or an RTSP-compatible media player. Enter the address rtsp://[BOARD_IP]:8554/stream. You should see the 720P video feed from the OV5640 camera. Check the service status with systemctl status aiworld-stream.service to confirm it is active (green). If the stream is choppy, check CPU load with top; OpenMax support should keep usage low.

Going Further

Integrate OpenCV v3.2 to analyze the live feed. Use the ARM Computer Library 17.06 to accelerate face recognition algorithms directly on the Allwinner V40 SoC. You can also explore OpenGL ES 2.0 support via QT5.9 to display local graphical interfaces on a connected screen.

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials