Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce Latency in RTMP streamings #688

Open
isaacroldan opened this issue Sep 9, 2021 · 1 comment
Open

Reduce Latency in RTMP streamings #688

isaacroldan opened this issue Sep 9, 2021 · 1 comment

Comments

@isaacroldan
Copy link

isaacroldan commented Sep 9, 2021

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:

  1. Open an RTMP streaming with Cicada
  2. Open the same streaming with FFPlay and -fflags nobuffer
  3. 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]
@pingkai
Copy link
Collaborator

pingkai commented Mar 23, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants