Converted color detection code to python to work with FFmpeg