[FFmpeg-user] Fluorescent White Balance Video Filters

Roger rogerx.oss at gmail.com
Wed Apr 27 22:52:38 EEST 2022

Chapter 2.28 uses filter_complex without white spaces or colons?

$ ffmpeg -i 20220421_163910-meet.mp4 -i image_with_clut-meet-edited-clut.png -filter_complex [0]eq=brightness=0.06[a];[a][1]haldclut -y 20220421_163910-meet-edited.mp4

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '20220421_163910-meet.mp4':                                                                                                                                
Filter eq has an unconnected output                                                                                                                                                                
bash: [a][1]haldclut: command not found

Notice, "haldclut command not found"

Including white space for filter_complex:

$ ffmpeg -i 20220421_163910-meet.mp4 -i image_with_clut-meet-edited-clut.png -filter_complex '[0]eq=brightness=0.06 [a];[a] [1] haldclut' -y 20220421_1

man ffmpeg-filters

Looks like you syntax omits the single quotes around the filter_complex option AND has missing white spaces and/or colons.

Not sure if "[a];[a]" should have white spaces.

For sake of simplicity, here's what I have:


Snip or extract portion of video requiring white balance, color or brightness corrections.
$ ffmpeg -ss 590 -i 20220421_163910.mp4 -t 867 -codec copy 20220421_163910-meet.mp4

Frame of (VHS) video requiring white balance or color/brightness correction, creating a CLUT embedded extracted image:
This is frame at "11:00" for this specific video

$ ffmpeg -ss 11:00 -i 20220421_163910.mp4 -f lavfi -i haldclutsrc=8 -filter_complex "[1]format=pix_fmts=rgb48be[a];[a][0]xstack=inputs=2:layout=0_0|w0_0" -frames 1 -y image_with_clut-meet.png

Open image_with_clut-meet.png within Gimp, edit Color > Color Temperature and/or Color > Levels > Output Levels, export as "16bpc RGB" image_with_clut-meet-edited.png.

Crop the CLUT (512:512) from the Gimp exported image.
$ ffmpeg -i image_with_clut-meet-edited.png -vf crop=512:512:0:0 -y image_with_clut-meet-edited-clut.png

Apply the resulting CLUT using FFmpeg's filter_complex.
TIP: Use acodec copy as this is only modifying the video stream.
TODO: Brightness reduction for color retention?
TODO: Added white space to filter_complex, likely could also use colons, but white spacing is better for readability.

$ ffmpeg -i 20220421_163910-meet.mp4 -i image_with_clut-meet-edited-clut.png -filter_complex '[0]eq=brightness=0.06 [a];[a] [1] haldclut' -y 20220421_163910-meet-edited.mp4

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-user/attachments/20220427/1a6d2353/attachment.sig>

More information about the ffmpeg-user mailing list