Exoplayer: Slow Start Video Play (Firebase)

Created on 28 Sep 2019  Â·  16Comments  Â·  Source: google/ExoPlayer

[REQUIRED] Searched documentation and issues

I searched in a lot of sites and stackoverflow, but i didnt find much thing about..
is always de same about buffering e e some changes in these values.

[REQUIRED] Question

First sorry for my english...
My question is.. i have some videos in firebase storage provided by google..and i have good internet connection so
i have a url and exoplayer is playing normal the video.
But its take too long to start the video..almost 4 seconds and the video is small ..just 1.40 MB
and 15 seconds...

Its normal?

Im using this config

//Minimum Video you want to buffer while Playing
public static final int MIN_BUFFER_DURATION = 15000;
//Max Video you want to buffer during PlayBack
public static final int MAX_BUFFER_DURATION = 60000;
//Min Video you want to buffer before start Playing it
public static final int MIN_PLAYBACK_START_BUFFER = 2500;
//Min video You want to buffer when user resumes video
public static final int MIN_PLAYBACK_RESUME_BUFFER = 15000;

I just want my video start fast... not super fast ..but 4 seconds buffering all videos is
really boring..

question

All 16 comments

Have you tried decreasing the MIN_PLAYBACK_START_BUFFER? What is the format of the files you are playing?

i tried to put 500 but not change...

mp4 type

and server is from firebase storage.

Em seg, 30 de set de 2019 às 10:43, kim-vde notifications@github.com
escreveu:

Have you tried decreasing the MIN_PLAYBACK_START_BUFFER? What is the
format of the files you are playing?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/google/ExoPlayer/issues/6484?email_source=notifications&email_token=AGXVDFUM3I7XE2XXR2FHWLLQMH673A5CNFSM4I3OCKOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD75VWDI#issuecomment-536566541,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGXVDFWL2Q7GAX3V3DAM6WLQMH673ANCNFSM4I3OCKOA
.

its take a 4 or 5 seconds to start a video.

Em seg, 30 de set de 2019 às 18:45, Lucas Bergamo bergamo86@gmail.com
escreveu:

i tried to put 500 but not change...

mp4 type

and server is from firebase storage.

Em seg, 30 de set de 2019 às 10:43, kim-vde notifications@github.com
escreveu:

Have you tried decreasing the MIN_PLAYBACK_START_BUFFER? What is the
format of the files you are playing?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/google/ExoPlayer/issues/6484?email_source=notifications&email_token=AGXVDFUM3I7XE2XXR2FHWLLQMH673A5CNFSM4I3OCKOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD75VWDI#issuecomment-536566541,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGXVDFWL2Q7GAX3V3DAM6WLQMH673ANCNFSM4I3OCKOA
.

I try to test with demo.. changing the url anf put my url firebase
storage.. but i think its is server..problem because its not possible..
is very bad wait 4 seconds to start a video..

Em seg, 30 de set de 2019 às 18:46, Lucas Bergamo bergamo86@gmail.com
escreveu:

its take a 4 or 5 seconds to start a video.

Em seg, 30 de set de 2019 às 18:45, Lucas Bergamo bergamo86@gmail.com
escreveu:

i tried to put 500 but not change...

mp4 type

and server is from firebase storage.

Em seg, 30 de set de 2019 às 10:43, kim-vde notifications@github.com
escreveu:

Have you tried decreasing the MIN_PLAYBACK_START_BUFFER? What is the
format of the files you are playing?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/google/ExoPlayer/issues/6484?email_source=notifications&email_token=AGXVDFUM3I7XE2XXR2FHWLLQMH673A5CNFSM4I3OCKOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD75VWDI#issuecomment-536566541,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGXVDFWL2Q7GAX3V3DAM6WLQMH673ANCNFSM4I3OCKOA
.

I don't have enough information at the moment to investigate this issue. You should try to determine if it comes from the server or from Exoplayer first.

but the server is google cloud plataform.. the latency is low .. do you want some video url ?

but tell me..its a normal behavior wait 4 seconds to start a video? even if as 12 seconds?
my network is good no problem with that..

im a bit confused now.
You said enough information,, what kind information u need? Because so real this.. if a put the video in google cloud or amazon s3.. take 3 seconds each video..

imagine a list of videos in recycleview or viewpager.. imagine scrolling waiting 4 seconds.. and watch... scrolling...waiting 4 seconds and watch ...

i dont want to cache all videos in phone storage for watch...its not a point because
some users not have enough space...

My expected behavior is for sure .load first seconds in the video and play streaming and loading the rest of video ... normal behavior for exoplayer right ?

thanks for you attention

You should first try to determine if it is an ExoPlayer issue and why/where it occurs more specifically. You could for example check how much time the server takes to respond to the ExoPlayer requests. You could also clone the Exoplayer project and add logs to see which component is time consuming.

but the server is google cloud plataform.. the latency is low .. do you want some video url ?

