<div>sorry about that..i was calculating the offser wrong.</div><div><br><br> </div><div class="gmail_quote">On Thu, May 31, 2012 at 11:30 AM, ashika umanga <span dir="ltr"><<a href="mailto:umanga.forums@gmail.com" target="_blank">umanga.forums@gmail.com</a>></span> wrote:<br>
<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote"><p>Greetings all,</p><p>I am trying to fill sample data for a AVFrame initialized with RGB24 format.<br>
I use following code snippet to populate RGB data.<br>But in the encoded video,I can only see grayscale strip covering only 1/3 of the videoframe.<br>
This code snippet suppose to fill only Red color.<br>Any tips what Im doing wrong here ?</p><p> </p><p><br>AVFrame *targetFrame=.....<br>int height=imageHeight();<br>int width=imageWidth();</p><p><br> for(y=0;y<encoder.getVideoParams().height ;y++){ <br>
for(x=0;x< encoder.getVideoParams().width;x++){</p><p><br> targetFrame->data0[index][(y* width)+x]=(x%255); //R <br> targetFrame->data0[index][(y* width)+x+1]=0; //G<br> targetFrame->data0[index][(y* width)+x+2]=0; //B<br>
<br> <br> }<br> }<br></p>
</blockquote></div><br>