多个视频源合并成一个 [英] Multiple video sources combined into one

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

问题描述

我要寻找一种有效的方式来做到以下几点:

I am looking for an efficient way to do the following:

使用多个来源的视频(的长度大致相同),我需要生成一个输出视频的由所有的在自己的区域内的每个运行(如一堆 PIP ■在最初来源几种不同的尺寸)。所以,最终的结果是,所有的原运行侧由端中,每个在其自己的区域/盒

Using several source videos (of approximately the same length), I need to generate an output video that is composed of all of the original sources each running in its own area (like a bunch of PIPs in several different sizes). So, the end result is that all the original are running side-by-side, each in its own area/box.

源和输出需要 FLV 和我使用的平台是Windows(在Windows 7 64位开发,部署到Windows Server 2008)。

The source and output need to be flv and the platform I am using is Windows (dev on Windows 7 64bit, deployment to Windows server 2008).

FLV 和非已经看过 AviSynth的但不幸的是它不能处理插件和FLV分配器我都试过的工作。

I have looked at avisynth but unfortunately it can't handle flv and non of the plugins and flv splitters I have tried worked.

我目前的工艺使用在的ffmpeg 通过以下方式:

My current process uses ffmpeg in the following manner:


  1. 使用的ffmpeg生成每视频每秒25 PNG的,调整原来需要
  2. $ b $。 b
  3. 使用 System.Drawing中命名空间每套帧合并成一个新的形象,从静态背景,然后每一帧加载到一个图片和绘图背景图形对象 - 这给了我合并帧

  4. 使用。 FFMPEG对生成的图像相结合的视频。

  1. Use ffmpeg to generate 25 png's per second per video, resizing the original as needed.
  2. Use the System.Drawing namespace to combine each set of frames into a new image, starting with a static background, then loading each frame into an Image and drawing to the background Graphics object - this gives me the combined frames.
  3. Use ffmpeg to combine the generated images to a video.

这一切都是非常IO密集型(这是我处理瓶颈的时刻)和我觉得必须有达成我的目标更有效的方式。我没有与视频处​​理太多的经验,不知道有什么办法在那里。

All this is very IO intensive (which is my processing bottleneck at the moment) and I feel there must be a more efficient way to reach my goal. I do not have much experience with video processing, and don't know what options are out there.

任何人都可以提出处理的更有效的方式将这些?

Can anyone suggest a more efficient way of processing these?

推荐答案

里面做的ffmpeg的一切。你可以做很多事情视频滤波器。例如通过侧面连接两个视频端:

Do everything inside ffmpeg. You can do a lot of things with video filters. For example to join two videos side by side:

ffmpeg -i input0.avi -vf "movie=input1.avi [in1]; [in]pad=640*2:352[in0]; [in0][in1] overlay=640:0 [out]" out.avi

@Oded:这基本上是这个命令做什么。您可以删除过滤器,并更改覆盖滤波器的参数,无论你喜欢移动的第二个视频。

@Oded: That's basically what this command does. You can remove the pad filter and change the parameters of overlay filter to move the second video wherever you like.

ffmpeg -i big.avi -vf "movie=small.avi [small]; [in][small] overlay=10:10 [out]" out.avi

我提供的链接描述过滤器语法。你可以链接多个过滤器一起:

The link I provided describes the filter syntax. You can chain multiple filters together:

ffmpeg -i big.avi -vf "movie=small0.avi [small0]; [in][small0] overlay=10:10 [tmp];\
                       movie=small1.avi [small1]; [tmp][small1] overlay=30:10 [out]" out.avi

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

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