hama3254 / Crunchyroll-Downloader-v3.0

Downloader for Crunchyroll
843 stars 108 forks source link

parts that the video skips. #798

Closed nicooc18g closed 10 months ago

nicooc18g commented 1 year ago

crunchyroll

I'm sorry but I can't take a screenshot because it's a problem with video downloads and no error panel appears for that reason

When you download some chapters they download wrong and when you play the video there are parts that the video skips. I would like you to fix that problem, it always happens to me or I would like you to tell me the solution if there is, please

hama3254 commented 1 year ago

this issue is mostly due to the underlying technic of the streams. The video stream is usually split into 2 seconds parts, if something interrupts the transfer of the part you experience such an issue.

To reduce the problem there is detection build in (as explained in #794). This only detects issues, with the Hybrid Mode option in the Output we have the an alternativ download method. Without to much explanation, video processing is hard so i use a finished tool (ffmpeg.exe) which limits my options. There the hybrid mode comes in, i cache the stream local with my own code so the downloader does retry failed segments of the stream one time and i have a much higher timeout than ffmpeg (~6 seconds for ffmpeg vs 30 seconds for the hybrid mode).

Tobolobo commented 1 year ago

Not sure if it's the same problem, but I've found my video files to have some skips in them, too. Mostly around 4 Seconds. Haven't seen the new feature mentioned in the above post as I found and solved that issue for me about four months ago (didn't want to re-download Terabytes of data...). I just want to share my experience here.

I tried to create a small tool that checks if there are any frame skips with success. The only "easy" way I could find was to analyze each frame by using the output of ffprobe.exe and check if there are any time skips. The MKV format itself isn't corrupt, it's only missing some frames. Thus, you cannot just check for errors post-download e.g. by re-encoding and looking for errors. If you want, you can have a look at it. With it, I've checked around 40TB of Anime. The rate of files with frame skips was around 5% for me. Hybrid Mode is much more reliable, but still not perfect. Some series had more, some less. The tool also tells you the exact position of the skip in the video file. If it finds an error, just re-download and re-check it. I've only found two episodes in my library to really be corrupt, as re-downloading it several times always yielded the same result.

Here is the C# code. I'm not uploading EXEs or full Projects, because I don't know what kinds of metadata VS saves. ;) https://pastebin.com/33q6fi5A

San3-Cod3 commented 6 months ago

@Tobolobo - It would be great for you to officially publish that code on your GitHub page before it expires in 100 or so days - it would be great to turn this into a fully fledged GUI for different languages like C#, and Python to check for skipped frames - it would be great to build it into a great application with help from the Community.