Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: James Zern <jzern-at-google.com@ffmpeg.org>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v2 5/5] libavformat/webp: add WebP demuxer
Date: Tue, 11 Jul 2023 18:22:50 -0700
Message-ID: <CABWgkX+tKEUfATdGGfEB2B3FbOERi1imY0rQFRL5F8u41n6OhQ@mail.gmail.com> (raw)
In-Reply-To: <20230706112731.35895-6-thilo.borgmann@mail.de>

On Thu, Jul 6, 2023 at 4:28 AM Thilo Borgmann <thilo.borgmann@mail.de> wrote:
>
> From: Josef Zlomek <josef@pex.com>
>
> Adds the demuxer of animated WebP files.
> It supports non-animated, animated, truncated, and concatenated files.
> Reading from a pipe (and other non-seekable inputs) is also supported.
>
> The WebP demuxer splits the input stream into packets containing one frame.
> It also marks the key frames properly.
> The loop count is ignored by default (same behaviour as animated PNG and GIF),
> it may be enabled by the option '-ignore_loop 0'.
>
> The frame rate is set according to the frame delay in the ANMF chunk.
> If the delay is too low, or the image is not animated, the default frame rate
> is set to 10 fps, similarly to other WebP libraries and browsers.
> The fate suite was updated accordingly.
>
> Signed-off-by: Josef Zlomek <josef@pex.com>
> ---
>  Changelog                                   |   1 +
>  doc/demuxers.texi                           |  28 +
>  libavformat/Makefile                        |   1 +
>  libavformat/allformats.c                    |   1 +
>  libavformat/version.h                       |   2 +-
>  libavformat/webpdec.c                       | 733 ++++++++++++++++++++
>  tests/ref/fate/webp-rgb-lena-lossless       |   2 +-
>  tests/ref/fate/webp-rgb-lena-lossless-rgb24 |   2 +-
>  tests/ref/fate/webp-rgb-lossless            |   2 +-
>  tests/ref/fate/webp-rgb-lossy-q80           |   2 +-
>  tests/ref/fate/webp-rgba-lossless           |   2 +-
>  tests/ref/fate/webp-rgba-lossy-q80          |   2 +-
>  12 files changed, 771 insertions(+), 7 deletions(-)
>  create mode 100644 libavformat/webpdec.c
>
> [...]
> +        switch (chunk_type) {
> +        case MKTAG('R', 'I', 'F', 'F'):
> +            if (avio_tell(pb) != wdc->file_start + 8) {
> +                // premature RIFF found, shorten the file size
> +                WebPHeaders *tmp = webp_headers_lower_or_equal(wdc->webp_headers,
> +                                                               wdc->num_webp_headers,
> +                                                               avio_tell(pb));
> +                tmp->webp_size -= wdc->remaining_size;
> +                wdc->remaining_size = 0;
[...]
> +
> +    if (wdc->remaining_size > 0 && avio_feof(pb)) {
> +        // premature EOF, shorten the file size

I'm not sure about this. If the file is truncated shouldn't this be
treated as an error?
_______________________________________________
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".

  parent reply	other threads:[~2023-07-12  1:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-06 11:27 [FFmpeg-devel] [PATCH v2 0/5] webp: add support for animated WebP decoding Thilo Borgmann
2023-07-06 11:27 ` [FFmpeg-devel] [PATCH v2 1/5] avcodec/webp: move definitions into header Thilo Borgmann
2023-07-11 22:19   ` James Zern
2023-07-06 11:27 ` [FFmpeg-devel] [PATCH v2 2/5] avcodec/webp_parser: parse each frame into one packet Thilo Borgmann
2023-07-11 22:36   ` James Zern
2023-07-06 11:27 ` [FFmpeg-devel] [PATCH v2 3/5] libavcodec/webp: add support for animated WebP decoding Thilo Borgmann
2023-07-12  0:20   ` James Zern
2023-07-20 23:07     ` Thilo Borgmann
2023-07-06 11:27 ` [FFmpeg-devel] [PATCH v2 4/5] avcodec/webp: make init_canvas_frame static Thilo Borgmann
2023-07-12  0:20   ` James Zern
2023-07-06 11:27 ` [FFmpeg-devel] [PATCH v2 5/5] libavformat/webp: add WebP demuxer Thilo Borgmann
2023-07-06 20:24   ` James Zern
2023-07-06 21:08     ` Thilo Borgmann
2023-07-12  1:22   ` James Zern [this message]
2023-07-20 23:07     ` Thilo Borgmann

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=CABWgkX+tKEUfATdGGfEB2B3FbOERi1imY0rQFRL5F8u41n6OhQ@mail.gmail.com \
    --to=jzern-at-google.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