You can share some urls. I will check if the video takes time to start for me as well. If you're unable to share test content publicly, please send them to dev.[email protected] using a subject in the format "Issue #1234", where "#1234" should be replaced with your issue number. Please also update this issue to indicate you’ve done this.

but tell me..its a normal behavior wait 4 seconds to start a video? even if as 12 seconds?

I agree it is quite slow.

You said enough information,, what kind information u need? Because so real this.. if a put the video in google cloud or amazon s3.. take 3 seconds each video..

Are you saying that, if you put your video in another server, it is still taking several seconds to start? Is it any faster or slower in that case?

My expected behavior is for sure .load first seconds in the video and play streaming and loading the rest of video ... normal behavior for exoplayer right ?

Indeed.

the e-mail with url go directly for you Kim ?

Em qui, 3 de out de 2019 às 08:09, kim-vde notifications@github.com
escreveu:

You should first try to determine if it is an ExoPlayer issue and
why/where it occurs more specifically. You could for example check how much
time the server takes to respond to the ExoPlayer requests. You could also
clone the Exoplayer project and add logs to see which component is time
consuming.

but the server is google cloud plataform.. the latency is low .. do you
want some video url ?

You can share some urls. I will check if the video takes time to start for
me as well. If you're unable to share test content publicly, please send
them to dev.[email protected] using a subject in the format "Issue #1234
https://github.com/google/ExoPlayer/pull/1234", where "#1234
https://github.com/google/ExoPlayer/pull/1234" should be replaced with
your issue number. Please also update this issue to indicate you’ve done
this.

but tell me..its a normal behavior wait 4 seconds to start a video? even
if as 12 seconds?

I agree it is quite slow.

You said enough information,, what kind information u need? Because so
real this.. if a put the video in google cloud or amazon s3.. take 3
seconds each video..

Are you saying that, if you put your video in another server, it is still
taking several seconds to start? Is it any faster or slower in that case?

My expected behavior is for sure .load first seconds in the video and play
streaming and loading the rest of video ... normal behavior for exoplayer
right ?

Indeed.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/google/ExoPlayer/issues/6484?email_source=notifications&email_token=AGXVDFX4NHGU7RHZJWRHGZTQMXHG3A5CNFSM4I3OCKOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAH3AAY#issuecomment-537899011,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGXVDFR3JGQ6CFDRMLZXFGLQMXHG3ANCNFSM4I3OCKOA
.

It is sent to the members of the ExoPlayer team.

this is the code for play the video

if (player == null) {
// 1. Create a default TrackSelector

LoadControl loadControl = new DefaultLoadControl.Builder()
        .setBufferDurationsMs(MIN_BUFFER_DURATION,
                MAX_BUFFER_DURATION,
                MIN_PLAYBACK_START_BUFFER,
                MIN_PLAYBACK_RESUME_BUFFER).createDefaultLoadControl();

BandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
TrackSelection.Factory videoTrackSelectionFactory =
        new AdaptiveTrackSelection.Factory(bandwidthMeter);
TrackSelector trackSelector =
        new DefaultTrackSelector(videoTrackSelectionFactory);
// 2. Create the player
player = ExoPlayerFactory.newSimpleInstance(new

DefaultRenderersFactory(this), trackSelector, loadControl);
video.setPlayer(player);
}

// Measures bandwidth during playback. Can be null if not required.
DefaultBandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
// Produces DataSource instances through which media data is loaded.
DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(this,
Util.getUserAgent(this, getString(R.string.app_name)), bandwidthMeter);
// This is the MediaSource representing the media to be played.
MediaSource videoSource = new ExtractorMediaSource.Factory(dataSourceFactory)
.createMediaSource(Uri.parse(StoryListResources.get(StoryCounter).getURL_RESOURCE()));
// Prepare the player with the source.

loading.setVisibility(View.VISIBLE);
player.prepare(videoSource,false,false);
player.setPlayWhenReady(true);
player.addListener(this);

Em qui, 3 de out de 2019 às 10:59, kim-vde notifications@github.com
escreveu:

It is sent to the members of the ExoPlayer team.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/google/ExoPlayer/issues/6484?email_source=notifications&email_token=AGXVDFTLHYUPIBVJUSW2U5TQMX3ETA5CNFSM4I3OCKOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAIJKVQ#issuecomment-537957718,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGXVDFSZ6I6R6CK4NEE54SLQMX3ETANCNFSM4I3OCKOA
.

Hi kim!
Good Morning, didi u see the email?
tks!

Em qui, 3 de out de 2019 às 13:00, Lucas Bergamo bergamo86@gmail.com
escreveu:

this is the code for play the video

