SuRGeoNix / Flyleaf

Media Player .NET Library for WinUI 3/ WPF/WinForms (based on FFmpeg/DirectX)
GNU Lesser General Public License v3.0
687 stars 92 forks source link

Download limit support #185

Open swimfish09 opened 1 year ago

swimfish09 commented 1 year ago

Now downloader will download rtsp playback stream with 1x speed.

SuRGeoNix commented 1 year ago

Can you describe better the issue? It was not happening with the previous versions and started with 3.5.8? Is it a live rtsp stream?

swimfish09 commented 1 year ago

It is not a issue rather than a feature. Yes it is a live rtsp stream but can set speed of it. https://stackoverflow.com/questions/64818701/rtsp-audio-stream-playback-speed-with-vlcj

SuRGeoNix commented 1 year ago

For the downloader there is no point to set the speed as it will try to download it as fast as possible. I guess you mean the to set a download limit (KB/s)?

Or you mean to set the speed slower for the playback (because faster it doesn't really make sense on live steam)?

swimfish09 commented 1 year ago

Yes, limit download speed.

SuRGeoNix commented 1 year ago

@swimfish09 You can implement this at the application level. I'm not sure if it should be in the library. You could have many downloaders and set the limit based on all instead of each of them. You can do this by checking the demuxer's TotalBytes each second (sum all downloaders bytes) and if you pass the limit you pause them. Let me know what you think.

swimfish09 commented 1 year ago

ok, i aleady have tried with it. TotalBytes = DecCtx.VideoDemuxer.TotalBytes + DecCtx.AudioDemuxer.TotalBytes; Is this correct?

SuRGeoNix commented 1 year ago

Yes