Hi Qinfan,<div><br></div><div>Thank you very much for your hints!</div><div><br></div><div>I monitored the sending frames and the receiving frames, and they are the same. In fact, at the server end, I generate frames one by one, and encode it, then send it. Therefore, at the client end, they must be received one frame by one frame. So I think i don't have "incomplete frame" issue. </div>

<div><br>Sincerely,</div><div><br><div class="gmail_quote">On Fri, Mar 23, 2012 at 1:39 AM, 吴沁凡 <span dir="ltr"><<a href="mailto:wuqinfan@gmail.com" target="_blank">wuqinfan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


The incoming data received by the client can be an incomplete frame (or may be more than one frame, since the data is not organized as the same as you wrote at server end), so you can not decode it directly.<div>Use function <span style="white-space:pre-wrap">av_parser_parse2</span><span style="white-space:pre-wrap">() first to get complete frame one by one from the incoming data.</span></div>



<div><span style="white-space:pre-wrap"><br></span></div><div><span style="white-space:pre-wrap">for usage of av_parse_parse2(), please refer to avcodec.h</span></div><div><span style="white-space:pre-wrap">Here is my code for decoding. I also tried a lot, since the examples in ffmpeg only tell about decode complete frames.</span></div>


</blockquote></div>
</div>