1

I have created a video composition. I could play this using AVPlayer.

I want to play this composition in a animated CALayer as follows and then render this as a video using AVVideoCompositionCoreAnimationTool without getting blackbars around the video.

enter image description here

Can anyone please suggest me to play and render video in a specified layer?

satyanarayana
  • 265
  • 4
  • 14
  • What about `AVPlayerLayer`? – David Rönnqvist Feb 08 '14 at 10:30
  • Thanks for your replay. I have added AVPlayerLayer on the animated image layer. It's working. It fails if I need to add AVPlayerLayer on three different layers. Is there any way to clone the same AVPlayerLayer so that I can use the same layer where I need? – satyanarayana Feb 08 '14 at 10:52
  • Not that I know of :( I asked [this question](http://stackoverflow.com/q/19065816/608157) a while back when I was trying to share video contents between layers on iOS. I never came up with a solution for my use-case. – David Rönnqvist Feb 08 '14 at 11:36
  • You can't copy the contents of an AVPlayerLayer like you can a QuickTime layer on OSX as David points out in his link, however, you might be able to use the CAReplicatorLayer if you need multiple copies of the same layer, just transformed in some fashion (translate, scale, rotate, etc.). Here's a demo that uses the replicator layer with an AVPlayerLayer and applies a transform: https://github.com/perlmunger/MultiPlayerLayer – Matt Long Feb 17 '14 at 23:18
  • @DavidRönnqvist Hi David your book on SceneKit looks awesome, starting to learn about SceneKit now so may buy it. But hoping you can help with a question on video: is using AVVideoCompositionCoreAnimationTool the only way to merge images and text into a video? The goal is to export a MP4 video with images and text superimposed on a user shot video. Exporting seems slow with AVVideoCompositionCoreAnimationTool so trying to find alternatives. Thanks! – Crashalot Jan 23 '16 at 01:28

0 Answers0