<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1256"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi,<div><br></div><div>I don't see anything wrong in your code.</div><div>What I would try:</div><div><br></div><div><span style="line-height: 22px; background-color: rgb(255, 255, 255);">1) Do not free AVIOContext right after your call to av_open_input(), keep it until the end of the program.</span></div><div>2) From FFmpeg oxygen about avio_alloc_context() buffer param:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>"<span style="line-height: 22px; background-color: rgb(255, 255, 255);">The buffer must be allocated with </span><a class="el" href="http://ffmpeg.org/doxygen/trunk/tableprint__vlc_8h.html#ae97db1f58b6b1515ed57a83bea3dd572" style="color: rgb(70, 101, 162); font-weight: bold; text-decoration: none; line-height: 22px;">av_malloc()</a><span style="line-height: 22px; background-color: rgb(255, 255, 255);"> and friends [OK], </span><span style="background-color: rgb(255, 255, 255); line-height: 22px;">it may be freed and replaced with a new buffer by libavformat [Ooops]".</span></div><div><span style="background-color: rgb(255, 255, 255);"><span class="Apple-tab-span" style="line-height: 22px; white-space: pre;"> </span><span style="line-height: 22px;">I would double check the integrity (desired size) of your buffer at each call, just to be sure.</span></span></div><div><br></div><div>Good luck.</div><div><br></div></body></html>