Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I spent some time searching for a JS shim that enables AVIF files to be used in the browser, is anyone aware of one?


The official avif github [1] references Kagami/avif.js [2]. It's intended as a server-side component to be installed, and uses service workers to on-the-fly repack AVIF images as AV1 videos. The code is licensed CC0, and is easy to read, so you can tweak it to your needs.

If the browser can't natively decode AV1 videos, it calls dav1d.js [3] to decode, which is a webassembly port of dav1d [4].

[1] https://github.com/AOMediaCodec/av1-avif/wiki [2] https://github.com/Kagami/avif.js [3] https://github.com/Kagami/dav1d.js [4] https://code.videolan.org/videolan/dav1d




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: