[FFmpeg-devel] Flush muxer in av_interleaved_write_frame

Alex ThreeD alexthreed at gmail.com
Fri Oct 22 15:01:07 EEST 2021

Oh, there is a problem with return codes.

 * @return 0 on success, a negative AVERROR on error.

 * @return < 0 on error, = 0 if OK, 1 if flushed and there is no more data
to flush

I could:
- add "1" to the list of possible return codes of
av_interleaved_write_frame (not sure whether it should be considered as
API breaking change)
- do not change the return codes list but lose "there is more data to
flush" information (bad)
- reconsider patch: do not change any code but allow
av_interleaved_write_frame/av_write_frame(s, NULL) mixing in documentation.

Any thoughts?

On Fri, Oct 22, 2021 at 1:32 PM Alex ThreeD <alexthreed at gmail.com> wrote:

> Hi.
> Currently, there is no legitimate way to flush data buffered within the
> muxer for applications that choose to use av_interleaved_write_frame.
> Actually one could flush muxer buffers with av_write_frame, but docs
> forbid mixing av_interleaved_write_frame/av_write_frame within a single
> muxing context.
> Either docs should explicitly allow mixing av_write_frame(s, NULL) with
> av_interleaved_write_frame or av_interleaved_write_frame should flush not
> only interleaving queues but muxer too (I prefer the latter as it looks
> more expected, will send patch shortly)

More information about the ffmpeg-devel mailing list