<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Dec 28, 2015 at 3:26 AM, Carl Eugen Hoyos <span dir="ltr"><<a href="mailto:cehoyos@ag.or.at" target="_blank">cehoyos@ag.or.at</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">David Tsulaia <d_tsulaia@...> writes:<br>
<br>
> ffmpeg version N-75912-g624057d Copyright (c) 2000-2015<br>
<br>
</span>Please test current FFmpeg git head before reporting<br>
issues.<br>
<span class=""><br>
> No matter what I try call to avcodec_decode_video2<br>
> results in memory leak.<br>
<br>
</span>valgrind output missing.<br>
<br>
Carl Eugen<br>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
</blockquote></div><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">I feel ashamed for coming to mailing list so unprepared.</div><div class="gmail_extra">Must have been several nights no sleep and desperation. <div><br></div><div>Now, I used current git build and showed similar results, </div><div>but I researched more and found out what was the issue:<br></div><div>It wasn't memory leak that's why valgrind constantly showed </div><div>that all heaps were freed and no leaks were possible. </div><div>The problem was that av_decode_video2 and av_interleaved_write_frame </div><div>both buffer packets for processing/reordering. Thing is the stream is so large </div><div>that both of these calls were not fast enough to deal with incoming packets </div><div>so memory usage kept climbing up.</div><div>I fixed this by using av_write_frame and provided already interleaved stream.</div><div><br></div><div>So my bad for not noticing that.</div><div><br></div><div>I have another issue I would like to get some help if possible:</div><div><br></div><div>Could you please tell me how to correctly switch between files while reading stream. </div><div>I am recording 1 hour long files from constant stream. Right now I am doing following:</div><div><br></div><div>avio_open2(&ofmt_ctx->pb, fname, AVIO_FLAG_WRITE, NULL, NULL );</div><div>after 1 hour.</div><div>avio_close(ofmt_ctx->pb);<br></div><div>make new file name</div><div>avio_open2(&ofmt_ctx->pb, new_fname, AVIO_FLAG_WRITE, NULL, NULL );<br></div><div><br></div><div>Is this right? I though of freeing context and reallocating it again, </div><div>but wanted to avoid extra tasks in reading/writing loop.</div><div><br></div><div>P.S. Happy holidays everyone.</div></div></div>