lay295 / TwitchDownloader

Twitch VOD/Clip Downloader - Chat Download/Render/Replay
MIT License
2.67k stars 260 forks source link

Prefer AVIF to WEBP for 7TV emotes #426

Open sunkhaskasis opened 1 year ago

sunkhaskasis commented 1 year ago

Checklist

Write your feature request here

Now that #407 is merged and the newer version of SkiaSharp is used, I believe it's safe to prefer AVIF to WEBP for 7TV. AVIF files are generally smaller and are less compressed than WEBP.

sunkhaskasis commented 1 year ago

Giving it a second thought, I'm not actually sure if animated emotes would work. It's a common problem with AVIF at the moment: a lot of image editors and the like do support it, but only static images, although maybe it's possible if libavif is implemented.

ScrubN commented 1 year ago

Yeah, probably wait a few more weeks/months for AVIF to gain more traction and proper support. To be completely honest this was the first time I've heard of the format, which makes sense with how extremely new it is. Someone made a big PR to SkiaSharp about AVIF so it probably supports animated images but I'd still like to wait a bit. Not like we're losing out of much anyways, webp is already a pretty good format

Edit: There was no PR for AVIF support, I think I was looking at the Skottie support PR.

ScrubN commented 1 year ago

Looked into this again. Seems SKCodec does not yet properly support AVIF despite being exposed in the SKEncodedImageFormat enum. :P We'll need to explicitly deny AVIF for now instead of just preferring WEBP as it causes a null SKCodec to be returned. image

ScrubN commented 1 year ago

SkiaSharp 2.x uses Skia m88. AV1 based AVIF support was added to Skia around m100. SkiaSharp 3.0 is currently in development which will update all the way to Skia m115.

In other words, we will be able to prefer AVIF after we upgrade to SkiaSharp 3.0.

sunkhaskasis commented 10 months ago

@ScrubN I haven't been following this issue as of late, but have you migrated to 3.0 yet?

ScrubN commented 10 months ago

SkiaSharp 3.0 has not been released yet. Given the state of its development, I assume SkiaSharp 3.0 is planned for release sometime in 2024, though I wouldn't complain about being proven wrong.