c++ - ffmpeg video output is desaturated -


i'm trying view application (using opengl) written file. how opengl frame:

glbindtexture(gl_texture_2d, rendertexture->gettexturedata()->glid);     glgetteximage(gl_texture_2d, 0, gl_rgba, gl_unsigned_byte, pixels); 

this works fine , has right colors. (i checked rendering pixels single image file).

now, since want in video i'm using ffmpeg encoding. command:

ffmpeg -r 24 -pix_fmt rgba -s 1280x720  -f rawvideo -y -i - -vf vflip -vcodec mpeg1video -q:v 4 -bufsize 500kb -maxrate 5000kb 

this "works" video desaturated compared actual input gets opengl. how can solve this? (if possible, can changing things in command?)

most way ffmpeg reads pixels doesn't match layout out of opengl. use glpixelstorei gl_pack_… parameters pin down layout opengl emits.

another problem may color spaces. you've make sure ffmpeg operates in same color space opengl context. if not you've determine color spaces , add conversion filter ffmpeg's processing chain.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -