Ask Your Question

Default color space for frames in video

asked 2016-12-26 07:27:32 -0500

Uma gravatar image

Hai, I have a video which is having yuv color space and H264 codec. I am using Opencv videocapture function to read a frame. I just want to know whether the frame's mat object is in BGR or YUV color space pixels ?

Thanks in advance.....

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-12-26 07:46:21 -0500

berak gravatar image

VideoCapture will convert the image automatically to BGR colorspace.

you can disable this conversion (and receive YUV) by setting the CAP_PROP_CONVERT_RGB property to false.

edit flag offensive delete link more


Thanks..If suppose I am reading raw YUV frame using file read operation and then I need to write frame using imwrite means, what color space will be present when using imwrite function?

Uma gravatar imageUma ( 2016-12-26 23:37:54 -0500 )edit

imwrite() won't change the colorspace

berak gravatar imageberak ( 2016-12-27 01:47:35 -0500 )edit

Thanks @berak

Uma gravatar imageUma ( 2016-12-27 04:59:41 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-12-26 07:27:32 -0500

Seen: 687 times

Last updated: Dec 26 '16