0

I am trying to overlay a video (with an alpha channel) onto an existing video.

The way to do this with ffmpeg would be a command like so:

ffmpeg -i face_video.mov -i curtain_test.mov -filter_complex "[0:0][1:0]overlay[out]" -shortest -map [out] -map 0:1 -pix_fmt yuv420p -c:a copy -c:v libx264 -crf 18  output.mov

How would I complete this task using AVFoundation on iOS?

evenodd
  • 2,026
  • 4
  • 26
  • 38

2 Answers2

0

Short answer is that you cannot do that with with AVFoundation under iOS. Only 24BPP (opaque) H264 video is supported by default. See AVFoundation decode prores4444 movie with alpha channel

MoDJ
  • 4,309
  • 2
  • 30
  • 65
0
  • Install MobileFFMpeg into your XCode project using pod pod 'mobile-ffmpeg-full', '~> 4.3' https://github.com/tanersener/mobile-ffmpeg

  • Call any FFMpeg command in following way:

    [MobileFFmpeg execute: @"-i file1.mp4 -c:v mpeg4 file2.mp4"];

Shakir Zareen
  • 232
  • 3
  • 15