[FFmpeg-user] conditional filter of pixel value

Joshua Grauman jnfo-c at grauman.com
Wed Sep 27 06:09:25 EEST 2017


Hi all,

I have a setup where I am overlaying a screen record video on top of a 
camera video. The overlay works great. But I want to be able to position 
or turn off the screen recording differently, depending on a single pixel 
set in the screen record video.

How can I get a single pixel value (for example the bottom left pixel) to 
feed into the conditional filter? What function would I use on the 
commandline?

Something like:

-filter_complex "[0][1] overlay=x='if(gte(red_pixel_value(0, 1080),200), 
0, 50)':y=30"

where red_pixel_value(0, 1080) is the function I'm looking for that gets 
rgb (or ycbcr) values of a single pixel (in this case the bottom left 
one).

Thanks for any hints!

Josh


More information about the ffmpeg-user mailing list