{"id":13705558,"url":"https://github.com/AOMediaCodec/libavif","last_synced_at":"2025-05-05T16:33:30.802Z","repository":{"id":37502385,"uuid":"191218735","full_name":"AOMediaCodec/libavif","owner":"AOMediaCodec","description":"libavif - Library for encoding and decoding .avif files","archived":false,"fork":false,"pushed_at":"2025-05-01T07:34:31.000Z","size":24597,"stargazers_count":1741,"open_issues_count":143,"forks_count":230,"subscribers_count":33,"default_branch":"main","last_synced_at":"2025-05-01T08:29:56.449Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AOMediaCodec.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-06-10T17:54:32.000Z","updated_at":"2025-05-01T07:34:28.000Z","dependencies_parsed_at":"2023-10-02T08:00:35.762Z","dependency_job_id":"56702921-c0d0-4ef2-a340-e72c87ffff15","html_url":"https://github.com/AOMediaCodec/libavif","commit_stats":{"total_commits":1597,"total_committers":61,"mean_commits":26.18032786885246,"dds":0.6167814652473387,"last_synced_commit":"50dcfbcb65cf443a5459d55a811494e5f2374ab9"},"previous_names":[],"tags_count":71,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AOMediaCodec%2Flibavif","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AOMediaCodec%2Flibavif/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AOMediaCodec%2Flibavif/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AOMediaCodec%2Flibavif/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AOMediaCodec","download_url":"https://codeload.github.com/AOMediaCodec/libavif/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252534105,"owners_count":21763720,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T22:00:43.607Z","updated_at":"2025-05-05T16:33:30.795Z","avatar_url":"https://github.com/AOMediaCodec.png","language":"C","readme":"# libavif\n\nThis library aims to be a friendly, portable C implementation of the AV1 Image\nFile Format, as described here:\n\n\u003chttps://aomediacodec.github.io/av1-avif/\u003e\n\nIt can encode and decode all AV1 supported YUV formats and bit depths (with\nalpha). In addition to the library, encoder and decoder command line tools are\nalso provided (`avifenc` and `avifdec`).\n\nIt is recommended that you check out/use\n[tagged releases](https://github.com/AOMediaCodec/libavif/releases) instead of\njust using the main branch. We will regularly create new versions as bug fixes\nand features are added.\n\n## Command line tool usage\n\n```sh\navifenc -q 75 input.[jpg|png|y4m] output.avif\navifdec output.avif decoded.png\n```\n\nSee `avifenc --help` for all options.\n\n## API usage\n\nPlease see the examples in the \"examples\" directory. If you're already building\n`libavif`, enable the CMake option `AVIF_BUILD_EXAMPLES` in order to build and\nrun the examples too.\n\n## Installation\n\n`libavif` is a package in most major OSs.\n\n### Windows\n\n```sh\nvcpkg install libavif\n```\nYou can also download the official windows binaries on the\n[release](https://github.com/AOMediaCodec/libavif/releases) page.\n\n### macOS\n\nHomebrew:\n```sh\nbrew install libavif\n```\nMacPorts:\n```sh\nsudo port install libavif\n```\n\n### Linux\n\nDebian-based distributions:\n```sh\nsudo apt install libavif-dev\n```\nRed Hat-based distributions:\n```sh\nsudo yum -y install libavif\n```\n\n### MinGW\n\nFor the \"default\" MSYS2 UCRT64 environment:\n```sh\npacman -S mingw-w64-ucrt-x86_64-libavif\n```\n\n## Build Notes\n\nBuilding libavif requires [CMake](https://cmake.org/).\nSee [Build Command Lines](#build-command-lines) below for example command lines.\n\n### Controlling Dependencies\n\nCMake flags like `AVIF_CODEC_AOM`, `AVIF_LIBYUV`, etc. allow enabling or\ndisabling dependencies. They can take three possible values:\n* `OFF`: the dependency is disabled.\n* `SYSTEM`: the dependency is expected to be installed on the system.\n* `LOCAL`: the dependency is built locally. In most cases, CMake can\n  automatically download and build it. For some dependencies, you need to run the\n  associated script in the `ext/` subdirectory yourself. In cases where\n  CMake handles downloading the dependency, you can still call the script in\n  `ext/` if you want to use a different version of the dependency (e.g. by\n  modifying the script) or make custom code changes to it.\n  If a directory with the dependency exists in the `ext/` directory, CMake will\n  use it instead of downloading a new copy.\n\n### Codec Dependencies\n\nNo AV1 codecs are enabled by default. You should enable at least one of them by\nsetting any of the following CMake options to `LOCAL` or `SYSTEM`, depending on\nwhether you want to use a locally built or a system installed version\n(e.g. `-DAVIF_CODEC_AOM=LOCAL`):\n\n* `AVIF_CODEC_AOM` for [libaom](https://aomedia.googlesource.com/aom/) (encoder\n  and decoder)\n* `AVIF_CODEC_DAV1D` for [dav1d](https://code.videolan.org/videolan/dav1d)\n  (decoder)\n* `AVIF_CODEC_LIBGAV1` for\n  [libgav1](https://chromium.googlesource.com/codecs/libgav1/) (decoder)\n* `AVIF_CODEC_RAV1E` for [rav1e](https://github.com/xiph/rav1e) (encoder)\n* `AVIF_CODEC_SVT` for [SVT-AV1](https://gitlab.com/AOMediaCodec/SVT-AV1)\n  (encoder)\n\nWhen set to `SYSTEM`, these libraries (in their C API form) must be externally\navailable (discoverable via CMake's `FIND_LIBRARY`) to use them, or if libavif\nis a child CMake project, the appropriate CMake target must already exist\nby the time libavif's CMake scripts are executed.\n\n### Libyuv Dependency\n\nLibyuv is an optional but strongly recommended dependency that speeds up\ncolor space conversions. It's enabled by default with a value of `SYSTEM`,\nso it's expected to be installed on the system. It can either be built\nlocally instead by using `-DAVIF_LIBYUV=LOCAL` or disabled with\n`-DAVIF_LIBYUV=OFF`.\n\n### Tests\n\nA few tests written in C can be built by enabling the `AVIF_BUILD_TESTS` CMake\noption.\n\nThe remaining tests require [GoogleTest](https://github.com/google/googletest),\nand can be built by enabling `AVIF_BUILD_TESTS` and setting `AVIF_GTEST` to\n`SYSTEM` or `LOCAL`.\n\nAdditionally, fuzzing tests require [fuzztest](https://github.com/google/fuzztest),\nsee also fuzzing test instructions in `ext/oss-fuzz/README.md`.\n\nCode coverage is available by enabling `AVIF_ENABLE_COVERAGE` then building\nthe `avif_coverage` target, e.g. `make avif_coverage -j`. It requires\ncompiling with clang (`-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++`)\nand LLVM must be installed on the system.\n\n### Build Command Lines\n\nThe following instructions can be used to build the libavif library and the\n`avifenc` and `avifdec` tools.\n\n#### Build using installed dependencies\n\nTo link against the already installed `aom`, `libjpeg`, `libpng` and `libyuv` dependency\nlibraries (recommended):\n\n```sh\ngit clone -b v1.2.1 https://github.com/AOMediaCodec/libavif.git\ncmake -S libavif -B libavif/build -DAVIF_CODEC_AOM=SYSTEM -DAVIF_BUILD_APPS=ON\ncmake --build libavif/build --config Release --parallel\n```\n\n#### Build everything from scratch\n\nFor development and debugging purposes:\n\n```sh\ngit clone -b v1.2.1 https://github.com/AOMediaCodec/libavif.git\ncmake -S libavif -B libavif/build -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF -DAVIF_CODEC_AOM=LOCAL -DAVIF_LIBYUV=LOCAL -DAVIF_LIBSHARPYUV=LOCAL -DAVIF_JPEG=LOCAL -DAVIF_ZLIBPNG=LOCAL -DAVIF_BUILD_APPS=ON\ncmake --build libavif/build --config Debug --parallel\n```\n\n## Prebuilt Binaries (Windows)\n\nStatically-linked `avifenc.exe` and `avifdec.exe` can be downloaded from the\n[Releases](https://github.com/AOMediaCodec/libavif/releases) page.\n\n## Development Notes\n\nPlease check the [wiki](https://github.com/AOMediaCodec/libavif/wiki) for extra\nresources on libavif, such as the Release Checklist.\n\nThe libavif library is written in C99. Most of the tests are written in C++14.\n\n### Formatting\n\nUse [clang-format](https://clang.llvm.org/docs/ClangFormat.html) to format the\nsources from the top-level folder (`clang-format-16` preferred):\n\n```sh\nclang-format -style=file -i \\\n  apps/*.c apps/*/*.c apps/*/*.cc apps/*/*.h examples/*.c \\\n  include/avif/*.h src/*.c src/*.cc \\\n  tests/*.c tests/*/*.cc tests/*/*.h\n```\n\nUse [cmake-format](https://github.com/cheshirekow/cmake_format) to format the\nCMakeLists.txt files from the top-level folder:\n\n```sh\ncmake-format -i \\\n  CMakeLists.txt \\\n  tests/CMakeLists.txt \\\n  cmake/Modules/*.cmake \\\n  contrib/CMakeLists.txt \\\n  contrib/gdk-pixbuf/CMakeLists.txt \\\n  android_jni/avifandroidjni/src/main/jni/CMakeLists.txt\n```\n\n---\n\n## License\n\nReleased under the BSD License.\n\n```markdown\nCopyright 2019 Joe Drago. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\nlist of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\nthis list of conditions and the following disclaimer in the documentation\nand/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n```\n","funding_links":[],"categories":["Image Processing","C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAOMediaCodec%2Flibavif","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAOMediaCodec%2Flibavif","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAOMediaCodec%2Flibavif/lists"}