Red and Green color channels are swapped in ffmpeg rendered video

1

I'm using code similiar to this to pipe OpenGL image data directly to ffmpeg. I'm using this readpixels call:

qglReadPixels( 0, 0, glConfig.vidWidth, glConfig.vidHeight, GL_RGB, GL_UNSIGNED_BYTE, 0 );

however I have to use GL_RGB instead of GL_RGBA. In the ffmpeg command line I change RGBA to RGB24 accordingly. However, the output videos color channels are messed up (red is swapped with green). I can't seem to find any color formats that are GRB, so is there some way to swap red and green channels in ffmpeg using colorchannelmixer ?

edit: this would involve setting RR to 0, RG to 1, GG to 0, GR to 1? What would the syntax for that be?

Thanks.

vpvp

Posted 2016-03-28T20:57:24.347

Reputation: 13

Answers

2

Assuming that only the red and green channels have to be swapped, use

colorchannelmixer=rr=0:rg=1:gr=1:gg=0

Gyan

Posted 2016-03-28T20:57:24.347

Reputation: 21 016