Skip to content

Latency playing RTSP video  #11221

@stratosk

Description

@stratosk

I'm using ExoPlayer for RTSP streaming video.
When I initially set the mediaSource and prepare the player, the video starts to play after ~10sec.
So, the video is already 10 sec behind the edge of the stream.

I use a listener like this:

override fun onPlaybackStateChanged(state: Int) {
                super.onPlaybackStateChanged(state)
                if (state == Player.STATE_READY) {
                    val bufferedPosition = exoPlayer.bufferedPosition
                    exoPlayer.seekTo(bufferedPosition)
                }
            }

in order to seek to the end of the stream once the video starts to play.
This cause a delay of another 10 seconds that the video freezes (due to buffering) but at the end the player almost is synced to the end of the stream.

I use this configuration for load control and livePlaybackSpeedControl:

        val loadControl = DefaultLoadControl.Builder()
            .setBufferDurationsMs(
                400,
                3000,
                400,
                400
            )
            .build()
        val livePlaybackSpeedControl = DefaultLivePlaybackSpeedControl.Builder()
            .setFallbackMinPlaybackSpeed(0.5f)
            .setFallbackMaxPlaybackSpeed(1.5f)
            .build()

Is there anything I can do to minimize these 10 seconds delays?

Thanks in advance!

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions