Making a video with opencv and ffmpeg. How to find the right color format?

Posted by luc on Stack Overflow See other posts from Stack Overflow or by luc
Published on 2012-09-19T21:44:55Z Indexed on 2012/10/05 9:37 UTC
Read the original article Hit count: 168

Filed under:
|
|

I have a webcam video recorder program built with python, opencv and ffmpeg

It works ok except that the color of the video is more blue than the reality. The problem seems to come from color format of images.

It seems that OpenCv is giving BGR images and ffmpeg+libx264 is expecting YUV420p. I've read that YUV420p correspond to YCbCr.

opencv has no conversion from BGR to YCbCr. It only has a conversion to YCrCb.

I have made some searchs and tried different alternatives to try converting opencv image to something that could be ok for ffmpeg+libx264. None is working. At this point, I am a bit lost and I would appreciate any pointer that could help me to fix this color issue.

© Stack Overflow or respective owner

Related posts about python

Related posts about opencv