Posted: . At: 11:18 AM. This was 3 years ago. Post ID: 15232
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.



Sponsored



More fun with FFmpeg. How to reverse video colors in interesting ways.


FFmpeg allows interesting video manipulation. This includes inverting the colours of video files.

The example below will invert the colours of a video file.

┌──[jason@192.168.1.2][~/Videos/titles]
└──╼  ╼ $ ffmpeg -i zombiestrain.avi -vf lutrgb="r=negval:g=negval:b=negval" zomby.avi

This is an example of what this filter will give you.

This example is changing the gamma value of the red channel.

┌──[jason@192.168.1.2][~/Videos/titles]
└──╼  ╼ $ ffmpeg -i boom-nosound.webm -vf lutrgb="r=gammaval(0.5):g=negval:b=negval" expl3.webm

This makes the red channel stand out a bit more interestingly.

And finally, this is a way of modifying the blue channel as well, this makes for interesting colours.

┌──[jason@192.168.1.2][~/Videos/titles]
└──╼  ╼ $ ffmpeg -i boom-nosound.webm -vf lutrgb="r=gammaval(0.5):g=negval:b='bitand(val, 128+64+32)'" expl4.webm

Normal colours, but a garish red effect over the video.

┌──[jason@192.168.1.2][~/Videos/titles]
└──╼  ╼ $ ffmpeg -i boom-nosound.webm -vf lutyuv=u='(val-maxval/2)*2+maxval/2':v='(val-maxval/9)*2+negval/2' expl5.webm

Make the video spin around whilst it plays. This is awesome.

┌──[jason@192.168.1.2][~/Videos/titles]
└──╼  ╼ $ ffmpeg -i boom-nosound.webm -vf "rotate=1.9178*PI*t:ow='min(iw,ih)/sqrt(0.997)':oh=ow:c=none" me.webm

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.