AVVideoCompositionCoreAnimationTool overlay layer appearance is delayed in iOS 11 beta 1
| Originator: | sami | ||
| Number: | rdar://32718905 | Date Originated: | 2017-06-12 |
| Status: | Open | Duplicate of 30378366 | Resolved: | |
| Product: | iOS SDK (AVFoundation) | Product Version: | iOS 11.0 beta 1 (15A5278f) |
| Classification: | Serious Bug | Reproducible: | Always |
Summary: When using AVVideoCompositionCoreAnimationTool to overlay a layer on a video composition the overlay only appears after about 1 second in the final video on iOS 11 beta 1 on an iPhone 6s Plus. Steps to Reproduce: 1. Set up a simple AVMutableVideoComposition with a single video asset using +[AVMutableVideoComposition videoCompositionWithPropertiesOfAsset:] 2. Create a container layer, a video frame layer, and an overlay layer (a text layer is enough), and add the video and overlay layers to the container. All set to the full size of the video. 3. Set the composition’s animationTool property to [AVVideoCompositionCoreAnimationTool videoCompositionCoreAnimationToolWithPostProcessingAsVideoLayer:videoLayer inLayer:containerLayer] 4. Create an AVMutableVideoCompositionLayerInstruction for the source video track and set the source video track’s preferred transform at kCMTimeZero on the layer instruction. 5. Create an AVMutableVideoCompositionInstruction with timeRange set to the entire source asset’s duration, and add the layer instruction to it. 6. Set the instruction on the video composition. 7. Render the composition. Expected Results: The overlay layer should be visible for the entire duration in the resulting video. Actual Results: The overlay layer doesn’t show up for about 1 second. Regression: This doesn’t occur on iOS 9.x, 10.2, or 10.3. Notes: While trying to debug I decided to add the layer to a view so I could use QuickLook in the debugger. I also tried displaying it in the view hierarchy because why not, and to my horror discovered that this “fixes” the issue. When the layer is added to a view in the root view controller’s hierarchy then the overlay appears in the rendered video. Of course this isn’t an acceptable work-around to ship.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!