[Libav-user] H264 intra frame coding
Richard Hussong
rhussong at westpond.com
Thu Apr 29 07:14:38 EEST 2021
On Tue, Apr 27, 2021 at 4:19 PM laddoe <xyfix at hotmail.com> wrote:
> Hi there, thanks for responding but I do flush the codec in the "close()"
> function or is this not the correct place?
>
To flush the codec, after you call avcodec_send_frame with a NULL frame you
need to loop on avcodec_receive_packet until you get an AVERROR_EOF return.
That will return all the queued packets in the codec.
------------------------------
> *Van:* Libav-user <libav-user-bounces at ffmpeg.org> namens Richard Hussong <
> rhussong at westpond.com>
> *Verzonden:* dinsdag 27 april 2021 18:47
> *Aan:* This list is about using libavcodec, libavformat, libavutil,
> libavdevice and libavfilter. <libav-user at ffmpeg.org>
> *Onderwerp:* Re: [Libav-user] H264 intra frame coding
>
>
>
> On Sun, Apr 25, 2021 at 8:15 PM laddoe <xyfix at hotmail.com> wrote:
>
> Hello,
>
> I'm trying to use h264 with intra frame coding, but I can't seem to
> understand why my code isn't fully working. I can see that the first 13
> frames aren't written to the file while all the other frames are. I have
> 120 images that needs to be encoded of which the first one is very
> important because it's a registration image. I understand that the first
> few frames send to the encoder will be buffered and as soon as a frame is
> available it can be written, as I have done in my code. But how can I make
> sure that the buffered frames are written as well?
>
> I don't see why the first few frames aren't written, but it looks as
> though you aren't flushing the codec by sending a null frame at the end.
> This would cause the last few buffered frames not to be written. Not the
> same problem, but a problem nonetheless.
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/libav-user
>
> To unsubscribe, visit link above, or email
> libav-user-request at ffmpeg.org with subject "unsubscribe".
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/libav-user
>
> To unsubscribe, visit link above, or email
> libav-user-request at ffmpeg.org with subject "unsubscribe".
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20210429/a9e35d04/attachment.htm>
More information about the Libav-user
mailing list