用ffmpeg覆盖多个视频 [英] Overlaying multiple videos with ffmpeg

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

问题描述

我正在尝试用ffmpeg将多个视频叠加到一个视频中。 只有一个覆盖层已经有一个问题,但是我想在同一个视频中添加多个视频时间(以避免多重编码)。



我尝试使用以下行:

  ffmpeg -i background.m2v -vfmovie = a.m2v [a]; movie = b.m2v [b]; [in] [a] overlay = 0:366,[b] overlay = 592: 41combined.m2v 

现在的错误是,覆盖区域(0,366) - (720,942)不在主区域内(0,0) - (720,210)。但是如果我只使用一个重叠文件,它可以正常工作。



视频的大小:




  • 背景:720x576

  • a.m2v:72x48

  • b.m2v:720x210



    • 结果我想要在左上角的a.m2v视频(标志)和b.m2v作为下三分之一。

      解决方案

      我用 mp4 ,但 m2v 应该工作

        set'overlay,overlay = 0:366'
      ffmpeg -i background.mp4 -i a.mp4 -i b.mp4 -filter_complex$ 1combined.mp4

      §覆盖


      I'm trying to overlay multiple videos into one video with ffmpeg. There is already a question with only one overlay, but I want to add multiple videos at the same time (to avoid multiple encodings).

      I try to use following line:

      ffmpeg -i background.m2v -vf "movie=a.m2v [a]; movie=b.m2v [b]; [in][a] overlay=0:366, [b] overlay=592:41" combined.m2v
      

      The error is now, that the overlay area (0,366) – (720,942) is not within the main area (0,0) – (720, 210). But if I use only one overlay file alone it works.

      The sizes of the videos:

      • background: 720x576
      • a.m2v: 72x48
      • b.m2v: 720x210

      In the result I want the a.m2v video in the top left corner (the logo) and the b.m2v as a lower third.

      解决方案

      I tested this with mp4, but m2v should work as well

      set 'overlay, overlay = 0:366'
      ffmpeg -i background.mp4 -i a.mp4 -i b.mp4 -filter_complex "$1" combined.mp4
      

      § overlay

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

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