10

I want to combine two ffmpeg commands to single ffmpeg command. I want to apply a vintage effect and a watermark on a video.

Please help me in creating a single ffmpeg command.

1
  • 1
    Please show the exact commands you're trying to combine.
    – slhck
    Commented Nov 4, 2014 at 19:04

1 Answer 1

20

It's very simple. If you have a single filter working on one video stream:

ffmpeg -i input -filter:v "scale=-1:480" output

… and you want to add a second filter, then all you have to do is add it with a comma:

ffmpeg -i input -filter:v "scale=-1:480, fps=fps=30" output

This will generate a chain of filters. You don't need to specify input and output here, since it'll just take the input file's video stream.


If on the other hand you have a complex filtergraph (i.e. one that uses multiple chains and multiple inputs/outputs) you have to pipe the filterchain output to the next filterchain's input, separate the chains by a semicolon (;), and then map the overall filter output to the output file:

ffmpeg -i input1 -i input2 -filter_complex "[0:v][1:v] overlay [ol]; \
[ol] scale=-1:480 [outv]" -map "[outv]" output

Of course, you can use as many chains and filters you want. Read the filtergraph documentation for more info. There are tons of examples on how to combine filters.

2
  • Command for Add silence: ./ffmpeg -i input.mp3 -filter_complex 'aevalsrc=0:d=5[silence];aevalsrc=0:d=5[silence2];[silence][0:a][silence2] concat=n=3:v=0:a=1[out]' -map [out] -c:a libmp3lame -q:a 2 output.mp3 Command for Trimm: ./ffmpeg -i input.mp3 -ss 00:00:15.673 -t 00:01:08.545 -vn -codec:a libmp3lame -ac 2 -b:a 128k -map a -af afade=t=in:st=15:d=0,afade=t=out:st=84:d=0,volume=1 output.mp3 , Can you help me to merge these command to a single one
    – Lins Louis
    Commented Jul 16, 2019 at 5:39
  • 1
    @LinsLouis Please ask a new question and show what you have already tried.
    – slhck
    Commented Jul 16, 2019 at 8:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .