I would like to merge multiple video files, performing in the same time complex compressing options.

How can I do that? The following ffmpeg command resulting this error:

 Filtergraph 'scale=1280:720,setpts=0.20*PTS' was specified through the -vf/-af/-filter option for output stream 0:0, which is fed from a complex filtergraph.
-vf/-af/-filter and -filter_complex cannot be used together for the same stream.

The ffmpeg command that i used:

ffmpeg -i GOPR0003.MP4 -i GOPR0004.MP4 -i GOPR0005.MP4 -i GOPR0005.MP4 -i GOPR0006.MP4 -i GOPR0007.MP4 -i GOPR0007.MP4 -i GOPR0008.MP4 -i GOPR0009.MP4 -i GOPR0010.MP4 -i GOPR0012.MP4 -i GOPR0013.MP4 -i GOPR0015.MP4 \
   -filter_complex "[0:v] [1:v] [2:v] [3:v] [4:v] [5:v] [6:v] [7:v] [8:v]  [9:v]  [10:v] concat=n=11:v=1 [v]" \
    -r 24 -crf 18  -vcodec libx264 -vb 20M -vf "scale=1280:720,setpts=0.20*PTS"  -an   -map "[v]"   video_output_01.avi

2 Answers 2


All filtering should be performed in the same filtergraph. Each -filter_complex or -vf defines a different filtergraph. You can use

-filter_complex "[0:v] [1:v] [2:v] [3:v] [4:v] [5:v] [6:v] [7:v] [8:v]  [9:v]  [10:v] concat=n=11:v=1,scale=1280:720,setpts=0.20*PTS [v]"
  • using ffmpeg -i GOPR0009.MP4 -i GOPR0010.MP4 \ -filter_complex "[0:v] [1:v] concat=n=2:v=1,vcodec=libx264,vb=20M,crf=14,r=32,scale=1280:720,setpts=0.20*PTS [v]" \ -map "[v]" video_output_01.avi gave this error: No such filter: 'vcodec' Jun 1, 2020 at 9:31
  • and how can i add -fflags +genpts? Jun 1, 2020 at 9:31
  • vcodec=libx264,vb=20M,crf=14,r=32 --> none of these are filters. These all belong as -key value outside the filtergraph.
    – Gyan
    Jun 1, 2020 at 10:47
  • -fflags +genpts goes before each input to which you wish to apply it.
    – Gyan
    Jun 1, 2020 at 10:47
  • How can I transpose 180o degrees a video file while merging it? e.g. ffmpeg -f concat -safe 0 -i VIDEOFILES_short.txt -filter_complex \ "[0:1] [v0]; \ [1:1]vflip, hflip[v1];\ [v0][v1]concat[out]" -map "[out]" -r 32 -crf 14 -vcodec libx264 -vb 20M video_out_FF.avi Jun 14, 2020 at 14:16

Finally, I used that command that resulted to compress multiple video files, while in the same time setting a range of compressing options in ffmpeg:

VIDEOFILES.txt contains a list of the videos that are to merged in a specific way:

ffmpeg -f concat -safe 0 -i VIDEOFILES.txt -r 32 -crf 14  -vcodec libx264 -vb 20M -vf "scale=1280:720,setpts=0.20*PTS" -fflags +genpts  -an   video_output.avi

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.