-
-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Canary] Transcoding Support #3489
Conversation
Fixed test and benchmark DI. Point docker-build to another hub Edit dockerfile and include jxl package.
1. Supported Image Formats came in the accept flag from the browser. 2. If jxl (or future formats, ie browser not supported AVIF, HEIF, etc) are not supported, Kavita will convert it to a suitable display format via conversion providers. 3. if it supported it will return the image as is, no conversion needed. 4. Thumbnails are always converted.
This reverts commit 7f6db24.
This reverts commit 9d48664.
1. Supported Image Formats came in the accept flag from the browser. 2. If jxl (or future formats, ie browser not supported AVIF, HEIF, etc) are not supported, Kavita will convert it to a suitable display format via conversion providers. 3. if it supported it will return the image as is, no conversion needed. 4. Thumbnails are always converted.
…gick. Rollback IOsInfo.cs
Fix GetCoverImage, trying to create a temporary image in current directory, and rename the parameter field name, that generates a wrong asumption.
Optimize Cover Creation
Removing ImageConvertors (No Longer Needed) Refactored mime types and extensions constants
Enable back docker build/push
…a/Kavita into RemoveSixLaborsAndNetVips
Added Per Image Lock on conversion, to prevent multiple threads from processing the same image at the same time.
Added Quality From EncodedFormat Extension
Q8 is a lot faster new DefineConstants Q8, Q16 and Q16HDRI can be passed to build if you want any variation, default is Q8. Q16 and Q16HDRI is desirable when the ouput screens are >8 bit, and the initial format support more than 8Bits. IE: AVIF, HEIF or JPGXL.
Fix merge bugs. Added/Updated nugets, to remove transient security vulnarabilities from other nugets.
Merge from Develop
…ature/transcoding
@maxpiva Here is some follow up from the user testing. Overall from the transcoding standpoint, it is working without much delay. What we found is though, ImageMagick is MUCH slower in generating images than NetVips, so much so that it is likely something we can't keep 100%. DieselTech: Dup: Specs of Dup: Cropping testing was limited (canary code on right): Testing has been pretty limited due to the time of year. I'm curious of your thoughts about next steps. The drop off on cover generation (which is already the most expensive process during a scan) is concerning to me. |
Let me sit on this a little. From the netvips developer it's possible to add jpeg-xl and others. I was not able to do it, but I didn't go entirely into the rabbit hole, also netvips developer, said, it's possible to add netvips without requiring the CPU extensions, if installed natively, instead using his native nuget. Finally, netvips, dosn't have the capability to read image dimensions without reading the whole image, at least I cannot find the method. I think that functionality was using ImageSharp originally on Kavita or reading it whole. From the code standpoint, I did abstract all the image functionality into an interface and implementation class, so adding netvips back should be super easy. Work to DO
Finally ask the developer if he maintain a native nuget, with all the bells and whistles. Later we can choose, what implementation to use. Via define or similar. |
Let me add that the SSE4.2 limitation is not a deal breaker for me. All CPUs in the last 15 years have this. It was a nice to have if we were moving to ImageMagick, but with the difference in speed, I think this will become a major issue for end users, especially those with lower-powered machines. Let me know if I can help in any regard. |
I wanted to loop back to this and give some clarification on things that hopefully shine some light on the problem regarding the performance.
Dup and I both tested on the same exact series (identical files even) to ensure consistency. The series has 588 chapters - 2.96 GB.
The "issue" as it stands here is the cover generation is single threaded. I am using a 5900x which has a single core score of 3470 as measured by cpubenchmark.net. That is fairly high considering the top end of consumer CPU's top out about 4800-5000 points. (And you'll be paying big $ for them) I'd wager most people aren't running on something that powerful these days. Especially when it comes to low power servers that are designed to be left on 24/7. I'd ballpark the average single core performance around 1600 to 2500 or so. Here is where we get to my point: The CPU dup is using is following the new trend of low power (watts, not performance) CPU's. Specs: The single core performance of this chip is kind of abysmal at only 755. That is on par with a Pentium 4 that came out in 2008. But...that is why it has 10 threads. The multi-core performance is where this CPU shines because this isn't 2008 anymore and we expect workloads to be threaded in order to get work done in a reasonable amount of time. This is especially true in cases like here where parallelization in this context is just having a single thread do 1 image at a time. It isn't a competing data source that would have to wait for the results of the work to used somewhere else. If we would of ran the same 588 file cover gen on all 10 cores then the approximate time would have been ~25 seconds. |
Canary testers, I need your help! This is a massive PR that swaps out the Image system in Kavita and brings Transcoding support (Thanks @maxpiva). This is built from the nightly. Please give it a serious stress test and report back on the nightly thread. There is also a Github issue for tracking longer term issues here.
Added
Changed
Developer