Friday, April 27, 2018

Add video overlay (with alpha component) on another video and export it

Leave a Comment

enter image description hereI want to add overlay of video (with alpha component) on another video. I need to play and export that as well. I have tried many things ,many tutorials but i am unable to do that.

I have also tried to use FFMPEG but its to complicated to understand in short time.so i tried to use wrapper but i am unable to run that on my device. Is anyone have any idea how to do this ? NOTE : I need to export that as well.

2 Answers

Answers 1

As long as your video has been setup right to be transparent you can add the AVPlayerLayer over the other video and set this overlay video layer compositing filter to screenBlendMode.This is working for me on a current project.

overlayVideoLayer.compositingFilter = "screenBlendMode" 

Answers 2

I have try with using ffmpeg and its working

Command to Overlay

ffmpeg -y -i /videoloc/video.3gp -i /overlaylocation/Overlay.png -filter_complex [1][0]scale2ref[i][m];[m][i]overlay[v] -preset ultrafast -map [v] -map 0:a? -ac 2 /savevideolocation/file_20180427_125453.mp4

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment