janaka priyadarshana
2008-Feb-16 05:34 UTC
[theora-dev] Gray scale video output from theora
hi all I guess that *Theora* will convert the input color space (RGB or CMYK or any) into YUV before it process and encode. (that means theora can operate on several color space, but it get convert into YUV before process) Is that true...? I want to get a gray scale, encoded video output from the *Theora* encoder while the input video is getting from a web cam (color input and gray scale output). *If the above is true.....(*theora use YUV color space*)* it is possible that get a gray scale video output by just considering only the Y component of the video (ignore the U and V components) please give me your advices about how can I fulfill my requirement with Theora.....? -- ----------- Regards, Janaka Priyadarshana -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/theora-dev/attachments/20080216/c0bb3f59/attachment.htm
On 16-Feb-08, at 5:33 AM, janaka priyadarshana wrote:> If the above is true.....(theora use YUV color space)Yes, Theora always encodes video in a YUV colour space.> it is possible that get a gray scale video output by just > considering only the Y component of the video (ignore the U and V > components)Using just the Y plane is a reasonable way to convert a YUV image to a monochrome one. -r -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/theora-dev/attachments/20080216/ecf8605c/attachment.htm
janaka priyadarshana
2008-Feb-16 22:17 UTC
[theora-dev] Gray scale video output from theora
Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: Original.jpg Type: image/jpeg Size: 11094 bytes Desc: not available Url : http://lists.xiph.org/pipermail/theora-dev/attachments/20080217/02575298/Original-0001.jpg -------------- next part -------------- A non-text attachment was scrubbed... Name: test1.jpg Type: image/jpeg Size: 9593 bytes Desc: not available Url : http://lists.xiph.org/pipermail/theora-dev/attachments/20080217/02575298/test1-0001.jpg
On 16-Feb-08, at 10:05 PM, janaka priyadarshana wrote:> int temp = 0; > for ( i = 0; i < yuv->uv_height; i++ ){ > memset( LocalDataPtr, &temp, yuv->uv_width ); > LocalDataPtr -= yuv->uv_width; > InputDataPtr += yuv->uv_stride; > }In addition to Shane's comment, gray is u=v=128, not zero. That's the likely origin of the odd colours in your output. -r -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/theora-dev/attachments/20080217/e041e45c/attachment.htm