I'm looking for a solution to send a video stream from a USB camera connected to an ESP-32-S3 to an rtsp-simple-server. https://github.com/aler9/rtsp-simple-server
There are many solutions to transform an ESP into a server but I want the ESP to be a client. It will have to stream the video stream from the camera to a server. Unfortunately I don't know how to do that.
- Is there a way to add the FFMPEG lib (or similar) in an ESP project ?
- Transform the ESP into a server with Micro-RTSP and use the proxy mode of rtsp-simple-server ?
- Any idea ?
Dev env:
- Platformio + VSCode
- ESP-IDF (Framework)
- ESP-IOT-SOLUTION (component USB)
- LovyanGFX + LVGL (GUI)
Hardware:
- ESP32-S3 Parallel TFT with Touch 3.5'' ILI9488: https://www.makerfabs.com/esp32-s3-parallel-tft-with-touch-ili9488.html
- USB Camera
Thank you in advance for your ideas!
02 Answers
I found an alternative to solve my problem: The ESPs will be RTSP servers, there will be an rtsp-simple-server in proxy mode to link each ESP on a local server. I will make an API using FFMPEG which will restream on the target RTSP server with this command: ffmpeg -rtsp_transport tcp -i "rtsp://ip_proxy_rtsp:8554/mystream1" -rtsp_transport tcp -c:v libx264 -c:a copy -f rtsp rtsp://ip_server_rtsp_target/mystream2
This way I would just have to call an endpoint of my API to stream an ESP to a remote RTSP server
If you are looking at the native IDF then Websockets offer 2 types of packet (string & binary) which makes a very convienient streaming carrier of text metadata and binary video.
Its TCP so guaranteed, bi-directional and can have multiple clients, so your server woould need to be written but that is just serialising the packets to a stream or file again.
Autobhan websockets is a really solid RAD for that.
Whilst having a rehash myself I missed https://www.espressif.com/en/news/ESP-RTC that was released Aug 5, 2022
ncG1vNJzZmirpJawrLvVnqmfpJ%2Bse6S7zGiorp2jqbawutJobm5qZW6CdoGOoaawZaSkerTA0Z6YpmWmnrGmu4ytpmaqpKi9br%2FIpqelnV2osrPCxKtksKGknXqmv89saWarYw%3D%3D