How to add motion vectors to video


Note to athletes, animators, and #sakuga dorks: you can take advantage of ffmpeg’s motion prediction to show you all movement in your favourite animes and reference video by awesome people with motion vectors.

Take Mike Rashid’s video as an example:

# Install dependencies
brew install ffmpeg

You can either play the video directly:

ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv=pf+bf+bb

Or encode a new one:

ffmpeg -flags2 +export_mvs -i input.mp4 -vf codecview=mv=pf+bf+bb output.mp4