mangui / flashls

HLS Flash Plugin/Player (Chromeless,OSMF,FlowPlayer,mediaelement.js,video.js,Clappr)
http://www.flashls.org
Mozilla Public License 2.0
750 stars 265 forks source link

avoid redownloading of fragments #12

Closed ankurss closed 9 years ago

ankurss commented 10 years ago

copy pasting mangui's previous post

mark the fragments that have already been loaded, to avoid switching up in case they are reloaded. this is the only way to get rid of this. a better alternative in the long term would be to to implement a fragment cache of configurable size, with LRU policy (in case we reach the cache size limit, the Least Recently Used items would be flushed, i.e. the oldest fragments in case of continuous playback)

portokala123 commented 9 years ago

Is this going to fix the problem when i try to seek in buffer? I setted up a buffer of 120 secs and when i try too seek 10 sec ahead, plugin redownload segments again and then it seeks. The problem is that i have relatively big segments (60 sec), and they are about 10Mb in size.

ankurss commented 9 years ago

Yes, that would be fixed once this is implemented.

sydcanem commented 9 years ago

any progress on this feature?

mangui commented 9 years ago

no, lack of spare time

ankurss commented 9 years ago

any progress ?

jwplayer has implemented this

mangui commented 9 years ago

indeed it looks like they added the ability to seek in the buffer without having to redownload the fragments. I guess they introduced an intermediate buffer, also used for alternate audio handing. I will think about this as part of alternate audio tag support.

mangui commented 9 years ago

Hi folks, seek in buffer is done. it needs some more testing you can check here : http://flashls.org/backbuffer/examples/flowplayer/ these are the latest swf/swc from flashls/altaudio branch the backbuffer/buffer is visible with flowplayer. any seek inside will be done from the buffer Cheers, Mangui

mangui commented 9 years ago

plz check https://github.com/mangui/flashls/releases/tag/v0.4.0 beware it is a prerelease

portokala123 commented 9 years ago

I tested it and it have a lot of problems. Open playlist doesn't start. Segments are downloaded but no video or audio. After seek its starts playing, but after some seek attempts outside of buffer audio stopped playing. On closed playlist its working most of the times, but again seeks outside of the buffer have similar problems.

mangui commented 9 years ago

@portokala123 my mistake, v0.4.0 does not contain updated swf/swc plz use v0.4.0.1 cheers, Mangui

mangui commented 9 years ago

is it better now ?

ankurss commented 9 years ago

Thanks for implementing this :)

looks to be working good, except in a case where i noticed that already buffered porting of video was downloading, when in auto mode

for example, when the stream started it was using X bitrate & then switched to Y bitrate, if i tried to play the portion of video which was played using X bitrate it would try dl the Fragements of Y bitrate

can this be avoided ? atleast when its using auto mode

phloxic commented 9 years ago

@ankurss - unless I misunderstood, I for one would not like/understand this behaviour. imho the chosen bitrate - optimal behaviour - is more important than saving on fragment downloads.

ankurss commented 9 years ago

@blacktrash yes, i would live to avoid saving on fragment downloads; in cases where user has selected auto

maybe this can be added as a option

mangui commented 9 years ago

@ankurss @blacktrash with current buffer implementation, buffer will always be reused/seekable regardless of auto/manual level mode. this means that when manually switching from auto or manual to y, buffer will not flushed.

I could consider adding an option hls_flush_buffer_on_manual_level_switch (or any other more appealing name):

plz comment, Mangui

ankurss commented 9 years ago

@mangui currently if seeking to already buffered part of the video, when playing on Y level, will it download Y fragment (if Y is not buffered, X is buffered) ?

mangui commented 9 years ago

currently, buffered X will be used

sydcanem commented 9 years ago

currently building this for videojs/flashls will update soon

portokala123 commented 9 years ago

I still have problems with seeking in buffered portion. On some occasion i lost audio, on some video stops playing. Current time is jumping also. I made a recording you can check it here https://www.screenr.com/4WLN

This is Flowplayer, plugin version v0.4.0.3

mangui commented 9 years ago

Hi @portokala123 could you share your stream ?

portokala123 commented 9 years ago

Here is the same playlist that i tested in the video:

https://mytv.bg/playlist/mplive2/btv_medium_2.stream/playlist.m3u8?DVR&time=1418887800&t1=1418887800&t2=1418896800&skip

sydcanem commented 9 years ago

Great update. Works well on videojs. Only issue I've found is when seeking, the buffer progress bar flickers. Here's a video that shows the flickering https://vimeo.com/116730774.

mangui commented 9 years ago

Hi @portokala123 @sydcanem would you mind rechecking your respective issues with latest flashls/dev ? while implementing altaudio support I did some fixing around seeking that might also address your issues cheers, Mangui

mangui commented 9 years ago

seek in buffer implemented