<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; ">Carl, <div><br></div><div>Thanks for the reply. I've tried both PIX_FMT_NV12 and PIX_FMT_NV21 (in fact, those were the ones I originally thought would work based on description). However, when I use either of those formats in place of  <span style="color: rgb(61, 29, 129); font-family: Menlo; font-size: 11px; ">PIX_FMT_YUV420P </span>in the following line of code: </div><div><br></div><div><span style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162); ">int</span><span style="font-family: Menlo; font-size: 11px; "> returnVal = </span><span style="font-family: Menlo; font-size: 11px; color: rgb(61, 29, 129); ">avpicture_fill</span><span style="font-family: Menlo; font-size: 11px; ">((</span><span style="font-family: Menlo; font-size: 11px; color: rgb(112, 61, 170); ">AVPicture</span><span style="font-family: Menlo; font-size: 11px; ">*)avFrame, frameBufferBaseAddress, </span><span style="font-family: Menlo; font-size: 11px; color: rgb(61, 29, 129); ">PIX_FMT_YUV420P</span><span style="font-family: Menlo; font-size: 11px; ">, width, height);</span></div><div><font face="Menlo"><span style="font-size: 11px;"><br></span></font></div><div>then while it executes the avpicture_fill line successfully, the subsequent line of code </div><div><br></div><div><span style="font-family: Menlo; font-size: 11px; ">returnVal = </span><span style="font-family: Menlo; font-size: 11px; color: rgb(61, 29, 129); ">avcodec_encode_video2</span><span style="font-family: Menlo; font-size: 11px; ">(</span><span style="font-family: Menlo; font-size: 11px; color: rgb(79, 129, 135); ">_videoStream</span><span style="font-family: Menlo; font-size: 11px; ">-></span><span style="font-family: Menlo; font-size: 11px; color: rgb(112, 61, 170); ">codec</span><span style="font-family: Menlo; font-size: 11px; ">, &avPacket, avFrame, &gotPacket);</span></div><div><br></div><div>crashes the whole app with an EXC_BAD_ACCESS error --  and there's no message of any kind written to the console. I have no idea what is causing the crash. Here's the complete block of the code between those two lines: </div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">...   </div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "> <span style="color: #bb2ca2">int</span> returnVal = <span style="color: #3d1d81">avpicture_fill</span>((<span style="color: #703daa">AVPicture</span>*)avFrame, frameBufferBaseAddress, <span style="color: #3d1d81">PIX_FMT_NV21</span>, width, height);</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">    <span style="color: #bb2ca2">if</span> (returnVal < <span style="color: #272ad8">0</span>)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">    {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">        <span style="color: #bb2ca2">if</span> (error)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">        {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><div style="margin: 0px; color: rgb(209, 47, 27); "><span style="color: #000000">        <span class="Apple-tab-span" style="white-space:pre">    </span></span><span style="color: #31595d">NSLOG</span><span style="color: #000000">(</span>@"Frame fill failed."<span style="color: #000000">);</span></div></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><span style="color: rgb(209, 47, 27); ">        </span><span style="color: rgb(209, 47, 27); ">}</span></div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">        <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">        <span style="color: #bb2ca2">return</span> <span style="color: #bb2ca2">NO</span>;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">    }</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; "><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); ">    <span style="color: rgb(112, 61, 170); ">AVPacket</span> avPacket;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">    <span style="color: #3d1d81">av_init_packet</span>(&avPacket);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">    avPacket.<span style="color: #703daa">data</span> = <span style="color: #bb2ca2">NULL</span>;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">    avPacket.<span style="color: #703daa">size</span> = <span style="color: #272ad8">0</span>;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">    <span style="color: #bb2ca2">int</span> gotPacket;</div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">    <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">    returnVal = <span style="color: #3d1d81">avcodec_encode_video2</span>(<span style="color: #4f8187">_videoStream</span>-><span style="color: #703daa">codec</span>, &avPacket, avFrame, &gotPacket);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); ">...</div></div><div><br></div><div>That's been pretty standard for most of the other pixel formats I've tried. There have been one or two that didn't crash the app, but had very wacky distortions (like half the image being neon green), but most of them just crash the app outright. </div><div><br></div><div>Ideas? </div><div><br></div><div>Brad</div><div><br></div><div><div><div>On Feb 4, 2013, at 4:55 PM, Carl Eugen Hoyos <<a href="mailto:cehoyos@ag.or.at">cehoyos@ag.or.at</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Brad O'Hearne <brado@...> writes:<br><br><blockquote type="cite">"Bi-Planar Component Y'CbCr 8-bit 4:2:0, full-range <br>(luma=[0,255] chroma=[1,255]). baseAddr points to a <br>big-endian CVPlanarPixelBufferInfo_YCbCrBiPlanar struct."<br><br>My code (heavily abridged for brevity) hits these high points: <br><br>NOTE: frameBufferAddress is a CVImageBufferRef received <br>from the QT capture callback: <br><br>    int returnVal = avpicture_fill((AVPicture*)avFrame, <br>frameBufferBaseAddress, PIX_FMT_YUV420P, width, height);<br></blockquote><br>Could "biplanar" point to AV_PIX_FMT_NV12?<br>(Or something else that is not AV_PIX_FMT_YUV420P)<br><br>Carl Eugen<br><br>_______________________________________________<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></div></body></html>