1

I am using the following ffmpeg command with filter_complex:

ffmpeg -i GOPR0013.MP4 -i GOPR0013.MP4 -filter_complex "[0:v:0]fps=32,scale=1920:1080[v1],[v1]vflip[vF1],[vF1]hflip[clip1], [clip1] [1:v:0]fps=32,scale=1920:1080[v2] [v2] concat=n=2:v=1 [v]"  -vcodec libx264  -map "[v]"  video_out_01.avi

However, it says:

 "Too many inputs specified for the "fps" filter.
Error initializing complex filters.
Invalid argument"

What I am doing wrong?

1 Answer 1

1

I finally found out how to do it!

ffmpeg -f concat -safe 0 -i VIDEOFILES.txt -filter_complex  \
 "[0:v] fps=32, scale=1920:1080, vflip, hflip, setpts=0.25*PTS, fifo [v0]; \
  [0:v] fps=32, scale=1920:1080, vflip, hflip, setpts=0.25*PTS, fifo [v1];  
  [v0][v1]concat=n=2:v=1[out]" -map "[out]" -crf 14  -vcodec libx264  -vb 20M  -loglevel error  video_out_01.avi
  • concat: concetrate files
  • VIDEOFILES.txt: video files with path included, eg. file '/path/a.mp4' (including file)
  • fps=32, scale=1920:1080: drop to 32 frames, and reducing video resolution
  • vflip, hflip: 180 degrees rotation of the video
  • setpts=0.25*PTS: Four times speeder
  • fifo: a ffmpeg filter that it says to wait frame to be fully processed before it is given to the next process --- due to some filter process frame quicker than others e.g. due to frame drop (?)
  • crf 14: High quality ensured (0 = uncompressed)
  • vcodec libx264: codec to compress the video file
  • vb 20M: video bitrate (a high one)
  • loglevel error: ffmpeg output information only errors will be displayed

BIG Questions:

A) I tried to reverse the order of filters eg. [0:v] setpts=0.25*PTS, fps=32, scale=1920:1080, vflip, hflip, fifo [v0] However, it was extremely low. The commands are executed seriasly? Then, why I must recode every frame, when only 1/4 of them will be kept? How can I do that in order to gain recoding speed?

B) Why I need FIFO eventually. This must be not the default behavior? All frames that are kept must be processed from all filters! Right? Why then ffmpeg drop frames without being processed? this is the meaning of FIFO? Right?

Your Answer

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

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