strukturag / libheif

libheif is an HEIF and AVIF file format decoder and encoder.
Other
1.76k stars 302 forks source link

Online demo can't decode my AVIF sample file #296

Open derekm opened 4 years ago

derekm commented 4 years ago

I have a sample AVIF file of page 1 of the U.S. Constitution stored on the Bitcoin blockchain here:

https://bico.media/4c97b18d3f157b593045fe1525f5fdc608bc207e4729964855604ad40dc77e0f

The file is viewable with avif.js:

https://kagami.github.io/avif.js/?src=https://bico.media/4c97b18d3f157b593045fe1525f5fdc608bc207e4729964855604ad40dc77e0f

It would be nice if libheif could also render the same file.

PS: A query param to accept a file location for your web-based image viewer would also be a cool addition.

farindk commented 4 years ago

Hi, I just tried it. The file decodes nicely with heif-convert. I tried the current version from the master branch and v1.7.0. Both worked fine. Which version and what command did you use?

derekm commented 4 years ago

I tried to open it here: https://strukturag.github.io/libheif/

farindk commented 4 years ago

Yes, the JS version is currently limited to HEIF files only. For AVIF, we would have to compile the aom library to JS too. The other webpage you're referring to uses dav1d as decoding library, that might be another option if aom is too slow in JS.

Not sure if the JS decoder is needed, though, as the next Chrome (85) is going to support AVIF natively and the other browsers might follow soon. Firefox beta also has experimental support (77).

derekm commented 4 years ago

Ah ok! Broader adoption is good news! I noticed my mobile devices recently started being able to play AV1 films I've uploaded to Bitcoin! ;)

If this issue is out-of-scope, feel free to close it. Thanks!

jonsneyers commented 4 years ago

When I try it with the current version of libheif from the master branch and with the default libaom 1.0.0 from my Ubuntu distribution, all AVIF images including this one decode to a green mess, suggesting there is something wrong with the color channels or conversion.

jlarmstrongiv commented 3 years ago

Another alternative to convert AVIF files both in the browser and node: