Posted on

I saw the following youtube video, I like the concept a lot but I only have ffmpeg.

In the video we can make up five steps to extract the motion from a normal video

  • set opacity to 50%
  • duplicate video
  • inverse colors on first duplicate
  • time shift on second duplicate
  • overlay duplicates

After some trial and error, here's the ffmpeg command I came up with to achieve a similar effect:


ffmpeg -nostdin \
    -i "$1" \
    -filter_complex \
        [0:v] format=rgba,lutrgb=a=128 [hopa]; [hopa] split [hopa1][hopa2];
        [hopa1] lutrgb=r=negval:g=negval:b=negval [neg];
        [hopa2] setpts=PTS-${TIME_SHIFT}/TB [tshift];
        [tshift][neg] overlay [out]
    " \
    -map '[out]' out.mkv