[FFmpeg-devel] [PATCH 04/14] avformat/flvenc: remove !size check for audio packets

Anton Khirnov anton at khirnov.net
Tue Dec 17 15:13:17 EET 2024


Quoting James Almer (2024-12-16 00:13:43)
> On 12/14/2024 5:49 PM, Timo Rothenpieler wrote:
> > On 14.12.2024 10:16, Anton Khirnov wrote:
> >> This could use some explanation.
> > 
> > I unfortunately don't remember the exact reason, but it ran into this 
> > check in normal operation, and empty audio packets are a perfectly valid 
> > thing to package.
> > I think Opus or something generates them?
> 
> The flac encoder generates a side data only packet as the very last 
> packet that muxers are meant to use to write initialization data in 
> place of the blank extradata generated during the encoder's init().
> 
> No idea if other encoders do the same, but afaik the only valid scenario 
> for pkt->size == 0 is if pkt->side_data_elems != 0.

That's the question - is it a side-data-only packet, or a truly empty
packet used as heartbeat?

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list