dyne / frei0r

A large collection of free and portable video plugins
https://frei0r.dyne.org/
GNU General Public License v2.0
419 stars 90 forks source link

glow plugin to support different blurs #102

Closed Samreay closed 4 years ago

Samreay commented 4 years ago

Hi team,

Ive been trying to use ffmpeg's filters to essentially add glow to a series of artistic videos by manually blurring and then blending. Obviously it doesn't work too well.

Then I saw a link to the frei0r plugins and thought "perfect", so I set it up, and ran with default filters frei0r=glow:1 in ffmpeg, and the output did have glow, but with a very streaky blur and with artifacts, when I was hoping for something like a Gaussian blur. Image of the input and output attached.

Perhaps I'm simply using the filter wrong and someone can correct me, but if not, this may be an interesting customisation to add if anyone has the inclination. I read through the code in the hopes of being able to submit a PR, but feel out of my depth!

Input:

input

Run command:

ffmpeg -i input.png -vf frei0r=glow:1 output.png

Ouptput:

output

richardpl commented 4 years ago

whats wrong with this: ffmpeg -i input.png -vf "split[a][b],[a]gblur=200:2[a],[a][b]blend=all_mode=lighten" output.png

richardpl commented 4 years ago

or this: ffmpeg -i input.png -vf "split[a][b],[a]yaepblur=255:7:99024[a],[a][b]blend=all_mode=lighten" output.png

Samreay commented 4 years ago

Hey Paul! Actually that works perfectly, I was not aware you chain filters and split the image like that, so this is far superior to my current "make two outputs and then blend them together in a separate step" approach. Thanks for helping me learn something new today :) Hopefully these examples will pop up in search if anyone has similar thoughts in the future, cheers!

richardpl commented 4 years ago

If you want output more like that frei0r glow one, use directional blur, dblur instead of gblur/yaepblur, just adjust/increase radius.