if (player == null) {
// 1. Create a default TrackSelector

LoadControl loadControl = new DefaultLoadControl.Builder()
        .setBufferDurationsMs(MIN_BUFFER_DURATION,
                MAX_BUFFER_DURATION,
                MIN_PLAYBACK_START_BUFFER,
                MIN_PLAYBACK_RESUME_BUFFER).createDefaultLoadControl();

BandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
TrackSelection.Factory videoTrackSelectionFactory =
        new AdaptiveTrackSelection.Factory(bandwidthMeter);
TrackSelector trackSelector =
        new DefaultTrackSelector(videoTrackSelectionFactory);
// 2. Create the player
player = ExoPlayerFactory.newSimpleInstance(new DefaultRenderersFactory(this), trackSelector, loadControl);
video.setPlayer(player);

}

// Measures bandwidth during playback. Can be null if not required.
DefaultBandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
// Produces DataSource instances through which media data is loaded.
DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(this,
Util.getUserAgent(this, getString(R.string.app_name)), bandwidthMeter);
// This is the MediaSource representing the media to be played.
MediaSource videoSource = new ExtractorMediaSource.Factory(dataSourceFactory)
.createMediaSource(Uri.parse(StoryListResources.get(StoryCounter).getURL_RESOURCE()));
// Prepare the player with the source.

loading.setVisibility(View.VISIBLE);
player.prepare(videoSource,false,false);
player.setPlayWhenReady(true);
player.addListener(this);

Em qui, 3 de out de 2019 às 10:59, kim-vde notifications@github.com
escreveu:

It is sent to the members of the ExoPlayer team.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/google/ExoPlayer/issues/6484?email_source=notifications&email_token=AGXVDFTLHYUPIBVJUSW2U5TQMX3ETA5CNFSM4I3OCKOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAIJKVQ#issuecomment-537957718,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGXVDFSZ6I6R6CK4NEE54SLQMX3ETANCNFSM4I3OCKOA
.

I don't think the issue is in ExoPlayer.

Indeed, if you download the video file, push it to the device (e.g. adb push <your file>.mp4 /sdcard) and read it from there (e.g. using uri /sdcard/<your file>.mp4in the demo app), the video starts much faster.

It is probably not due to your Internet connection either because the video is slow to start for me as well (about 2 to 4 seconds).

I would try to find out how much time the server takes to answer the requests from ExoPlayer.

Hi kim!

Exactly! The problem happens when i load video from URL, because the user
scroll the recycle and load the video.. or click to watch video in some
intent process.. but from sdcard is OK.. but we not cache all videos before
in cache and after
play in exoplayer... we need to use the main exoplayer function load video
faster and playing while still loading.. And exoplayer is the best tool i
see in this case.

But i dont know why this is happening.. how u said.. its happen with you
too .. its take almost 4 second to play a video with 20 seconds.. in
somewhere is a problem.. I can imagine that google cloud storage have a
high latency for storage..
i imagine the inverse.. they have a low and quality latency ..

But i dont know what to do..if we can't do that.. because i cant change my
storage server.... so.. in amazon s3 is take the same time, but i dont have
a video there anymore.

I just need load 20 seconds video faster ..just that. =/

thanks!

Em sex, 4 de out de 2019 às 12:23, kim-vde notifications@github.com
escreveu:

I don't think the issue is in ExoPlayer.

Indeed, if you download the video file, push it to the device (e.g. adb
push .mp4 /sdcard) and read it from there (e.g. using uri /sdcard/ file>.mp4in the demo app), the video starts much faster.

It is probably not due to your Internet connection either because the
video is slow to start for me as well (about 2 to 4 seconds).

I would try to find out how much time the server takes to answer the
requests from ExoPlayer.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/google/ExoPlayer/issues/6484?email_source=notifications&email_token=AGXVDFR7XC6J3NLH3ROPFPDQM5NXPA5CNFSM4I3OCKOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAMAASA#issuecomment-538443848,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGXVDFSWBJZCRIRJAFV76GDQM5NXPANCNFSM4I3OCKOA
.

I don't have enough information at the moment to investigate this issue. It is unclear whether anything is wrong. I need evidence that there is an issue and that it is linked to ExoPlayer.

I see..

but you check how long server response to exeployer? because for you have
this lag too..
Help me my friend plz

Em seg, 7 de out de 2019 às 06:18, kim-vde notifications@github.com
escreveu:

I don't have enough information at the moment to investigate this issue. I
need evidence that this is an ExoPlayer issue and I need more details about
what is happening.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/google/ExoPlayer/issues/6484?email_source=notifications&email_token=AGXVDFUEPZX6SAXPWSBCMD3QNL5GBA5CNFSM4I3OCKOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAPSIVI#issuecomment-538911829,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGXVDFSLV5KCAH3URIJ7W4LQNL5GBANCNFSM4I3OCKOA
.

We have mp4 samples in the demo app that are on Google Cloud Storage and start playing after 1 or 2 seconds (e.g. Misc > Screens 1080p video (FMP4,H264)). You should try putting your sample there to see if it improves the start time. Please note that an unoptimized configuration of the server (e.g. geographic region) could be the cause of a slow response.

I will close the issue because we don't have the resources to debug it without any evidence that it is linked to ExoPlayer. Feel free to come back to us once you have more information.

Was this page helpful?
0 / 5 - 0 ratings