ThibaultBee / StreamPack

SRT/RTMP/RTMPS live streaming libraries for Android
https://thibaultbee.github.io/StreamPack/index.html
Apache License 2.0
196 stars 70 forks source link

[Bug]: When using SRT to push 1080P video, the latency is severe, about 7 seconds! #84

Closed TaylorsZ closed 10 months ago

TaylorsZ commented 10 months ago

Version

2.5.2

Environment that reproduces the issue

HUAWEI M5

RTMP/SRT/... Server

SRS Server

Audio configuration

startBitrate = 128000, sampleRate = 44100, channelConfig = AudioFormat.CHANNEL_IN_STEREO

Video configuration

startBitrate = 2000000, resolution = Size(1920, 1080), fps = 30, mimeType = MediaFormat.MIMETYPE_VIDEO_AVC

Is it reproducible in the demos application?

Yes

Reproduction steps

always

Expected result

The video delay is less than 1s

Actual result

When using SRT to push 1080P video, the latency is severe, about 7 seconds!

Additional context

No response

Relevant logs output

No response

ThibaultBee commented 10 months ago

Hi there,

How do you measure latency?

CzinkeM commented 10 months ago

@TaylorsZ Hi! As I experienced and I remember correctly the server could add some additional latency depend on what software you use, also image stabilization could hurt your latency. With correct software and networking its easy to achieve sub second latency.

ThibaultBee commented 10 months ago

Indeed, the server could be buffering and if you are trying to playback the stream, your player could be also buffering.

I guess in your case, the latency is for the while chain from your camera to your player which means:

your latency = encoder latency + srt latency + server latency + network latency + player latency.

Without any other context/information, as third parties are also involved in this latency, I am closing the issue.