<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Mar 10, 2014, at 4:47 PM, wm4 <<a href="mailto:nfxjfg@googlemail.com">nfxjfg@googlemail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">On Mon, 10 Mar 2014 16:18:27 -0700<br>Ricky Huang <<a href="mailto:rhuang.work@gmail.com">rhuang.work@gmail.com</a>> wrote:<br><br><blockquote type="cite">Hello all,<br><br>I am writing code that extracts the luminance component of an input video using my own custom filter in libavfilter - specifically I am extracting it from "PIX_FMT_YUV420P" a video and I am wondering how to go about doing so.  According to the pixfmt.h header: <br><blockquote type="cite"><br>PIX_FMT_YUV420P,   ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)<br></blockquote><br>I am not sure how to interpret that.  Assuming I am doing this in my draw_slice() function. It has the definition of:<br><blockquote type="cite"><br>static void draw_slice(AVFilterLink *inlink, int y0, int h, int slice_dir)<br></blockquote><br>I know I can get to the input data plane by:<br><blockquote type="cite"><br>AVFilterBufferRef *cur_pic = link->cur_buf;<br>uint8_t *data = cur_pic->data[0];<br></blockquote></blockquote><br>I think this functionality was removed long ago. You're supposed to<br>write/read AVFrames from the filters.<br></blockquote><div><br></div><div>Due to internal reasons, we are running ffmpeg 0.7, so the primary arguments to draw_slice() is AVFilterLink*.  Sorry I should have specified that when asked the question.</div><div><br></div><div>Or maybe I am missing something obvious here?  Can you help me out with how to use AVFrame to extract the luminance component?</div><div><br></div><br><blockquote type="cite"><blockquote type="cite">But there are multiple "planes" in the data.  Does data[0], data[1], data[2] correspond to each of the Y, U, V channels?<br></blockquote><br>Yes, for YUV420P.<br><br><blockquote type="cite">Also, once I am able to point my pointer at the correct coordinate, how should I interpret the extracted result (float, int, etc)?<br><br><br>Thank you in advance.<br></blockquote>_______________________________________________<br>Libav-user mailing list<br><a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>http://ffmpeg.org/mailman/listinfo/libav-user<br></blockquote></div><br></body></html>