Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:edge-2l:applications:object-detection-demo-with-rtsp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
products:sbc:edge-2l:applications:object-detection-demo-with-rtsp [2026/02/04 04:59]
gray To be confirm
— (current)
Line 1: Line 1:
-====== Edge-2L Object Detection with RTSP Streaming ====== 
-To be confirm! 
-/* 
-=== Overview === 
-This document describes how to compile and run the object detection demo with RTSP streaming on the ''Khadas Edge-2L'' using its ''NPU'' (Neural Processing Unit). 
  
-=== Prerequisites === 
-Before building the project, ensure your system is up to date and the required dependencies are installed: 
- 
-<code> 
-sudo apt update 
-sudo apt install cmake libopencv-dev 
-</code> 
- 
-=== Clone the Project === 
-Clone the official Khadas Edge-2L NPU repository: 
- 
-<code> 
-git clone https://github.com/khadas/edge-2l-npu 
-cd edge-2l-npu 
-</code> 
- 
-=== Compile === 
-Compile the project using the provided build script: 
- 
-<code> 
-bash build.sh 
-</code> 
- 
-=== Start RTSP Server with MediaMTX === 
-Before running the demo, ensure an RTSP server is running in your local network. You can use [https://github.com/bluenviron/mediamtx MediaMTX] or other RTSP servers. 
- 
-==== Install and Start MediaMTX ==== 
-<code> 
-wget https://github.com/bluenviron/mediamtx/releases/download/v1.11.3/mediamtx_v1.11.3_linux_amd64.tar.gz 
-tar -xzf mediamtx_v1.11.3_linux_amd64.tar.gz 
-cd mediamtx 
-./mediamtx 
-</code> 
- 
-By default, MediaMTX listens on port 8554. Once started, it's ready to receive RTSP streams. 
- 
-==== Stream a test video using FFmpeg ==== 
-<code> 
-ffmpeg -re -stream_loop -1 -i input.mp4 -c:v copy -an -f rtsp rtsp://<RTSP_SERVER_IP>:8554/live/stream 
-</code> 
- 
-Replace ''<RTSP_SERVER_IP>'' with the IP address of the machine running MediaMTX. 
- 
-=== Run the Demo === 
-Navigate to the output directory and run the demo: 
- 
-<code> 
-cd install/object_detection+RTSP 
-./object_detection+RTSP data/model/yolov8n.rknn 33 rtsp://<RTSP_SERVER_IP>:8554/live/stream 
-</code> 
- 
-=== Parameters === 
-<code> 
-data/model/yolov8n.rknn          # Path to RKNN model file 
-33                               # Camera device index (e.g., /dev/video33) 
-rtsp://<RTSP_SERVER_IP>:8554/... # RTSP server address 
-</code> 
- 
-=== RTSP Server Options === 
-You may use one of the following RTSP servers: 
-  * MediaMTX (recommended) 
-  * FFmpeg (as RTSP server) 
-  * VLC Streaming 
-  * RTSP Simple Server 
- 
-=== Play the RTSP Stream === 
-You can verify the RTSP stream using a player such as ''ffplay'' or ''VLC''. 
- 
-==== Option 1: ffplay (from FFmpeg) ==== 
-<code> 
-ffplay rtsp://<RTSP_SERVER_IP>:8554/live/stream 
-</code> 
-{{:local:users:jacobe:screenshot-from-2025-04-08-11-13-23.png?600|}} 
-==== Option 2: VLC ==== 
-Open VLC and go to: 
-  * Media → Open Network Stream 
-  * Enter the URL 
-  * Click ''Play'' 
- 
-Replace ''<RTSP_SERVER_IP>'' with the IP address of the RTSP server (e.g., ''192.168.31.19''). 
- 
- 
-=== Notes === 
-  * Ensure the specified video device (e.g., ''/dev/video33'') is connected and accessible. 
-  * The RTSP server must be reachable from the Edge-2L device (same LAN). 
-  * Encoder settings (e.g., resolution, bitrate, format) can be modified in the source code. 
-  * You can check your IP with: ''ip a'' or ''hostname -I'' 
- 
-*/ 
Last modified: 2026/02/04 04:59 by gray