使用ffack和hfack在ffmpeg中对视频网格进行多个视频输入

时间:2017-03-22 08:33:16

标签: video ffmpeg streaming mosaic

我正在尝试为ffmpeg找到一个工作示例来合并4个视频(2x2堆栈)和9个不同分辨率的视频(3x3堆栈)。

对于2x2示例,我目前正在使用文档示例,但仅当所有视频的分辨率相同时才有效。见命令

ffmpeg -i top_l.mp4 -i top_r.mp4 -i bottom_l.mp4 -i bottom_r.mp4 -i audio.mp4 \ -filter_complex "[0:v][1:v]hstack[t];[2:v][3:v]hstack[b];[t][b]vstack[v]" \ -map "[v]" -an -sn -shortest -f flv rtmp://server/stream

这对我的视频输入无效,但出现以下错误。

[Parsed_vstack_2 @ 0000000003245cc0] Input 1 width 1440 does not match input 0 width 1264. [Parsed_vstack_2 @ 0000000003245cc0] Failed to configure output pad on Parsed_vstack_2 Error reinitializing filters! Failed to inject frame into filter network: Invalid argument Error while decoding stream #3:0: Invalid argument [Parsed_vstack_2 @ 00000000033fec20] Input 1 width 1440 does not match input 0 width 1264. [Parsed_vstack_2 @ 00000000033fec20] Failed to configure output pad on Parsed_vstack_2 Error reinitializing filters! Error while filtering: Invalid argument [Parsed_vstack_2 @ 00000000033feb40] Input 1 width 1440 does not match input 0 width 1264. [Parsed_vstack_2 @ 00000000033feb40] Failed to configure output pad on Parsed_vstack_2 Error reinitializing filters! Failed to inject frame into filter network: Invalid argument Error while decoding stream #0:0: Invalid argument [Parsed_vstack_2 @ 00000000033fec20] Input 1 width 1440 does not match input 0 width 1264. [Parsed_vstack_2 @ 00000000033fec20] Failed to configure output pad on Parsed_vstack_2 Error reinitializing filters! Failed to inject frame into filter network: Invalid argument Error while decoding stream #1:0: Invalid argument [Parsed_vstack_2 @ 00000000033fece0] Input 1 width 1440 does not match input 0 width 1264. [Parsed_vstack_2 @ 00000000033fece0] Failed to configure output pad on Parsed_vstack_2 Error reinitializing filters! Failed to inject frame into filter network: Invalid argument Error while decoding stream #2:0: Invalid argument [Parsed_vstack_2 @ 00000000033ff1c0] Input 1 width 1440 does not match input 0 width 1264. [Parsed_vstack_2 @ 00000000033ff1c0] Failed to configure output pad on Parsed_vstack_2 Error reinitializing filters! Failed to inject frame into filter network: Invalid argument Error while decoding stream #3:0: Invalid argument Finishing stream 0:0 without any data written to it. [Parsed_vstack_2 @ 00000000033fec20] Input 1 width 1440 does not match input 0 width 1264. [Parsed_vstack_2 @ 00000000033fec20] Failed to configure output pad on Parsed_vstack_2 Error configuring filter graph Conversion failed!

如果有人知道如何进行3x3堆叠,请随时发表评论。

0 个答案:

没有答案