Closed prof-m closed 10 months ago
Interestingly, I tried also using Pillow's WebPImagePlugin, only to find that it gave me the same error, and was just using this library under the hood
To my knowledge, Pillow actually has its own bindings for webp (it does not use my bindings). Therefore if you found the same issue from both then it points to an issue with your environment or perhaps the files themselves. Unfortunately I can't really help much further.
Context
I recently started trying to use the pywebp library to help with a Python script I'm making to convert animated webps to either gifs or mp4s. My first step in converting animated webps into mp4s is to extract the individual frames from the webp file.
Platform: Windows 11 64-bit Python version: 3.11 Using poetry for dependency management
Issue
Following the code example from the README.md, I have the following code for extracting the frames from the animated webp.
On the third line, where I try to make the decoder, the following WebPError occurs:
WebPError: failed to create decoder
The stacktrace points to this line of code being where the error gets thrown from within the library:
I tried to dig deeper to see if I could figure out why
ptr
is null, but at that point it looked like I was getting into the compiled C++ code and couldn't really explore further.I've reproduced the error with a couple of different animated webp files now, just to make sure the issue wasn't with the file itself. Interestingly, I tried also using Pillow's
WebPImagePlugin
, only to find that it gave me the same error, and was just using this library under the hood 😅I think this is likely an issue with my installation of pywebp/local setup, rather than an issue with the library, but any advice would be appreciated!