(FFmpeg) How to add a motion blur to a video?

I saw this question on Reddit and started messing with the effects recommended and totally liked the effect seen in the video below:

Here’s the full script using the tmix filter:

$ ffmpeg -i input.mp4 -vf tmix=frames=8:weights="1 1 1 1 1 1 1 1" output.mp4

What you’ll notice here is the more frames you set the more motion effect is applied. The weights must equal the same number of frames. there are eight “ones” for 8 frames. “of weights is smaller than [the] number of frames last specified weight will be used for all remaining unset weights.”

Mix successive video frames.

A description of the accepted options follows.

frames
The number of successive frames to mix. If unspecified, it defaults to 3.

weights
Specify weight of each input video frame. Each weight is separated by space. If number of weights is smaller than number of frames last specified weight will be used for all remaining unset weights.

scale
Specify scale, if it is set it will be multiplied with sum of each weight multiplied with pixel values to give final destination pixel value. By default scale is auto scaled to sum of weights.

Love FFmpeg? Grab a copy of FFmpeg For Beginners on Kindle or Paperback to learn over 120 ways to master FFmpeg!

buy now on amazon