ffmpeg 如何在一个命令中垂直旋转和连接/堆叠两个视频?

标签 ffmpeg command-line video-processing video-conversion

我有两个录音inside.MOVoutside.MOV用两台摄像机(相同的设置和相同的型号)录制。

我想做这样的事情:

ffmpeg -i inside.MOV -vf "transpose=2,transpose=2" inside_rotated180degree.MOV # rotate 180 degree
ffmpeg -i outside.MOV -i inside_rotated180degree.MOV \
  -filter_complex "[0:v]scale=640:-1[v0];[v0][1:v]vstack=inputs=2" inside_and_outside.MOV # concat them
但在单个命令中 .
我已经设法旋转上部视频,但我需要旋转下部:
ffmpeg -i outside.MOV -i inside_rotated180degree.MOV \
  -filter_complex "[0:v]scale=1920:-1,rotate=PI[v0];[v0][1:v]vstack=inputs=2" inside_and_outside.MOV

我尝试修改命令各种方式添加rotate=PI ,但是在命令/屏幕/输入/中总是有错误...有人知道如何将视频旋转到较低而不是较高吗?

最佳答案

您只需对两个视频流(即 2 个过滤器链)进行相同的准备工作,然后再将它们堆叠在一起(最后一个链):

ffmpeg -i outside.MOV -i inside.MOV \
  -filter_complex "[0:v]scale=640:-1,hflip,vflip[v0];\
                   [1:v]scale=640:-1,hflip,vflip[v1];\
                   [v0][v1]vstack=inputs=2" inside_and_outside.MOV
transposerotate应该工作相同,我正在使用另一个替代 hflip,vflip为了说明。不知道哪个最快。

关于ffmpeg 如何在一个命令中垂直旋转和连接/堆叠两个视频?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72494781/

相关文章:

ffmpeg - ffmpeg可以显示进度条吗?

java - 如何将 FFMPEG 构建并包含到现有的 Android 项目中

shell - 如何使用命令行创建输出文件?

video - 同时添加 2 秒延迟和延迟 -ffmpeg- 中的输入之一

amazon-web-services - AWS lambda 使用 ffmpeg 达到大小限制

command-line - PowerShell - 启动进程和命令行开关

linux - 使用 Echo 确定目录的长度

c++ - OpenCV:检测视频中的癫痫发作灯?

ffmpeg错误: Pattern type 'glob' was selected but globbing is not support ed by this libavformat build

Android:在服务中使用 OpenCV VideoCapture