Reduce Latency in RTMP streamings
Describe the bug I'm working on a low-latency streaming service. Comparing an RTMP streaming with Cicada (iOS) versus FFPlay, the Cicada stream is always ~1 second behind FFPlay.
For FFPlay I use -fflags nobuffer, is there a way to pass a similar flag to Cicada or to the ffmpeg service inside it?
Could there be any other reason or configuration option why Cicada is behind FFPlay?
To Reproduce Steps to reproduce the behavior:
- Open an RTMP streaming with Cicada
- Open the same streaming with FFPlay and
-fflags nobuffer - See there is a diference and Cicada has more latency.
Expected behavior Both streams should have similar latency
Smartphone (please complete the following information):
- Device: iPhone 12 Pro
- OS: 14.5
- Version [e.g. 22]
AVFMT_FLAG_NOBUFFER will drop the packets read in avformat_find_stream_info(), you can add this flag to mCtx before avformat_find_stream_info for testing it , but I don't think this is a good method to reduce the latency, I think it will lead to slow down the first frame time, because it will drop the first key frame before decode, and the latency can't be keep by this way. You can use maxDelayTime in MediaPlayerConfig to keep the latency