3

I'm working on an iPad app that records and plays videos using AVFoundation classes. I have all of the code for basic record/playback in place and now I would like to add a feature that allows the user to draw and make annotations on the video—something I believe will not be too difficult. The harder part, and something that I have not been able to find any examples of, will be to combine the drawing and annotations into the video file itself. I suspect this is part is accomplished with AVComposition but have no idea exactly how. Your help would be greatly appreciated.

Mark

mpemburn
  • 2,776
  • 1
  • 35
  • 41

1 Answers1

5

I do not think that you can actually save a drawing into a video file in iOS. You could however consider using a separate view to save the drawing and synchronize the overlay onto the video using a transparent view. In other words, the user circled something at time 3 mins 42 secs in the video. Then when the video is played back you overlay the saved drawing onto the video at the 3:42 mark. It's not what you want but I think it is as close as you can get right now.

EDIT: Actually there might be a way after all. Take a look at this tutorial. I have not read the whole thing but it seems to incorporate the overlay function you need.

http://www.raywenderlich.com/30200/avfoundation-tutorial-adding-overlays-and-animations-to-videos

sangony
  • 11,636
  • 4
  • 39
  • 55
  • That's actually what I plan to do for the in-app viewing of the video. Since the app shares videos to Dropbox, it's important that the drawings and annotation be saved along with it. Perhaps you're right that it can't be done but I'll continue to seek until I either find the way or get a definitive "no". Thanks for your input. – mpemburn May 11 '13 at 14:45
  • That is it! Thank you so much! Now, much work to make it do exactly what I want. ;-) – mpemburn May 12 '13 at 10:50
  • @mpemburn have you got any progress with what you wanted to achieve? I am trying to work on a similar thing. – SleepNot Jul 29 '13 at 10:13
  • jeraldov: I've had to put this project on hold for a while but methods outlined in the Ray Wenderlich tutorial will be my starting point once I get back to it. It may be several months. This is v 2.0 functionality for an app I released in May. It has to start selling or I won't have a justification for updating it. – mpemburn Jul 30 '13 at 10:57
  • hi @mpemburn Can you please guide me if you were able to do it? – Awesome.Apple May 26 '16 at 09:29
  • Sorry, Kiran, I never did find a means of doing this. Then again, that was several years ago, and such may now be possible within iOS. – mpemburn May 28 '16 at 12:36