What I have achieved so far:
Using AVFoundation services, I have placed a video in a UIView that a user can play, pause, etc (using AVPlayer, AVPlayerItem, AVPlayerLayer, etc)
I have placed a UIView (with transparent/clear background color) on top of the view that is supposed to show the playing video. I have also handled UIKit touch events to draw lines based on user interaction.
Now when I play the video and touch the UIView which is overlayed on that view, I can see lines drawn on the playing video.
What I want to do:
After the user is done with the drawing (which he thinks is overlayed on the video), I want my app to compose the original video and what the user interaction (lines being drawn, removed, etc) and export the result as another video file.
Any help or sample code will be highly appreciated.
For compositing the content together, have a look at AVVideoCompositionCoreAnimationTool
. It lets you add animations to a movie using CALayer
objects.
For exporting, once you have your composition built and the CALayer
s rendering together, you can pass it straight to an AVAssetExportSession
which will write it out to a video file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With