media-kit / media-kit

A cross-platform video player & audio player for Flutter & Dart.
https://github.com/media-kit/media-kit
MIT License
916 stars 132 forks source link

[Bug Report] seeking in HLS stream loads all intermediate .ts segments #395

Open ANC1024GO opened 9 months ago

ANC1024GO commented 9 months ago

when i “Seek” playing video then to the certine duration, for example seek from 5 minut to 1 hour position, the player loading all ts files beetwin 5 minut to 1 hour position, and not loading ts files from the 1 hour positon, that is totally unnessecory, how do i prevent that, Thank you. (Sorry for my bad English)

alexmercerind commented 9 months ago

Edited the title a bit. Can you provide us a sample to play around with?

alexmercerind commented 9 months ago

We can't work without a sample of file/URL.

ANC1024GO commented 9 months ago

@alexmercerind i m test using this https://events-delivery.apple.com/0105cftwpxxsfrpdwklppzjhjocakrsk/vod_main_dcxgfpCbhQsgAaxKGMVqZMCdBHZnMpJM/sdr_hvc_1080p_7000/prog_index.m3u8

ANC1024GO commented 9 months ago

15 seconds in advance is normal, 40~50 minutes in advance or so will stay in the state of disappearance for a long time, and eventually will stop, re-play will start from scratch.(Sorry for my bad English)

DEBUG CONSOLE: [https @ 0x7fe9ec5bfc00] Opening 'https://xxx.xx/movie/454/1/480p_265/1688611360.m4s?t=1692777697&sign=ec5a57b3727835a1e00e07bc54ff4f1c' for reading [https @ 0x7fe9ec5ba800] Opening 'https://xxx.xx/movie/454/1/480p_265/1688611361.m4s?t=1692777697&sign=79d3af52b1a7cc191eafec7dcef5c809' for reading [https @ 0x7fe9ec5bfc00] Opening 'https://xxx.xx/movie/454/1/480p_265/1688611362.m4s?t=1692777697&sign=114b536da039d6031cdc1909614cf1ca' for reading [https @ 0x7fe9ec5ba800] Opening 'https://xxx.xx/movie/454/1/480p_265/1688611363.m4s?t=1692777697&sign=39932dd83f8004d9b85d50ca0caa8649' for reading [https @ 0x7fe9ec5bfc00] Opening 'https://xxx.xx/movie/454/1/480p_265/1688611364.m4s?t=1692777697&sign=dea95c3fd0ac3cb1580a20465b6dfc0b' for reading [https @ 0x7fe9ec5ba800] Opening 'https://xxx.xx/movie/454/1/480p_265/1688611365.m4s?t=1692777697&sign=c23ec61a0b99a6737559ad3ef71f37ed' for reading flutter: media_kit: wakelock: _count = 0

alexmercerind commented 9 months ago

Thanks for the details, I will try to make any possible improvements.

BTW: your english is just fine, there's no need to apologise over & over. :bowtie:

ANC1024GO commented 9 months ago

thanks

alexmercerind commented 9 months ago

The patch didn't actually resolve the problem.

alexmercerind commented 9 months ago

Just leaving the problem statement in-case any one visits other than me:

If we seek within the demuxer cache, the seek actually works correctly. But if we seek by a large amount i.e. outside of the demuxer cache, then playback will be endlessly stuck forever. I'm seeing this behavior specifically with this stream.

ANC1024GO commented 9 months ago

bug not fix , i`m testing [MacOs,IOS] use media_kit: ^1.1.7, 😢😢😢😢, if HLS 264 is ok, HLS 265 seek by a large amount i.e. outside of the demuxer cache, then playback will be endlessly stuck forever, you can help me?

birros commented 9 months ago

The iOS and macOS libs containing the "patch" have not yet been deployed.

birros commented 9 months ago

The patch didn't actually resolve the problem.

I confirm that the patch doesn't solve this issue.

ANC1024GO commented 9 months ago

i`m waiting for you fix this bug, 🥲 🍮

alexmercerind commented 9 months ago

i`m waiting for you fix this bug.

Unfortunately it'll take a lot of time. I'm not a regular contributor of FFmpeg. I don't know if it's HLS demuxer or H265 decoder that's causing trouble. On the other hand, it's not our highest priority either.

ANC1024GO commented 7 months ago

If only this problem could be solved.

alexmercerind commented 7 months ago

Apologies man; it's hard to work on this one. If you provide any fixes or patches to FFmpeg; we may apply.