I'm quite new to video streaming and opencv in general. I wanted to stream my computations to another device via rtsp from a raspberry pi 3 using h264. I tried writing to a pipe using popen with ffmpeg to a ffserver anf with vlc creating rtsp servers to stream the content. Unfortunately I have huge lag in the stream, the best I could do was go down to 3 seconds.
Is there any way to achieve this? I'm open to consider other technologies.
Thank you
RTMP is no the best way to achieve low latency (< 5s).
I suggest you to use FFMPEG with pure RTP to stream the video to a RTPS server. Or use directly Gstreamer with Gst-RTSP-server, both are open solutions in C.
Latency will also be impacted by your encoder and the hardware it uses to process.
This question has more information.