rlxone / Equinox

๐ŸŒ‡ ๐ŸŒƒ Create dynamic wallpapers for macOS.
https://equinoxmac.com
MIT License
1.17k stars 37 forks source link

Workaround bug in macOS 14.4.1 and later where encoding HEIC fails #69

Closed kyleerhabor closed 1 week ago

kyleerhabor commented 3 months ago

Closes #66 and #68.

kyleerhabor commented 3 months ago

CC: @rlxone

CasualDeveloper commented 3 weeks ago

Whoops, didn't mean to do that. Sorry!

Meant to ask Kyle, do you have a test build with your fix?

rlxone commented 3 weeks ago

Hi, thanks for the fix, do we know what versions were affected? Is it still an issue?

rlxone commented 3 weeks ago

Can't reproduce on my M1 Mac Mini (macOS 14.6.1 (23G93)) using images from #66. Do you use macs with intel processors?

image
rlxone commented 3 weeks ago

Hey @dreampiggy, sorry for bothering you, but seems like you investigated this issue a lot. What is the current state of the issue? Have we reported this bug to Apple? Can't find any info...

dreampiggy commented 3 weeks ago

No. I didn't fired radar for this.

The HEVC encoding seems fails on macOS 15.0 beta, whatever compression quality is used. So it's not the same issue.

Actually, I faced 2 issue about HEVC encoding.

  1. Using VM (Github Action environment or anything use Virtualization framework) will cause HEVC encoding failed, on macOS 14.4.x-14.5.x (seems fixed on some OS upgrade)
  2. Using macOS 15 Beta 1-5 will cause HEVC encoding failed, seems fixed on Beta 6

And actually, some Mac hardware may not support HEVC encoding. You should use API to test (do not assume all Mac supports HEVC encoding).

Use public API like CGImageDestinationCopyTypeIdentifiers to check public.heic

Or use https://stackoverflow.com/questions/50956097/determine-if-ios-device-can-support-hevc-encoding to have a try

dreampiggy commented 3 weeks ago

Actually, if Apple's framework is not trustable, you can provide a fallback workaround

Since HEVC/HEIF is standard, there are also open-source encode/decode lib, like https://github.com/strukturag/libheif

The C lib I have a Xcode/SPM port: https://github.com/SDWebImage/libheif-Xcode


If you don't like the C API, just use my wrapper API for encoding https://github.com/SDWebImage/SDWebImageHEIFCoder. But this lib don't support HEIF image collection/image sequences (which means, something like dynamic wallpaper you need).๐Ÿ˜‚

kyleerhabor commented 3 weeks ago

Hello,

@CasualDeveloper here is a build with the relevant changes included.

@rlxone this continues to be a relevant issue. If you're not experiencing this on your M1 Mac Mini, then the issue may be Intel-specific, as my 2019 MacBook Pro running macOS Sonoma 14.6.1 (23G93) exhibits the bug. Unfortunately, I'm not aware of the exact affected version range except for 14.4.1 being a start.

zgosalvez commented 3 weeks ago

I tried @kyleerhaborโ€™s build and I can confirm that it works successfully on my Intel-based Mac (Sonoma 14.6.1). โœ…

Hello,

@CasualDeveloper here is a build with the relevant changes included.

@rlxone this continues to be a relevant issue. If you're not experiencing this on your M1 Mac Mini, then the issue may be Intel-specific, as my 2019 MacBook Pro running macOS Sonoma 14.6.1 (23G93) exhibits the bug. Unfortunately, I'm not aware of the exact affected version range except for 14.4.1 being a start.

CasualDeveloper commented 3 weeks ago

@rlxone @kyleerhabor

I can also confirm that Kyle's build works on my MacBook Pro (2019, Intel i9) running latest macOS Sonoma 14.6.1

(btw @zgosalvez that fix was Kyle's not mine, so all credit to them ๐Ÿ™‚)

CasualDeveloper commented 2 weeks ago

FYI I've filed a radar in Feedback Assistant on this issue, and also a copy of it on OpenRadar.

CasualDeveloper commented 2 weeks ago

Hey y'all, good news! ๐Ÿ˜Š

The bug doesn't seem to occur on my MacBook Pro (2019, Intel i9) running macOS Sequoia 15.0 Beta (24A5331b) โ€“ tested with Equinox v3.0 from App Store.

Operation of creating an Appearance-type wallpaper with two images completes successfully (I'm assuming with 1.0 quality, since the files sizes seem bigger compared to using 0.9999999 quality)

kyleerhabor commented 2 weeks ago

That's great. I wouldn't mind amending this pull request with checks for the earliest resolved version (either Sequoia 15 or a later version of Sonoma) and an Intel device.

rlxone commented 2 weeks ago

Thank you all for helping with this! @kyleerhabor feel free to go ahead, i can merge it as soon as you ready with the new additions.

kyleerhabor commented 2 weeks ago

@rlxone I've added the additions.

rlxone commented 1 week ago

@kyleerhabor sweet, i'll review tomorrow

rlxone commented 1 week ago

@kyleerhabor looks good to me, i'll release a new app store build in a couple of days. Thanks everyone for helping with this again!