TeamNewPipe / NewPipe

A libre lightweight streaming front-end for Android.
https://newpipe.net
GNU General Public License v3.0
31.14k stars 3.02k forks source link

Video preloading #3251

Open FrameXX opened 4 years ago

FrameXX commented 4 years ago

I think that video preloading is too short. I am not talking about fetching before the video even start but when video stop (lag) and start to load. Newpipe is trying to load video fast so it load 1 second or little more forward and than start to play video, but after 1 second or more the video stop (lag) again and that repeat and repeat. You maybe say that i should use lower quality, but i say that video can be pretty stable in this quaility and strenght of internet connection. Maybe it will really help if newpipe would preload more time, for example 10 seconds. Yeah, it would take more time but it would be worth it because video would be much more stable with some bigger preloaded video time. I am not some kind of expert, but i am just normal user and maybe I say total stupidities here, but I tried to play the same video, in the same resolution, format, fps, etc. in other youtube alternative called Gettube. I don't know if you know it, but that doesn't matter, and video playback was much smoother because when video stop (lag) app preloaded much more time than it again start to play. I suggest to make video preloading time bigger or at least add option to make it bigger.

If I say stupidity, please instruct me a little.

Thank you for your support Jiří Král

opusforlife2 commented 4 years ago

Maybe it will really help if newpipe would preload more time, for example 10 seconds.

Newpipe preloads 2 minutes. Your internet connection is probably the issue here.

gkeegan commented 4 years ago

@opusforlife2 I think what is meant is when the video buffers to not resume play until 10 seconds has been loaded, to prevent a slideshow-like effect. I think it would be a good idea to have implemented.

opusforlife2 commented 4 years ago

Ah. In my (subjective) experience, Newpipe generally seems to buffer a good bit of the video before resuming after a stutter, but I have no idea how this is coded in the app, so maybe it's different for different connections. Good idea either way.

opusforlife2 commented 4 years ago

Have a look at this, devs.

wb9688 commented 4 years ago

@opusforlife2: @Redirion is the ExoPlayer guy ;)

Redirion commented 4 years ago

If I recall correctly, in a recent release ExoPlayer they did change buffer behavior (increased buffering size), so I wonder if this is still present. I will see if I can find it mentioned in the Release Notes and dig through the code.

Redirion commented 4 years ago

Turns out it was not so recent and just the maximum buffer in 2.10.5: https://github.com/google/ExoPlayer/blob/release-v2/RELEASENOTES.md#2105-2019-09-20

wb9688 commented 4 years ago

@Redirion: See https://github.com/TeamNewPipe/NewPipe/blob/dev/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java#L268

Redirion commented 4 years ago

That should help. Can you provide a test apk with lets say 1500ms? I am just on mobile at the moment.

wb9688 commented 4 years ago

@Redirion: app-debug.apk.zip should have 1500 ms (didn't test)

Redirion commented 4 years ago

I will try to test on monday. I have a short path of my way back to home from work, where I only have Edge(very slow mobile internet) 😁

Stypox commented 4 years ago

@Redirion any updates on this? Also, maybe the buffering at the beginning could be set to something really really low (like 100ms) and then be increased after the video starts (e.g. to 1000ms), so that when "Play" is tapped the video starts instantly, but then if there is not enough bandwidth repeated stutters are prevented

Redirion commented 4 years ago

on the contrary I would increase the startbuffer (like above suggested increasing from 500 to 1500ms). If we already start playing with just 100ms buffer we could easily end up in underruns on an unstable connection.