
- BACKGROUND OVERLAYS FOR EDITS HOW TO
- BACKGROUND OVERLAYS FOR EDITS SIMULATOR
- BACKGROUND OVERLAYS FOR EDITS DOWNLOAD
- BACKGROUND OVERLAYS FOR EDITS MAC
Currently, this method simply calls the completion handler with the existing video. The meat of the sample project is inside makeBirthda圜ard(fromVideoAt:forName:onComplete:). Once you have both the combined video and the audio inside the composition, you’ll export the composition into a video file using AVAssetExportSession.ĭon’t worry, it’s not as daunting as it sounds! Your first step is to create the composition. To create the video, you’ll use AVVideoCompositionCoreAnimationTool, a class that lets you combine an existing video with Core Animation layers. For the audio track, you’ll simply copy the existing video’s audio. Once you create an empty composition, you’ll add two tracks to the composition, one for the video and one for the audio. The composition holds different types of tracks, like audio and video tracks, and manages when they start or end in the time line of the video. You can think of a composition as a programmatic video editor. What you’ll do is create a new video file from an existing video, with added backgrounds and overlays.įirst, you’ll create a new AVFoundation composition. I bet you can’t wait to send this to your friends! :] Composing a Videoīefore you can add any overlays to the video, you need to set some things up.
BACKGROUND OVERLAYS FOR EDITS HOW TO
Note: To learn how to pick and play video files, check out How to Play, Record, and Merge Videos in iOS and Swift. This view controller plays the video file and lets you export the file to your photo library. Once the app adds overlays to the video, the method calls the completion handler and sends the video URL to PlayerViewController.swift. You’ll edit this method to add overlays to the video. Currently, this file only has a couple of helper methods and a method called makeBirthda圜ard(fromVideoAt:forName:onComplete:). Once the user picks a video, the app sends it to VideoEditor.swift. This all happens in PickerViewController.swift. The begin project already has a screen where you can enter your friend’s name and pick a video to add overlays to.

BACKGROUND OVERLAYS FOR EDITS MAC
Make sure to drag and drop a video file from your Mac to your simulator.
BACKGROUND OVERLAYS FOR EDITS SIMULATOR
You can use either the simulator or a device, but keep in mind that this tutorial requires a video. You’ll make an app that will let you record a video and add overlays and borders to turn it into a customized birthday card for your friends. The project’s name is Cubica, which stands for Custom Birthday Cards.
BACKGROUND OVERLAYS FOR EDITS DOWNLOAD
Start by downloading the starter project by clicking the Download Materials button at the top or bottom of the tutorial. Ready? Lights, camera… action! :] Getting Started Don’t worry though, this tutorial will explain everything as you go along. It would also be useful to have some familiarity with Core Animation.

To get the most out of this tutorial, you’ll need to be familiar with iOS development.

Do not select Opacity, only select a background colour.Update note: Marin Bencevic updated this tutorial for Xcode 11, Swift 5 and iOS 13. Do not select a Background colour, Gradient or Opacity There are 4 strengths of Opacity to chose from:
