3

I need to make a background for an existing video. The background should be a pre-provided image (png type).

Summary, I have an existing video and an existing image. How can I make the image as the background for the video? I need exactly that function, then I will export it to a new video file.

I inspected the topic. It seems I need to do with AVFoundation, but it has too many options to go. These are 3:

  • AVAsset -> export session -> new AVAsset
  • Composition
  • AVAssetReader + AVAssetWriter

Can anyone help me to clarify a exact solution? So I can go with it. A source of guide/tutorial is very appreciated. If not, it's ok.

Remy
  • 4,843
  • 5
  • 30
  • 60
vietstone
  • 8,784
  • 16
  • 52
  • 79
  • are you on about the video's background on the background view? – Konsy Aug 04 '16 at 07:15
  • @Konsy It's a kind of background layer of the video. I need exactly that, insert a background layer into the video, then I will export the result as the resulted video. – vietstone Aug 04 '16 at 07:43
  • so in theory you want the video to be an overlay on top of the chosen image and then that results in the final product being exported? – Konsy Aug 04 '16 at 09:00
  • @Konsy Exactly that! – vietstone Aug 04 '16 at 16:55
  • right to do this, make sure you video you want to use has a transparent background, then you can have a UIImage which is the chosen image and then have the video overlayed on top of the image and then do whatever code you need to export it as a final group :) – Konsy Aug 05 '16 at 08:59
  • @Konsy No, we need it's exactly a movie, not a group of a video and a image – vietstone Aug 07 '16 at 17:42

0 Answers0