Ara Badalyan February 2016

ffmpeg video filter with RGB

I need filter mp4 video with ffmpeg using RGB values. For example with opengl it look like this

void main() {
        vec4 color = texture2D(sTexture, vTextureCoord);
        float colorR = (1.0 - color.r) / 2.0;
        float colorG = (1.0 - color.g) / 2.0;
        float colorB = (1.0 - color.b) / 2.0;
        gl_FragColor = vec4(colorR, colorG, colorB, color.a);
    }

Can i do it with ffmpeg command ?

Answers


Mulvya February 2016

If your ffmpeg is compiled with libx264, you can use

ffmpeg -i input.mp4 -vf extractplanes=r -c:v libx264rgb -pix_fmt rgb24 output.mp4

You can also specify bgr24 or bgr0 (32-bit; has an unused 4th channel)

Post Status

Asked in February 2016
Viewed 1,489 times
Voted 9
Answered 1 times

Search




Leave an answer