这是我用来将 2 个 mp4 水平堆叠在一起的命令:ffmpeg -y -i input1.mp4 -i input2.mp4 -filter_complex "[0:v][1:v]hstack[v]" -map "[v]" -vsync 0 stacked.mp4
input1.mp4 的尺寸为 594x512,input2.mp4 的尺寸为 512x512。我得到这个错误作为返回:
width not divisible by 2 (1113x512)
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
令人困惑的是,1113 是一个奇数——它不是 1024,甚至不是 512+594(1106)。是什么导致假定的宽度如此奇怪?
最佳答案
Windows 资源管理器不正确。它不能正确支持 yuvj444p,所以它给出了错误的宽度。
关于ffmpeg - 当我的两个输入都具有偶数高度时,为什么 hstack 会失败并显示 "width not divisible by 2"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63587440/