FFMPEG Overlay video on top of another video

白昼怎懂夜的黑 提交于 2020-01-04 14:40:44

问题


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:


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" + '"';



来源:https://stackoverflow.com/questions/23698372/ffmpeg-overlay-video-on-top-of-another-video

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!