Here’s the expression to apply to the brightness parameter for Lens Flare –
// Flare Brightness driven by pixels directly under the Flare Center point
// PLACE THIS EXPRESSION INTO THE Flare Brightness parameter
// Grab the Flare Center (2D point inside the effect)
flareCenter = effect(“Lens Flare”)(1); // change name if you use Optical Flares
// Convert that point from **effect point space** → **composition space**
samplePointComp = thisLayer.toComp(flareCenter);
// Target layer you want to sample (your video)
target = thisComp.layer(“mixkit-breakfast-at-a-table-with-bread-coffee-and-fruit-4866-full-hd.mp4”);
// Rect Size for sampleImage
rectSize = [120, 120];
sampled = target.sampleImage(samplePointComp, rectSize, false, time);
// converts captured RGB to brightness value which will then be used to drive the effect’s brightness value
luma = sampled[0]*0.299 + sampled[1]*0.587 + sampled[2]*0.114;
// Your desired brightness range – tweak these two numbers only
linear(luma, 0, 1, -35, 100)
You’ll need a Mask – I placed a mask over the plate. You will need to set the Flare effect’s Compositing Options to point to this mask.
HTH