I am producing Stay Pictures programmatically to be used as wallpapers on iOS. I am utilizing a recognized metadata.mov file bundled with the app (doubtless extracted from a working Stay Picture with decision 1080×1920). This setup works wonderful once I use a video of the identical decision.
I am utilizing this open-source library to deal with the video-to-LivePhoto conversion:
https://github.com/TouSC/Video2LivePhoto
Nevertheless, once I attempt utilizing a higher-resolution video (e.g. 2560×1440) to keep away from black bars on high-resolution gadgets (like iPhone 14 Professional Max), the Pictures app reveals the Stay Picture, however the movement part would not work—it simply says “Movement Not Out there.”
I imagine the problem is that the static metadata.mov comprises resolution-specific metadata, which prevents it from working appropriately with different video sizes.
-
Tried altering the decision of the video (e.g. 1440×2560, 1284×2778) – movement breaks.
-
Tried producing a brand new .mov file utilizing FFmpeg with a silent video observe, matching the brand new decision – Stay Picture not acknowledged or reveals errors.
-
Tried modifying the present metadata.mov with instruments like FFmpeg, AtomicParsley, Bento4, and mp4box – ensuing information typically break the Stay Picture completely.
-
I anticipated to generate a sound metadata.mov (or comparable observe) that might help the customized decision and restore Stay Picture movement help.
static func convertVideo(videoURL: URL, full: @escaping (_ success: Bool, _ errorMessage: String?) -> Void) {
print("begin changing")
guard let metaURL = Bundle.primary.url(forResource: "metadata", withExtension: "mov") else {
full(false, "metadata.mov not discovered")
return
}
let livePhotoSize = CGSize(width: 1440, peak: 2560) //