Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Dai, Jianhui J" <jianhui.j.dai-at-intel.com@ffmpeg.org>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v3] avformat/ivfenc: Set the "number of frames" in IVF header
Date: Fri, 30 Jun 2023 00:30:44 +0000
Message-ID: <DM6PR11MB2681849B76D6D53FF06DEE40B12AA@DM6PR11MB2681.namprd11.prod.outlook.com> (raw)
In-Reply-To: <CAEEMt2mNrBEwgvzgVuNqdvi9FyxvWDxmtQzVwo=VNLnyrEju4g@mail.gmail.com>



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> Ronald S. Bultje
> Sent: Friday, June 30, 2023 1:27 AM
> To: FFmpeg development discussions and patches <ffmpeg-
> devel@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH v3] avformat/ivfenc: Set the "number of
> frames" in IVF header
> 
> Hi,
> 
> On Thu, Jun 29, 2023 at 8:54 AM Dai, Jianhui J < jianhui.j.dai-at-
> intel.com@ffmpeg.org> wrote:
> 
> > Should set "number of frames" to bytes 24-27 of IVF header, not
> > duration.
> > It is described by [1], and confirmed by parsing all IVF files in [2].
> >
> > This commit also updates the md5sum of refs to pass fate-cbs.
> >
> > [1] Duck IVF - MultimediaWiki
> > https://wiki.multimedia.cx/index.php/Duck_IVF
> >
> > [2] webm/vp8-test-vectors
> > https://chromium.googlesource.com/webm/vp8-test-vectors
> >
> > Signed-off-by: Jianhui Dai <jianhui.j.dai@intel.com>
> > ---
> >  libavformat/ivfdec.c                                |  6 +++---
> >  libavformat/ivfenc.c                                | 13 +++++--------
> >  tests/ref/fate/cbs-vp9-vp90-2-03-deltaq             |  2 +-
> >  tests/ref/fate/cbs-vp9-vp90-2-06-bilinear           |  2 +-
> >  tests/ref/fate/cbs-vp9-vp90-2-09-lf_deltas          |  2 +-
> >  .../ref/fate/cbs-vp9-vp90-2-10-show-existing-frame  |  2 +-
> >  .../ref/fate/cbs-vp9-vp90-2-10-show-existing-frame2 |  2 +-
> > tests/ref/fate/cbs-vp9-vp90-2-segmentation-aq-akiyo |  2 +-
> > tests/ref/fate/cbs-vp9-vp90-2-segmentation-sf-akiyo |  2 +-
> >  tests/ref/fate/cbs-vp9-vp90-2-tiling-pedestrian     |  2 +-
> >  tests/ref/fate/cbs-vp9-vp91-2-04-yuv440             |  2 +-
> >  tests/ref/fate/cbs-vp9-vp91-2-04-yuv444             |  2 +-
> >  tests/ref/fate/cbs-vp9-vp92-2-20-10bit-yuv420       |  2 +-
> >  tests/ref/fate/cbs-vp9-vp93-2-20-10bit-yuv422       |  2 +-
> >  tests/ref/fate/cbs-vp9-vp93-2-20-12bit-yuv444       |  2 +-
> >  15 files changed, 21 insertions(+), 24 deletions(-)
> >
> > diff --git a/libavformat/ivfdec.c b/libavformat/ivfdec.c index
> > 511f2387ed..c71a28e0d3 100644
> > --- a/libavformat/ivfdec.c
> > +++ b/libavformat/ivfdec.c
> > @@ -51,9 +51,9 @@ static int read_header(AVFormatContext *s)
> >      st->codecpar->codec_id   = ff_codec_get_id(ff_codec_bmp_tags,
> > st->codecpar->codec_tag);
> >      st->codecpar->width      = avio_rl16(s->pb);
> >      st->codecpar->height     = avio_rl16(s->pb);
> > -    time_base.den         = avio_rl32(s->pb);
> > -    time_base.num         = avio_rl32(s->pb);
> > -    st->duration          = avio_rl32(s->pb);
> > +    time_base.den            = avio_rl32(s->pb);
> > +    time_base.num            = avio_rl32(s->pb);
> > +    st->nb_frames            = avio_rl32(s->pb);
> >      avio_skip(s->pb, 4); // unused
> >
> >      ffstream(st)->need_parsing = AVSTREAM_PARSE_HEADERS;
> >
> 
> Is the removal of the st->duration assignment necessary? Applications using
> this field will now see a regression.

Thanks.
It's good for me to set both st->nb_frames and st->duration.
The accuracy of `duration` cannot be guaranteed. 
Luckily, the duration is often correct, because it is popular configure that time_base.den/time_base.num == fps.

> 
> Ronald
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org
> with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

      reply	other threads:[~2023-06-30  0:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-29 12:54 Dai, Jianhui J
2023-06-29 17:27 ` Ronald S. Bultje
2023-06-30  0:30   ` Dai, Jianhui J [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM6PR11MB2681849B76D6D53FF06DEE40B12AA@DM6PR11MB2681.namprd11.prod.outlook.com \
    --to=jianhui.j.dai-at-intel.com@ffmpeg.org \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git