ffmpeg icon indicating copy to clipboard operation
ffmpeg copied to clipboard

cwebp has no png support

Open dano0b opened this issue 5 years ago • 8 comments

https://github.com/jrottenberg/ffmpeg/commit/250a2c8d238ac6a3d4fb4c8becad15592658f8ed added webp support but libpng-dev is not available during build which broke it for my case.

Error! Cannot read input picture file 'images-src/author3.png'
PNG support not compiled. Please install the libpng development package before building.

In our case I used the jrottenberg/ffmpeg:4.1-alpine image for image converting (besides the video one) but now it broke for me since it gets precedence over the one I installed via apk add libwebp-tools. The system packages has most common format support.

I will post a workaround but I suggest improving the webp part, multi stage build might be an option to avoid bloating the image with build dependencies.

dano0b avatar Jul 09 '19 01:07 dano0b

My work around for now is just using the absolute path to the os package cwebp /usr/bin/cwebp instead of the self compiled /usr/local/bin/cwebp

dano0b avatar Jul 09 '19 01:07 dano0b

That makes sense, to use the system package for now and be explicit on the binary , not relying on PATH.

Curious to know what we are missing on the cwebp binary But I can imagine we can tune it a bit ;-)

https://github.com/jrottenberg/ffmpeg/blob/master/templates/Dockerfile-run#L104

jrottenberg avatar Jul 10 '19 04:07 jrottenberg

@jrottenberg actually the message is quite clear about what is missing. ./configure should find available development libraries as soon they are installed. If using OS packages it would be libpng-dev etc. it bloats the image and the package names might be OS/package manager specific. Another option is to download the sources for libpng etc additionally and pass the paths to ./configure.

dano0b avatar Jul 10 '19 06:07 dano0b

No no I get it but if it's missing png support we could miss other , so better get a list of flags to pass to the configure while we are at it.

https://git.alpinelinux.org/aports/tree/main/libwebp/APKBUILD?id=0e776a422ea9019bcbcb054cf5745e5e3010fab4#n21 https://developers.google.com/speed/webp/docs/compiling#compiling_on_unix-like_platforms are a good start

jrottenberg avatar Jul 11 '19 06:07 jrottenberg

That are good sources, would love to see it inside the image by default :) Saves one step in my pipeline

dano0b avatar Jul 11 '19 06:07 dano0b

https://github.com/jrottenberg/ffmpeg#contribute

I would love to add you as contributor

jrottenberg avatar Jul 11 '19 17:07 jrottenberg

@jrottenberg hope to find some time soon

dano0b avatar Jul 12 '19 01:07 dano0b

Sorry, for not following up :/ After I faced issues building the images via the instructions from the README.md, I lost the motivation since I have a working work-around. (I think with some theora related stuff)

dano0b avatar Aug 22 '19 04:08 dano0b