简体   繁体   中英

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.

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 :

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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