FFMPEG Overlay video on top of another video

2019-08-08 08:54发布

I have looked through all the questions on this on stackoverflow but none of the answers worked for me.

I have a screen recorded video in mp4 and another video recorded from a webcam in mp4. I want to overlay the webcam video over the top left of the screen recorded video.

I think I finally found the right command line for doing this but when I step through the ffmpeg process it freezes when it reaches " handler_name :SoundHandler".

Here is my command line:

string overlayPosition = "movie=" + '"' + _videoFile.FileName + '"' + "[inner]; [in][inner] overlay [out]";
string overLayCommand = "-i " + '"' + videoList[0].Path + '"' + " -vf " + '"' + overlayPosition + '"' +  + '"' + " C:\\Users\\james\\output.mp4" + '"';

Does anyone know what I am doing wrong? I've managed to trim audio and video, crop video, join sound, join video, and join sound and video but cannot get overlay to work :(.

1条回答
时光不老,我们不散
2楼-- · 2019-08-08 08:59

I updated FFMPEG and ended up using this:

string overLayCommand = "-i " + '"' + videoList[0].Path + '"' + " -i " + '"' + _videoFile.FileName + '"' + " -filter_complex " + '"' + "overlay" + '"' + " -strict -2 " + '"' + "C:\Users\james\output.mp4" + '"';

查看更多
登录 后发表回答