AVVideoCompositionCoreAnimationTool in iOS12 Export black video

Hello, Apple support

I used AVVideoCompositionCoreAnimationTool to export an animated video of AVlayer (picture), which works well when the image source of the layer is iOS11, 10, or iOS12 camera. But when the layer's image is a screenshot of the iPhone 8 Plus iOS 12, it encountered a black screen. After viewing the screenshot bpc=16, bpp=64, but iOS used to not support images in this format. So I think this tool will show this bug in iOS12 environment. The following is the information of my code snippet and image.


CGFloat width = [MineTool screenWidth];

CALayer *parentLayer = [CALayer layer];

CALayer *videoLayer = [CALayer layer];

parentLayer.frame = CGRectMake(0, 0, width, width);

videoLayer.frame = CGRectMake(0, 0, width, width);

CALayer *overlayLayer1 = [CALayer layer];

overlayLayer1.contents = (__bridge id)blurryImages[i].CGImage;

overlayLayer1.contentsGravity = kCAGravityResizeAspectFill;

overlayLayer1.frame = CGRectMake(0, 0, width, width);

overlayLayer1.contentsRect = CGRectMake(0.35, 0.35, 0.3, 0.3);

overlayLayer1.contentsScale = [[UIScreen mainScreen] scale];

<add animation>


[parentLayer addSublayer:videoLayer];

[parentLayer addSublayer:overlayLayer1];

[parentLayer setMasksToBounds:YES];

composition.animationTool = [AVVideoCompositionCoreAnimationTool videoCompositionCoreAnimationToolWithPostProcessingAsVideoLayer:videoLayer inLayer:parentLayer];



Normal screenshot iOS11

<CGColorSpace 0x28010a0a0> (kCGColorSpaceICCBased; kCGColorSpaceModelRGB; Display P3)>

Width = 1242, height = 1656, bpc = 8, bpp = 32, row bytes = 4992

kCGImageAlphaNoneSkipFirst | kCGImageByteOrder32Little | kCGImagePixelFormatPacked

Is mask? No, has masking color? No, has soft mask? No, has matte? No, should interpolate? Yes; allowsGroupOpacity = YES



Black screen screenshot iOS 12

<CGColorSpace 0x28010a0a0> (kCGColorSpaceICCBased; kCGColorSpaceModelRGB; Display P3)>

Width = 1242, height = 2208, bpc = 16, bpp = 64, row bytes = 9936

kCGImageAlphaPremultipliedLast | kCGImageByteOrder16Little | kCGImagePixelFormatPacked

Is mask? No, has masking color? No, has soft mask? No, has matte? No, should interpolate? Yes; allowsGroupOpacity = YES;