16

I'm interested in recording a video with a custom overlay which would end up in the video itself. They could be UIImage or even better, an OpenGL viewport, is there even such possibility right now on any iPhone devices/SDK ?

Thanks

Srikar Appalaraju
  • 71,928
  • 54
  • 216
  • 264
Marc
  • 181
  • 1
  • 7
  • Looking around, everything seems to point towards cameraOverlayView of UIImagePickerController available since SDK 3.1. But I'm unsure if they simply let you show the custom Overlay or record it in the video at run-time [which is what I'm looking or]. – Marc Mar 14 '10 at 20:45
  • I am also trying to show overlay view on recorded video see http://stackoverflow.com/questions/24504094/how-to-record-video-with-overlay-view – Coder_A_D Jul 01 '14 at 14:58

1 Answers1

19

This is possible on the iPhone; the capability can be found in the AVFoundation framework. The classes of interest to you are AVMutableVideoComposition and AVVideoCompositionCoreAnimationTool. Using the AVMutableVideoComposition's animationTool property, you can use a AVVideoCompositionCoreAnimationTool to add a Core Animation layer on top of your video.

These video editing capabilities were added in iOS 4.0, and highlighted at WWDC 2010 in the session titled Editing Media with AV Foundation. If you are a registered Apple developer, you can view this session video by following the link at http://developer.apple.com/videos/wwdc/2010/. When browsing the session videos in iTunes, look for session 407 under Graphics and Media.

Matt Rubin
  • 315
  • 2
  • 8
  • 1
    The AVEditDemo project shown in the video also appears to be available for download at http://rghost.net/2649255. – Matt Rubin Jan 27 '11 at 19:47
  • 1
    these projects by Apple sometimes are so complex when you just want a simple example. Generally they go round and round and produce a one trillion line code to exemplify everything and one takes hours to get to the point. Do you care to outline a code, in a few lines, that can take record a video with an overlay? Thanks. – Duck Jan 28 '11 at 04:14
  • 8
    @Digital Robot your comment seems a bit TLDR-ish: Matt's answer outlines what to do, where to find the appropriate documentation, points to a video how-to **and** a sample project. Short of copy/past-able code _within_ the answer, what do you think is missing that made you _not_ accept his answer? – danyowdee Feb 02 '11 at 16:24
  • @MattRubin link died! – Muruganandham K Dec 17 '13 at 09:41
  • @iTroyd23 The link still works for me. It requires you to log in with an Apple Developer account. (You may need to be a paid member of the iOS developer program.) The specific video in question can be found at https://developer.apple.com/videos/wwdc/2010/?id=407 – Matt Rubin Jan 04 '14 at 02:22
  • @iTroyd23 I realize you meant the old sample code link was dead, and Apple doesn't seem to offer that sample project anymore. I haven't looked closely, but modern sample code like [AVCustomEdit](https://developer.apple.com/library/ios/samplecode/AVCustomEdit/Introduction/Intro.html) or [AVSimpleEditoriOS](https://developer.apple.com/library/ios/samplecode/AVSimpleEditoriOS/Introduction/Intro.html) might help. – Matt Rubin Jan 04 '14 at 02:31