[FFmpeg-user] Fluorescent White Balance Video Filters

Michael Koch astroelectronic at t-online.de
Wed Apr 20 08:35:22 EEST 2022


Am 19.04.2022 um 23:06 schrieb Roger:
>> On Tue, Apr 19, 2022 at 08:25:17PM +0200, Michael Koch wrote:
>> Am 19.04.2022 um 03:34 schrieb Roger:
>>> I'm not finding much about fixing video having incorrect white space, more
>>> specifically video with incorrect or forgotten fluorescent white balance
>>> setting during recording.
> ...
>>> Question, what is the proper method of applying such a missing white balance
>>> fluorescent filter to a video file using ffmpeg?
>> I would do that with a color-look-up-table. The procedure is described
>> step-by-step in chapter 2.27 and an easier simplified version is described in
>> chapter 2.28 in my book:
>> http://www.astro-electronic.de/FFmpeg_Book.pdf
>>
>> Michael
> No stranger to these color tables for correction white balance, as my Nikon
> DSLR and likely most recent DLSR cameras use some correcting color profiles
> these days!
>
> However, seems there's few options for video files.
>
> Found through Google,
> https://lutify.me/free-white-balance-correction-luts-for-everyone/
> Download: Free White Balance Correction LUTs
> Lutify-me-Free-White-Balance-Correction-3D-LUTs.zip
>
> 2800 Kelvin - 3200 Kelvin - 0.34 CTO.cube
> 2800 Kelvin - 4300 Kelvin - 0.95 CTO.cube
> 2800 Kelvin - 5500 Kelvin - 1.34 CTO.cube
> 2800 Kelvin - 6500 Kelvin - 1.56 CTO.cube
> 3200 Kelvin - 2800 Kelvin - 0.34 CTB.cube
> 3200 Kelvin - 4300 Kelvin - 0.61 CTO.cube
> 3200 Kelvin - 5500 Kelvin - 1.00 CTO.cube
> 3200 Kelvin - 6500 Kelvin - 1.21 CTO.cube
> 4300 Kelvin - 2800 Kelvin - 0.95 CTB.cube
> 4300 Kelvin - 3200 Kelvin - 0.61 CTB.cube
> 4300 Kelvin - 5500 Kelvin - 0.39 CTO.cube
> 4300 Kelvin - 6500 Kelvin - 0.60 CTO.cube
> 5500 Kelvin - 2800 Kelvin - 1.34 CTB.cube
> 5500 Kelvin - 3200 Kelvin - 1.00 CTB.cube
> 5500 Kelvin - 4300 Kelvin - 0.39 CTB.cube
> 5500 Kelvin - 6500 Kelvin - 0.21 CTO.cube
> 6500 Kelvin - 2800 Kelvin - 1.56 CTB.cube
> 6500 Kelvin - 3200 Kelvin - 1.21 CTB.cube
> 6500 Kelvin - 4300 Kelvin - 0.60 CTB.cube
> 6500 Kelvin - 5500 Kelvin - 0.21 CTB.cube
>
> Yea, horrendously named file names!
>
> $ ffmpeg -i 00003.avi -vf lut3d=/tmp/lut/Lutify.me\ Free\ White\ Balance\ Correction\ 3D\ LUTs/3D\ LUTs/6500\ Kelvin\ -\ 5500\ Kelvin\ -\ 0.21\ CTB.cube -crf 27 -preset veryfast -c:a copy test2.mp
>
>
> On my second try, tried "6500 Kelvin - 5500 Kelvin - 0.21" and this is very close to RawTherapee's Philips TL85 fluorescent white balance setting results, if not better than RawTherapee!  Still not absolutely perfect likely more due to VHS tape degradation or re-recorded degradation, as this section/sesesion of the VHS tape was a recording of a recording of a recording during the 1990's.
>
> For reference for those wondering how I digitized without a time correcting device, I used ffmpeg on the compressed original video captures to augment the video/audio sync problem and was trial and error.  Subsequently using the yadif deinterlace filter and specifying the double pass option.
>   -filter:v "setpts=0.8015*PTS",yadif=1
>
> Are these LUTS my best options?  Or does the paid subscription offer better?
> Or are there other white balance/color correcting LUTS elsewhere?

You can make your own LUT, as described in chapter 2.28 in my book.
-- Extract one frame from your video.
-- Insert a haldclut in a corner of the image, or use xstack to attach 
it to the side.
-- Use the program of your choice to correct the colors in this image. 
When done, save it lossless as 16-bit PNG.
-- Use FFmpeg to separate the haldclut from the image.
-- Apply the LUT to the whole video.

Michael


More information about the ffmpeg-user mailing list