简体   繁体   English

如何在ffmpeg中一起使用-filter_complex和-vf?

[英]How to use -filter_complex and -vf together in ffmpeg?

I want to use -filter_complex and -vf together in one line but I can't do that and get error.我想在一行中同时使用-filter_complex-vf ,但我不能这样做并出错。

First code:第一个代码:

ffmpeg -i 1.mp4 -filter_complex "[0:v]setpts=0.87*PTS[v];[0:a]atempo=1.15[a]" -map "[v]" -map "[a]" e1.mp4

Second code:第二个代码:

ffmpeg -i 1.mp4 -vf "scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:-1:-1:color=black" e1.mp4

So I combine two code above together.所以我将上面的两个代码组合在一起。 Combined code:组合代码:

ffmpeg -i 1.mp4 -filter_complex "[0:v]setpts=0.87*PTS[v];[0:a]atempo=1.15[a]" -map "[v]" -map "[a]" -vf "scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:-1:-1:color=black" e1.mp4

I can can't run code I get the error:我无法运行代码我收到错误:

-vf/-af/-filter and -filter_complex cannot be used together for the same stream.

Just use -filter_complex :只需使用-filter_complex

ffmpeg -i input.mp4 -filter_complex "[0:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:-1:-1:color=black,setpts=0.87*PTS;[0:a]atempo=1.15" output.mp4

See FFmpeg Filtering Introduction and the additional documentation in the link.请参阅FFmpeg 过滤介绍和链接中的其他文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM