<div dir="ltr"><div>Hello!<br></div><div>Some questions:<br></div><div><br>1a. I would like to know where I can find documentation about ffmpeg reference counting. Is this the starting point or there are other resources? <br>
"<a href="http://www.ffmpeg.org/doxygen/2.0/group__lavu__buffer.html">http://www.ffmpeg.org/doxygen/2.0/group__lavu__buffer.html</a>".<br><br>1b. Is this the official url for examples code? <br>"<a href="http://www.ffmpeg.org/doxygen/2.0/examples.html">http://www.ffmpeg.org/doxygen/2.0/examples.html</a>"<br>
<br><br></div><div>2. I would like to know if the following code is safe if result==TRUE and r ==1. <br></div><div>There are additional questions on the code comments.<br></div><div><br clear="all">AVPacket pkt;<br></div>
...<br><div>pkt.buf = NULL; // no ref count. Does it matter?<br>// pkt was properly initialized and data filed != null.<br></div><div>...<br></div><div>BOOL result = (av_write_frame(oc, &pkt) == 0);<br><br>if (result)<br>
{<br>   int r = av_write_frame(oc, NULL); // flush<br><br>   if (r == 1)<br>   {<br>      av_free_packet(&pkt); // now pkt can be safely reused? <======<br>   }<br>}<br><br><br><div>3. I would like to know if the following code is safe if result==TRUE. <br>
<div>There are additional questions on the code comments.<br></div></div><div><br clear="all">AVPacket pkt;<br>...<br></div><div>// now pkt is ref counted and properly filled.<br></div>...<br>BOOL result = (av_interleaved_write_frame(oc, &pkt) == 0);<br>
<br>if (result)<br>{<br>   // From doc: "...Libavformat takes ownership of this reference..."<br>   <br></div><div>   // so...<br><br></div><div>   // I dont need to free packet, muxer will do that at right time. Correct?<br>
<br></div><div>   // so now pkt can be safely reused?  <======<br>}<br><br><br></div><div>4. From doc: "...If the packets are already correctly interleaved, the application should call av_write_frame() instead as it is slightly faster...". <br>
<br>4a. If av_interleaved_write_frame is fed with an already interleaved packet list, is this performance difference still notable?<br></div><div><br>4b. if av_interleaved_write_frame puts the packet in a private list, the function call should take less time compared to av_write_frame, correct?<br>
<br></div><div>The muxer I'm using is ASF.<br></div><div><br>thanks,<br></div><div>MB<br></div></div>