Search code examples
ffmpegffprobe

FFmpeg/FFprobe - detect blank/empty/white image


Is it possible, using ffmpeg or ffprobe, to detect if an image is blank? Only containing a single color, e.g. White.

I have done some digging and have come up with nothing at all, I don't even know if this is possible. I intend to execute via a batch file.

Thanks for any pointers.


Solution

  • for /f "tokens=* USEBACKQ" %%f in (`ffprobe -f lavfi -i "movie=test.png,signalstats" -show_frames`) do (
    set /a line=!line!+1
    if !line! EQU 33 set ave=%%f
    )
    
    if "!ave:~27,3!"=="235" echo WHITE