Renamed opi_player as rtsp_ai_player

This commit is contained in:
Tuomas Järvinen
2024-07-14 19:52:45 +02:00
parent 813251b170
commit 8a7d681e5b
40 changed files with 43 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
# rtsp_ai_player
`rtsp_ai_player` is an application that listens to an RTSP stream, analyzes images with an AI model, and shows the results visually. It also controls a gimbal camera to zoom in on the recognized objects. Application uses YOLOv8 AI models converted to ONNX format.
## How to convert PT file to ONNX format
```bash
yolo export model=azaion-2024-06-28.pt dynamic=False format=onnx imgsz=640,640
```
## How to use application locally on a Linux PC.
### Install ffmpeg and mediamtx RTSP server:
```bash
sudo apt update
sudo apt install ffmpeg
wget https://github.com/bluenviron/mediamtx/releases/download/v1.8.4/mediamtx_v1.8.4_linux_amd64.tar.gz
tar xf -C mediamtx mediamtx_v1.8.4_linux_amd64.tar.gz
```
### Launch mediamtx RTSP server:
```bash
Start mediamtx RSTP server:
cd mediamtx
./mediamtx
```
### Play mp4 video file from RTSP server:
```bash
ffmpeg -re -stream_loop -1 -i $HOME/azaion/models/videos/for_ai_short.mp4 -c copy -f rtsp rtsp://localhost:8554/live.stream
```
### Test RTSP streaming with ffplay:
```bash
ffplay -rtsp_transport tcp rtsp://localhost:8554/live.stream
```
### Compile and run rtsp_ai_player:
```bash
cd autopilot/misc/rtsp_ai_player
qmake6 && make
./rtsp_ai_player ~/azaion/models/azaion/azaion-2024-06-28.onnx
```

Before

Width:  |  Height:  |  Size: 602 KiB

After

Width:  |  Height:  |  Size: 602 KiB