<div dir="ltr"><div>Let's talk about the usual workflow of any video manipulation process:</div><div>1. Somehow, you get AVFrame objects either from a previous video file or from a camera <br></div><div>2. Then you encode them, transcode them, or whatever you need to do</div><div>3. Finally you save those AVFrames into a new video file or you use a stream to transmit them <br></div><div><br></div><div>In general terms, you start dealing with AVFrame records, but at the moment of storing them, you need to use AVPacket structures.<br></div><div>My suggestion was: if you need to save a copy of the previous AVFrame item because you have to save or transmit it again, why not save a copy of the previous AVPacket directly?<br></div><div><br></div><div>Anyway, it would be great if you can share the context of your workflow to have a better perspective of the problem. Good luck!<br></div><div><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 25, 2022 at 2:26 AM Aleksei Komarov <<a href="mailto:abkomarov@gmail.com">abkomarov@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thanks, but the AVFrame is not encoded data. Maybe your idea was to copy the packet data?  Than I`ll have to increment dts/pts counters manually in this case... I don't know how...  </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">ср, 11 мая 2022 г. в 15:03, Gustav González <<a href="mailto:xtingray@gmail.com" target="_blank">xtingray@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Wed, May 11, 2022 at 6:24 AM Aleksei Komarov <<a href="mailto:abkomarov@gmail.com" target="_blank">abkomarov@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<div>I'm encoding VFR frame sequence to Constant Frame Rate output stream (in real-time)</div><div>E.g. to maintain 60 fps I have to DUPLICATE frames from 30 fps stream (or any VFR video streams).<br>To do this I`m copying the same frame binary data and feed it to avcodec_receive_packet() once again. (It works but is not optimal)<br>What is the proper way to tell the encoder that the new frame is the same as the last one besides timestamp data (PTS/DTS). In other words how to duplicate last frame in the stream without reencoding the frame again?<br></div><div>I've seen  this type of video ( generated by OBS ) where MANY frames were really duplicated, where pkt_size=48 or lower! <br></div></div></blockquote><div><br></div>I'm just shooting in the dark, but what if you don't focus on the AVFrame data but on saving a copy of the AVPacket of the previous frame after it is encoded? In that way, you could avoid calling the whole encoding process again. Just guessing.<br clear="all"></div><br><div dir="ltr"><div dir="ltr"><div>--<br>  Gustav Gonzalez<br>  <a href="mailto:xtingray@gmail.com" target="_blank">xtingray@gmail.com</a><br><br></div></div></div></div>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="https://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">https://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br>
To unsubscribe, visit link above, or email<br>
<a href="mailto:libav-user-request@ffmpeg.org" target="_blank">libav-user-request@ffmpeg.org</a> with subject "unsubscribe".<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr">С уважением Алексей Комаров.<br></div>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="https://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">https://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br>
To unsubscribe, visit link above, or email<br>
<a href="mailto:libav-user-request@ffmpeg.org" target="_blank">libav-user-request@ffmpeg.org</a> with subject "unsubscribe".<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>--<br>  Gustav Gonzalez<br>  <a href="mailto:xtingray@gmail.com" target="_blank">xtingray@gmail.com</a><br><br></div></div></div></div>