On Thu, 04 Dec 2008 19:28:59 -0500, Cai, Xin <[EMAIL PROTECTED]> wrote: [...] > My second question is, I also want to be able to strip away color > information and turn the video to black and white. How would I do that? > Thanks
Actually thats really easy (probably). Most codecs operate on YUV420P. "P" means planar, where the Y, U, and V components are in their own buffer. The "Y" component is the grayscale image you want. So, just look at pic->data[0] as a Width*Height 1-byte-per-pixel grayscale image. Don't forget to use linesize[0] instead of Width when stepping to a row in the image. If you only want to handle this one source, and it uses YUV420P, then you're done. But if you want to handle all formats/codecs, then yes, you need to use sws_scale operations. -- Michael Conrad IntelliTree Solutions llc. 513-552-6362 [EMAIL PROTECTED] _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
