How to outline black and white videos in blue using FFMPEG.

I had a little time tonight to finish my experiment. It’s low resolution, low quality because I just wanted “proof of concept”, but I did it. I got the black + white figures to be outlined. Using a higher resolution, it might actually look nice but the main thing I’m glad about is knowing that I *can* do it and I’ve documented the process.

Duck and Cover (1951) Audio Enhanced, Wire-frame

Audio excited above around 4000 Hz and slightly time shifted,, bass dropped an octave.

Blue outlining was ffmpeg experimenting. 320×200 because it’s an experiment.

a) Create “Edge Detect” version (I used Windows movie maker)
invert colors
b) Make color inverted version with FFMPEG
ffmpeg -i output2.avi -vf lutrgb=”r=negval:g=negval:b=negval” output3.avi

c) turn negative wireframe (edge detect) blue with FFMPEG
blue outline!
ffmpeg -i duck-and-cover-frame-negative.mp4 -vf colorchannelmixer=-2:-2:-2:-2:-2:-2:-2:1:1:1:1 duck-and-cover-blue.mp4

d) Now mix blue outline, using BLACK as chromakey on top of original
ffmpeg -i duck-and-cover-320×240.mp4 -i duck-and-cover-blue.mp4 -filter_complex “[1:v]colorkey=0x000000:0.7:0.2[ckout];[0:v][ckout]overlay[out]” -map “[out]” duck-and-cover-overlay4.mp4

Leave a comment

Your email address will not be published. Required fields are marked *

6 × five =

Leave a Reply