[FFmpeg-devel] [PATCH 2/2] libavformat: add WebP demuxer

Zlomek, Josef josef at pex.com
Thu Jul 9 12:24:20 EEST 2020


On Wed, Jul 8, 2020 at 10:34 PM Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:

> Am Mi., 8. Juli 2020 um 07:28 Uhr schrieb Josef Zlomek <josef at pex.com>:
> >
> > Fixes: 4907
>
> It seems surprising that two commits should fix a ticket.
>

My understanding of ffmpeg internals is limited:
The parser is used for input from a pipe, the demuxer is used for input
from a file or other seekable streams.
I did not find out how parsers can set frame rate and time base of the
input stream so the playback speed is not correct.
The demuxer sets the frame rate and time base based on the information in
the input file. It also supports looping the input file.

> Adds support for demuxing of animated WebP.

>
> Does this demuxer also support single frame files?
> What about concatenated webps?
>

Non-animated/single frame files are still supported.
Concatenated files are also supported.

> +static int webp_probe(const AVProbeData *p)
> > +{
> > +    const uint8_t *b = p->buf;
> > +
> > +    if (p->filename && ff_guess_image2_codec(p->filename)) {
>
> Why is this useful?
>

This is a not very nice way to check that the input is from a file, and not
from a pipe.
Probably it will not be needed if demuxer uses ffio_ensure_seekback() as
you suggested below.

> +    frame_end = avio_tell(pb);
> > +
> > +    if (avio_seek(pb, frame_start, SEEK_SET) != frame_start)
> > +        return AVERROR(EIO);
>
> Instead I believe you should use ffio_ensure_seekback() or do
>
I miss something?
>

I guess this will help to use the demuxer also for input from a pipe, right?
Then probably we could get rid of the parser and keep only the demuxer.

Josef


More information about the ffmpeg-devel mailing list