Re: ffmpeg and webp

897 views
Skip to first unread message

Urvang Joshi

unread,
May 29, 2015, 6:44:28 PM5/29/15
to Erik Murphy-Chutorian, webp-d...@webmproject.org
+webp-discuss
FYI

On Fri, May 29, 2015 at 3:10 PM Urvang Joshi <urv...@google.com> wrote:
Hi Erik,

On Fri, May 29, 2015 at 1:27 PM Erik Murphy-Chutorian <erik...@gmail.com> wrote:
Hi Urvang,

I was chatting with Pascal earlier and he mentioned you were the person to ask about ffmpeg and WebP. Would you happen to know the state of the following two features?
  - Demuxing directly from an animated WebP
 
I have only briefly looked at the WebP demuxing part in ffmpeg, so not sure if there are any issues.

What I would suggest is to try it on your set of animated images. If you find any issues, file a bug (http://ffmpeg.org/bugreports.html) and let me know.

One good way to verity the conversions is to use the anim_diff tool. it's there in libwebp master branch: https://chromium.googlesource.com/webm/libwebp/+/master/examples/anim_diff.cc
 
  - Muxing an animated WebP from a transparent source without canvas issues (i.e. older frames bleeding into the newer frames)

I recently sent a patch to ffmpeg:
02cf59f WebP encoder: use WebPAnimEncoder API when available.

After the patch: 
(1) if you build and install latest libwebp from source (https://chromium.googlesource.com/webm/libwebp/+/master) and then build & install the latest ffmpeg from source, the code will do both encoding and muxing using libwebp libraries, and there will be no bleeding issues.

(2) However, if you use older libwebp (and/or older ffmpeg), a bug in ffmpeg's own muxer would result in bleeding issues for transparent source images. I'm working on a fix for this, but it's a bit involved.
 

I'm curious if in the near future ffmpeg could be used for all GIF<-->WEBP needs.

Yes, that would be great. As I said, feel fee to use the anim_diff tool to see if you find any issues.
 

Best,
Erik

Erik Murphy-Chutorian

unread,
May 31, 2015, 9:04:29 AM5/31/15
to Urvang Joshi, webp-d...@webmproject.org
Thanks for the quick reply.  I just rebased to the latest libwebp and ffmpeg and built both from source and confirm the bleeding issues for transparent source images is resolved when encoding to animated WebP. 

I still am unable  to decode from an animated WebP though, which was the other issue.  Am I correct in that there isn't support yet decoding a multi-frame WebP in ffmpeg?  I'm able to decode a set of single-frame images, but a single animated WebP gives the following error on decode:

[webp @ 0x7fe2da80f000] image data not found
[webp_pipe @ 0x7fe2da80d400] decoding for stream 0 failed
[webp_pipe @ 0x7fe2da80d400] Could not find codec parameters for stream 0 (Video: webp, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
test.webp: could not find codec parameters

Would you happen to know if anyone is thinking of adding support for this?

Urvang Joshi

unread,
Jun 8, 2015, 1:02:49 PM6/8/15
to Erik Murphy-Chutorian, webp-d...@webmproject.org
On Sat, May 30, 2015 at 4:22 PM Erik Murphy-Chutorian <erik...@gmail.com> wrote:
Thanks for the quick reply.  I just rebased to the latest libwebp and ffmpeg and built both from source and confirm the bleeding issues for transparent source images is resolved when encoding to animated WebP. 

I still am unable  to decode from an animated WebP though, which was the other issue.  Am I correct in that there isn't support yet decoding a multi-frame WebP in ffmpeg?  I'm able to decode a set of single-frame images, but a single animated WebP gives the following error on decode:

[webp @ 0x7fe2da80f000] image data not found
[webp_pipe @ 0x7fe2da80d400] decoding for stream 0 failed
[webp_pipe @ 0x7fe2da80d400] Could not find codec parameters for stream 0 (Video: webp, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
test.webp: could not find codec parameters

You are right. Looking at the code: http://ffmpeg.org/doxygen/trunk/webp_8c_source.html#l01503, ANMF, ANIM etc chunks are just skipped right now. So animated WebP can't be decoded in ffmpeg.
 

Would you happen to know if anyone is thinking of adding support for this?

Not sure. You could ask on ffmpeg mailing list: https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Reply all
Reply to author
Forward
0 new messages