[FFmpeg-devel] [PATCH v2] avformat/ivfenc: Set the "number of frames" in IVF header
Ronald S. Bultje
rsbultje at gmail.com
Sun Jul 2 17:41:39 EEST 2023
Hi,
On Sun, Jul 2, 2023 at 8:59 AM Anton Khirnov <anton at khirnov.net> wrote:
> Quoting Ronald S. Bultje (2023-07-02 14:44:42)
> > Hi,
> >
> > On Sun, Jul 2, 2023 at 5:35 AM Anton Khirnov <anton at khirnov.net> wrote:
> >
> > > Quoting Ronald S. Bultje (2023-07-02 02:03:11)
> > > > I see this discussion now...
> > > >
> > > > I don't think I agree with the above. First of all, IVF has two
> fields
> > > > there (it seems): duration, and n_frames.
> > >
> > > Got any source for that? I only see one field in
> > > https://wiki.multimedia.cx/index.php/Duck_IVF
> > >
> >
> > This somewhat-widely used tool called "ffmpeg" has used it like that for
> > the past, say, 10 years. I've heard some projects or companies around the
> > world use this tool, and backwards compatibility is supposedly a thing.
>
> Yeah yeah very funny.
>
> You claimed there are two fields. My question was where is this second
> field supposed to be.
>
I'm not joking. It's literally introduced by ffmpeg. If you look at the
originators of the ivf format, they write a 32bit field at header_offset+24
called nb_frames, and an "unused" entry at header_offset+28. FFmpeg adds
nothing at header_offset+24 and duration at header_offset+28. We
essentially added that field, in the same way that we extended the y4m
format, or support unofficial B-frames in AVI etc.
You may not like it, neither do I, but these files exist, and I don't think
we should break them.
Ronald
More information about the ffmpeg-devel
mailing list