I have an mp4 video with a 0x0000f6 background color, a grayscale subject with some areas highlighted in green. I'm attempting to set the background color to 0x111B40 and adjust the hue of the green highlighted area by 90 degrees. My first attempt was to change the background color to transparent, adjust the hue, then add a background layer but for some reason when running ffmpeg input.mov -vf "hue=90" -y output.mov the transparent pixels in the background shift to a maroon solid instead of staying transparent. Is there better way to accomplish this?

Convert blue pixels to transparent

ffmpeg -f lavfi -i color=c=#00000000:s=606x1080 -i input.mp4 -c: png -filter_complex "[1:v]chromakey=0x0000f6:similarity=.455[out]" -map "[out]" -y transparent.mov

Shift hue by 90 degrees

ffmpeg -i output.mov -vf "hue=90" -y hue.mov This changes the transparent pixels to a solid maroon color


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.