FFMPeg hstack 视频高度不一样

FFMPeg hstack video not same height

我目前正在尝试水平堆叠多个视频文件并收到此错误

[libvorbis @ 000001bb38f23a80] Queue input is backward in 
timerate=N/A speed=   0x
[libvorbis @ 000001bb38f23a80] Queue input is backward in 
timetrate= 799.4kbits/s dup=0 drop=3894 speed=15.7x
[libvorbis @ 000001bb38f23a80] Queue input is backward in 
timetrate= 798.7kbits/s dup=0 drop=3924 speed=15.8x
[Parsed_hstack_2 @ 000001bb3a3411c0] Input 1 height 480 does not 
match input 0 height 360.op=3929 speed=  16x
[Parsed_hstack_2 @ 000001bb3a3411c0] Failed to configure output pad 
on Parsed_hstack_2
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argumentError 
while processing the decoded data for stream #0:0

这是我的命令。

ffmpeg -i RT05974d20e9550b89697b15f8bc3feb78.mkv -i RTb295d0534191e1acb22a45bb971a12e6.mka -i RTc2de0d06575c6c225b44dbce73104ed8.mkv -i RT3904b3a60273760ec9e9c181ea35bdc4.mka -i RT13386752138abbe5eb941da3f7fdfdc5.mka -i RTe31da14ad7c898ad8d8ce6bbafc5e387.mkv -i RT103bfe5f4b129860f69cd8e820f3a10b.mka -i RT2e5859b6a555070f3305735c698966d0.mka -filter_complex "[2:v]tpad=start_duration=120:color=black[vpad]; [3:a]adelay=120000:all=1[a2pad]; [4:a]adelay=150000:all=1[a3pad]; [5:v]tpad=start_duration=20:color=black[v2pad]; [6:a]adelay=200000:all=1[a5pad]; [7:a]adelay=240000:all=1[a6pad]; [0:v][vpad][v2pad]hstack=inputs=3[vout]; [1:a][a2pad][a3pad][a5pad][a6pad]amix=inputs=5:weights=1|1|1|1|1[aout]" -map [vout] -map [aout] output.mkv

然后我还单独检查了每个文件,以确保它们的高度和宽度是正确的。

ffprobe -v error -select_streams v -show_entries stream=width,height -of csv=p=0:s=x RT05974d20e9550b89697b15f8bc3feb78.mkv
640x480
ffprobe -v error -select_streams v -show_entries stream=width,height -of csv=p=0:s=x RTc2de0d06575c6c225b44dbce73104ed8.mkv
640x480
ffprobe -v error -select_streams v -show_entries stream=width,height -of csv=p=0:s=x RTe31da14ad7c898ad8d8ce6bbafc5e387.mkv
640x480

此处粘贴了完整日志 - https://pastebin.com/0XEipXjA

仅使用两个文件时的日志 - https://pastebin.com/AVYisBeh

在第一个视频文件未使用时记录(有效)- https://pastebin.com/8YfHRsQ1

我做错了什么?

看起来第一个输入的分辨率正在中途改变。

禁止重新初始化过滤器,并强制使用比例进行初始分辨率。

ffmpeg -reinit_filter 0 -i RT05974d20e9550b89697b15f8bc3feb78.mkv -i RTb295d0534191e1acb22a45bb971a12e6.mka -i RTc2de0d06575c6c225b44dbce73104ed8.mkv -i RT3904b3a60273760ec9e9c181ea35bdc4.mka -i RT13386752138abbe5eb941da3f7fdfdc5.mka -i RTe31da14ad7c898ad8d8ce6bbafc5e387.mkv -i RT103bfe5f4b129860f69cd8e820f3a10b.mka -i RT2e5859b6a555070f3305735c698966d0.mka -filter_complex "[0:v]scale=iw:ih,setsar=1[v0];[2:v]tpad=start_duration=120:color=black[vpad]; [3:a]adelay=120000:all=1[a2pad]; [4:a]adelay=150000:all=1[a3pad]; [5:v]tpad=start_duration=20:color=black[v2pad]; [6:a]adelay=200000:all=1[a5pad]; [7:a]adelay=240000:all=1[a6pad]; [v0][vpad][v2pad]hstack=inputs=3[vout]; [1:a][a2pad][a3pad][a5pad][a6pad]amix=inputs=5:weights=1|1|1|1|1[aout]" -map [vout] -map [aout] output.mkv