<br><br><div class="gmail_quote">On Thu, Sep 22, 2011 at 4:36 PM, Denis <span dir="ltr"><<a href="mailto:info@denisgottardello.it">info@denisgottardello.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<u></u>
<div style="font-family:'DejaVu Sans';font-size:9pt;font-weight:400;font-style:normal"><div class="im">
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> Where does your encoded data come from? Persumably you have data that you</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> write to the opened avio contexts. Just copy that data into a buffer?</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"></p>
</div><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">The data comes from a webcam. I have not understood how.</p></div></blockquote></div><br>You need to show the source of your data. How do you get the frames from a webcam, does it come in packets? RGB data? that's the code you should show.  The problem that I'm seeing is that you're using an avio context when you don't actually intend to write data with it to a file. Just take the webcam frame data call avcodec_encode_video and that function writes it to a buffer. I'm not sure why you're making the all these avio calls. I suggest you also look at the headers for avcodec_encode_video.<br>