How to reduce streaming delay
hi, thanks for your great work. I am using your library for an android design. I can successfully stream to an rtsp server. The problem is that I have 4-5 seconds of latency, even with a local network. I also tried to compile your application with demos and I get the same result. I tried to play with the encoder parameters, but didn't get any changes. Before using your library, I tried to use ffmpeg directly to the same rtsp server and with that I have a maximum of one second delay. Did they match what you expect? Do you have any advice on how to reduce latency, even at the cost of quality? Thanks a lot.
I haven't this latency on local network. I'm not using any cache or buffer to increase latency so it is a combination of:
- Device speed (time from the frame is created to the frame is send to server)
- Network delay (in this case local so it is close to 0)
- Server
- Player
Player used: ffplay Device used: Openplus 7T
https://github.com/aler9/rtsp-simple-server
First server. Using OpenGl RTSP example (2,4s):

https://github.com/EasyDarwin/EasyDarwin
Second server. Using OpenGl RTSP example(2s):

Keep in mind that it is not a totally real time protocol. 5s is fine
Thank you for the reply. For my test I'm using rtsp-simple-server as server, ffplay as player and a redmi note 7 as device. It's quite less poweful than your phone, maybe the bottleneck is here. Thanks again