imxieyi / waifu2x-ios

iOS Core ML implementation of waifu2x
MIT License
538 stars 58 forks source link

[Feature Request] ProRes export? #41

Closed ArguingMeadows closed 2 years ago

ArguingMeadows commented 2 years ago

Hello! I am loving the newest features on the app, it's absolutely wonderful. I see that ProRes import/decode is supported in the current app and I was hoping that ProRes export/encode support could be added to the app, at least to Mac's/iPhones with ProRes hardware accelerator support.

Please consider this addition and thank you for your work on this amazing app.

imxieyi commented 2 years ago

ProRes export can be supported on the latest iPhone/iPad/Mac. But getting colors correct is stupidly difficult especially when input video is not HDR. If you really need ProRes output now you can try using CLI version on macOS with FFmpeg (see this document). You will need to change output FFmpeg arguments in accordance to this blog.

imxieyi commented 2 years ago

Actually colors are correct while converting SDR -> HDR. The problem is that output ProRes videos only display correctly on HDR-enabled displays, otherwise colors look undersaturated compared to original videos. It doesn't even look correct in thumbnails in the Photos app. Exporting ProRes videos in SDR mode doesn't work at all. HDR seems to be enforced on the ProRes encoder.

Another problem is about videos with extended range (for example Rec. ITU-R BT.2020-1 Linear; extended range). The ProRes encoder on iOS does not appear to support extended range. The only supported color space seems to be Rec. ITU-R BT.2100 HLG. Extended colors will be clipped while converting to standard HDR color range. Colors that exceeds the limits of standard HDR will look black or white.

The next version will add experimental support for exporting ProRes videos. But keep in mind that it won't work properly under many conditions.

ArguingMeadows commented 2 years ago

I will absolutely take an experimental ProRes export. I figure the worst-case scenario, I can take the export into Final Cut Pro and override the colorspace in the inspector. That should give me the correct color for SDR.

imxieyi commented 2 years ago

The experimental ProRes export support is now available on both iOS and macOS in the latest update (5.3.3). Feel free to update and provide feedback if it doesn't work.

ArguingMeadows commented 2 years ago

I've tested it on my M1 Pro Macbook and my Intel iMac. So far, it's working great. I haven't checked color yet, but from initial tests everything appears in place. It's really great, thank you!

imxieyi commented 2 years ago

From telemetry data almost no one is actually using ProRes export feature. In case there are bugs regarding this feature please create a new issue.