<div dir="ltr">Hi friends, here I have several questions about AVI format interleave need your help.<div><br></div><div>Basically what my program is doing is quite simple, it has a loop reading out video/audio content, and send them to encode to get packets, and finally call av_write_frame to write packets into file.</div>
<div><br></div><div>So when I did this for AVI format (huffYUV + mp3), I found that the packets in generated AVI files looks like this.</div><div><br></div><div>-V1</div><div>-V2</div><div>-V3</div><div>-V4</div><div>-V5</div>
<div>-V6</div><div>-V7</div><div>-V8</div><div>-V9</div><div><font color="#ff0000">-A1</font></div><div><font color="#ff0000">-A2</font></div><div><font color="#ff0000">-A3</font></div><div><font color="#ff0000">-A4</font></div>
<div>-V10</div><div>-V11 </div><div><br></div><div>I mean there're too many video frames between two chunks of audio samples, and this video file has some problems while playing in my own player (I guess the AV interleaving is the cause). and if I use ffmpoeg -i -vcodec copy -acodec copy to convert this avi into another avi, I can find that the AV interleaving in the ffmpeg converted AVI is quite good, like v1 v2 a1 a2 v3 v4 a3 a4. and it plays correctly in my own player.</div>
<div><br></div><div><br></div><div>This program uses av_write_frame to write packet (there seems to have no special code to arrange A/V packets before calling av_write_frame) so I changed it to use av_interleaved_write_frame instead, and with av_interleaved_write_frame, generated AVI has perfect A/V interleaving and file plays perfectly in my player.</div>
<div><br></div><div>So now I'd like to know.</div><div><br></div><div><font color="#ff0000">1. If my program has no code to arrange A/V packets order, the order of A/V packets completely are based on the order of data read out from source. should I use av_interleaved_write_frame to generate an AVI file?</font></div>
<div><font color="#ff0000"><br></font></div><div><font color="#ff0000">2. for AVI format, is it safe to use av_interleaved_write_frame to replace av_write_frame? (if packets not properly ordered, then of course should use av_interleaved_write_frame, but if packets were correctly ordered, will av_interleaved_write_frame causing any problem excepts performance penalty?)</font></div>
<div><br></div><div>Great thanks!</div></div>