FFMPEG覆盖另一个视频顶部的视频 [英] FFMPEG Overlay video on top of another video

查看:270
本文介绍了FFMPEG覆盖另一个视频顶部的视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经浏览了stackoverflow上的所有问题,但没有一个答案适用于我。

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

我有一个屏幕录制的视频在mp4和另一个录像从mp4中的网络摄像头。我想覆盖网络摄像头视频在屏幕录制视频的左上角。

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.

我想我终于找到了正确的命令行,但是当我通过ffmpeg进程在达到handler_name:SoundHandler时冻结。

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".

这是我的命令行:

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 :(.

推荐答案

我更新了FFMPEG,最后使用这个:

I updated FFMPEG and ended up using this:

string overLayCommand =-i+''+ videoList [0] +'+-+++++ C:\Users\james\output.mp4+'';

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

这篇关于FFMPEG覆盖另一个视频顶部的视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