<div dir="ltr"><div dir="ltr">Thank you Strahinja. Yeah I probably could do something like that. Would have to be extremely careful to get precisely the right byte, even when we have audio in there too. Seems a little fragile but might be something to it.<div> <div><div>At the moment, playing around with an idea that involves using AVIOContext to create a custom write_packet function that allows me to spy on the process of writing the frame(s) to the file. In this way, I believe I can write to the file and flush it every frame and at the same time I can grab the file pointer upon writing. Also not sure about multiple streams and what will popup but think I can make it work.</div></div></div><div><br></div><div>Seems like someone who knows what they are doing and codes for ffmpeg really should alter the pos member of AVPacket after it's written out as well as read in for anyone else encountering this issue though. I'm sure I'm not the only one who would like to do something like this.</div></div><div><br></div><div>-Matt</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 29, 2020 at 1:58 AM Strahinja Radman <<a href="mailto:dr.strashni@gmail.com">dr.strashni@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"><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"><br>
I've tried looking for callbacks, looking at the packet itself, looking at<br>
the AVFormatContext, AVIO, AVStream, etc. And I can't find a way to do it.<br>
Would be really nice if av_write_frame would set the new pos after writing<br>
the packet to the file.<br></blockquote></div><div><br></div><div>I am guessing that FLV container has a known header size. Maybe you can use</div><div>size value of a AVPacket + header + all the AVPackets before and based on that </div><div>calculate what your offset for that IDR packet is? Just an idea, not sure if it will work.</div><div><br></div>-- <br><div dir="ltr"><br>Regards<br>Strahinja Radman</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".</blockquote></div><br></div>