bilibili / ijkplayer

Android/iOS video player based on FFmpeg n3.4, with MediaCodec, VideoToolbox support.
GNU General Public License v2.0
32.53k stars 8.13k forks source link

live rtsp stream latency #3254

Open ngutman opened 7 years ago

ngutman commented 7 years ago

I'm using IJKPlayer on iOS to show live rtsp stream. I'm constantly getting latency of 400-500ms, trying to get it as low as possible. When streaming with other precompiled ffmpeg based libraries (like this I can get to 100ms - I'd really like to use ijkplayer.

I've tried playing with the following options to no avail - infbuf, packet-buffering, min-frames and also enabling videotoolbox support as I thought it might be related to slow decoding.

Would appreciate suggestions on how to lower the latency.

ngutman commented 7 years ago

Looking at the HUD info I see that the firstVideoFrameLatency is at 264msec and prepareDuration is at 187msec which can explain the delay, still not sure how to improve those values

Yelles commented 6 years ago

i'm interested too by the logic of prepareDuration. i have to restart X times the stream, every time i have a different ms between 400 and 200msec. How to stabilize that ?

RajivKulkarni707 commented 4 years ago

I am also interested in reducing latency (displayed as load-cost ) of about 800 milliseconds. The latency has something to do with number of frames. Don't know exactly how to reduce latency. Any help appreciated. Thanks