HEIF icon indicating copy to clipboard operation
HEIF copied to clipboard

Fails on Catalina with AVEBridge Error: AVEEncoder_CreateInstance: returning err = -12908

Open aikinai opened this issue 6 years ago • 24 comments

Seems to be throwing this error on Catalina:

AVEBridge Info: AVEEncoder_CreateInstance: Received CreateInstance (from VT)
Assert - (remoteService != NULL) - f: /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppleAVEBridge/AppleAVEBridge-18/AppleAVEEncoder/AppleAVEEncoder.c l: 290
AVE XPC Error: could not find remote service
Assert - (err == noErr) - f: /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppleAVEBridge/AppleAVEBridge-18/AppleAVEEncoder/AppleAVEEncoder.c l: 1940
AVE ERROR: XPC failed
AVEBridge Info: connectHandler: Device connected (0x00007ff0a01b3470)AVEBridge Info: stopUserClient: IOServiceClose was successful.

AVEBridge Error: AVEEncoder_CreateInstance: returning err = -12908

aikinai avatar Oct 22 '19 08:10 aikinai

I edited my comment since I originally thought it was failing, but I see the conversion is completed despite the errors.

aikinai avatar Oct 22 '19 09:10 aikinai

Did you recompile it with a new XCode? I've just done it and published v0.3. I don't see any errors in the console with both older and new versions.

biodranik avatar Oct 23 '19 04:10 biodranik

Thanks for the response!

I tried compiled and interpreted and got the same thing. But I don't have the full Xcode installed, just the command line tools. Maybe I need the full install? My swiftc version is:

Apple Swift version 5.1 (swiftlang-1100.0.270.13 clang-1100.0.33.7)
Target: x86_64-apple-darwin19.0.0

aikinai avatar Oct 23 '19 05:10 aikinai

I am getting that error too. However, I also get it when using sips (just found out about it in #6). Also, the same message is output in the Console when using Preview to save an image to HEIC.

I assume this is an OS issue (mine is 10.15.4 (19E287))

frankrolf avatar May 03 '20 20:05 frankrolf

That's interesting. My binary works on the same Catalina 10.15.4 (19E287). And sips also converts some jpg to heic. Do you have XCode installed?

biodranik avatar May 03 '20 20:05 biodranik

Well, the binary works! The conversion process also works normally (AFAICT), just there is more output than expected. I do have XCode 11.4.1 installed.

frankrolf avatar May 03 '20 21:05 frankrolf

The same "extra" output appears for me as well. The converted image is fine. I am converting images with Q=1 option or Lossless in Preview. I am using script below for converting all images in a folder:

for x in *.jpeg; do echo "$x"; HEIF -q=1 "$x"; done;

When using Preview for this task, some of the images are corrupted - there is thin line of colors on the top. Like this:

Screenshot 2020-11-03 at 9 35 16

While the same image, converted with this script is fine.

pbalinov avatar Nov 03 '20 07:11 pbalinov

It's not nearly as clean, but I later ended up using a combination of ffmpeg and mp4box to do my HEIF encoding. Just thought I'd share in case others here were interested.

aikinai avatar Nov 03 '20 10:11 aikinai

@aikinai What's the advantage of your script over using sips or this repo's tool?

quantumgolem avatar Jan 21 '21 14:01 quantumgolem

@sn0wyfall I haven't tested to be sure, but I would expect x265 to provide higher quality encoding than Apple.

Apple does encode billions of images on iPhones and likely cares about quality to a certain extent, but I assume they are using hardware and optimizing for speed and power consumption, with quality the third priority or so. I also don't know how that code flows back to their MacOS implementation.

On the other hand, x265 seems to be the highest-quality encoder available, and it has no reason to be prioritizing speed or hardware-compatibility over quality.

Of course this is just speculation, and could be easily verified or disproved with a real head-to-head comparison, but I don't have time to spend doing that so I just assumed x265 is better.

aikinai avatar Jan 26 '21 03:01 aikinai

@aikinai Thanks for the reply. You're right, I heard hardware accelerated encoding sacrificed quality. I wish I saw your comment before encoding thousands of images. I prefer retaining quality over speed.

I'll compare your tool and sips and I'll report back with my findings.

quantumgolem avatar Jan 26 '21 20:01 quantumgolem

@aikinai I did a blind test on four images. I used your script to encode with RF 26 and then generated sips images with many quality values, and chose the one that was closest in size. In all four cases I preferred the sips image when viewing at a 1:1 ratio. In my experience it was able to hold more detail despite having a comparable file size. It seems like if Apple is using hardware accelerated encoding, it's extremely good. In conclusion, at least for me I prefer using sips as it's fast and quite easy to use (also wrote a script to use it). Anyway, thanks for introducing me to the x265 encoding tool. Cool to know about it.

quantumgolem avatar Jan 27 '21 05:01 quantumgolem

@sn0wyfall Cool, thanks for doing the test! I commented on the other issue for how to change CRF if you want to try other sizes, but this is great to know. Maybe I'll switch back to sips too then.

aikinai avatar Jan 27 '21 10:01 aikinai

This seems to finally be fixed at least on Big Sur on Apple Silicon.

aikinai avatar Jun 01 '21 01:06 aikinai

Anyone knows if this is fixed/being addressed by Apple for non-Apple (i.e. Intel) based macs? I'm still experiencing that error log on Big Sur 11.5.2.

bartzy avatar Oct 10 '21 13:10 bartzy

Experiencing this also on intel and bigSur 11.4

acecilia avatar Oct 22 '21 16:10 acecilia

It works without warnings on Intel Big Sur 11.6.

biodranik avatar Oct 23 '21 16:10 biodranik

@bartzy does it work despite the error log?

biodranik avatar Oct 23 '21 17:10 biodranik

It does work despite the error log in my case. The setup I followed is the one here

acecilia avatar Oct 23 '21 17:10 acecilia

It works without warnings on Intel Big Sur 11.6.

@biodranik Interesting! I'll upgrade soon and test as well.

@bartzy does it work despite the error log?

It does work (with the warning) on Big Sur 11.5.2.

bartzy avatar Oct 23 '21 19:10 bartzy

It works without warnings on Intel Big Sur 11.6.

@biodranik I upgraded to Big Sur 11.6 (MBP 16" 2019 i9) and I still get the warning. Can you try sips -s format heic input.png -o output.heic and see if it finishes without any warnings?

bartzy avatar Oct 23 '21 19:10 bartzy

MBP 2014 - no warning neither for sips nor for my HEIF binary. Do you have the latest XCode installed?

biodranik avatar Oct 23 '21 19:10 biodranik

Xcode 13.0 (13A233). I guess this is a hardware thing. Probably something to do with the GPU on my MBP. If anyone can test with a MBP 16" i9 with a Radeon 5500M and check if there's a warning when running sips -s format heic input.png -o output.heic, that would be nice.

bartzy avatar Oct 23 '21 19:10 bartzy

I've tested on a MBP 16" i9 with a Radeon 5500M, there is still a warning like this.

I think it's a Apple internal framework issue and we can do nothing.

Actually, Preview.app shows the similar warning, you can try it with Automator.app.

Related: mczachurski/wallpapper#42

Colerar avatar Sep 29 '22 07:09 Colerar