Sunday, February 6, 2022

Quick white balance fix for video recording on DSLR using AVISynth

Many DSLRs, especially entry-level ones like my D3400, don't have Kelvin White Balance as an option, so you will most likely need to fix WB in post. With still images, it's pretty easy to fix using the camera brand's software (Nikon NX-D or NX Studio in my case). However, with videos things become a lot trickier. If you already have Adobe Premiere or DaVinci Resolve installed on your PC, it's easy. But if you just want something lightweight and free, you can just use AVS.

Script example:

DirectShowSource("DSC_1397.MOV", fps=30)

ConvertToYV12()

LanczosResize(960, 540)

ColorYUV(off_y=+0, off_u=+12, off_v=-12)

Histogram("levels")

 Before


After


To use this, you must first get used to working with histograms. Both ColorYUV and Histograms are built-in filters of AVS, so you don't need to install any external plugin. The Histogram filter will add 3 histograms to the video. Top one is luma, second and third are chroma U and V respectively. Using the histograms, it should be easy to know which value you should fix. Once you are done, put a # before Histogram("levels") to remove the histograms from your script, then encode your video using MeGUI, VirtualDub, ffmpeg or whatever program that supports AVS.

Notes:

1. This method is not the exact WB fix, but it's very close. If you aren't doing any serious production work, this should be more than enough.

2. For more arguments, see http://avisynth.nl/index.php/ColorYUV

3. In case ColorYUV isn't enough, try adding Tweak: http://avisynth.nl/index.php/Tweak

No comments:

Post a Comment