<div dir="ltr"><div class="gmail-usertext-body gmail-may-blank-within gmail-md-container"><div class="gmail-md"><p>Hello everyone,<br><br>I
am trying to use libavformat to create a .mp4 video with a single h.264
video stream, but the final frame in the resulting file often has a
duration of zero and is effectively dropped from the video. Strangely
enough, whether the final frame is dropped or not depends on how many
frames I try to add to the file. Some simple testing that I outline in
the Stack Overflow link below makes me think that I am somehow
misconfiguring either the AVFormatContext or the h.264 encoder,
resulting in two edit lists that sometimes chop off the final frame. I have also put a simplified version of the code I am using (MWE) on the Stack Overflow question, in case I'm
making some obvious mistake. Any help would be greatly appreciated: I've
been struggling with this issue for the past few days and have made
little progress.</p>
<p>I have put more details, including the edit list box information, as well as a MWE, on my <a href="https://stackoverflow.com/questions/64547604/libavformat-ffmpeg-muxing-into-mp4-with-avformatcontext-drops-the-final-frame" target="_blank" rel="noopener">Stack Overflow question</a>. Any help would really be appreciated, I've been banging my head against the wall with this.</p><p>Thank you in advance for your time!</p><p>Best,</p><p>Galen Lynch<br></p>
</div>
</div></div>