link-u / cavif Goto Github PK
View Code? Open in Web Editor NEWavif encoder, using libaom directly.
License: MIT License
avif encoder, using libaom directly.
License: MIT License
Please download our sample images.
Then, encode a file with alpha plane:
cavif -i ../avif-sample-images/plum-blossom-small.png -o alpha.avif --encode-target alpha --profile 0 --bit-depth 8 --pix-fmt yuv420 --cpu-used 0 --lossless --monochrome
cavif -i ../avif-sample-images/plum-blossom-small.png -o plum-blossom.avif --tune psnr --encode-target image --attach-alpha alpha.avif --profile 0 --bit-depth 8 --pix-fmt yuv420 --cpu-used 0 --rate-control q --crf 18
Something like:
Can you see checkerboard pattern on the plum blossom?
cavif は 私がテストした時点のもの では --matrix-coeffcients に bt2020 が指定できませんでした。致命的という程ではないですがあまり望ましくはないかと思います。
エゴサもたまには大事なんですね
1.zip
This is what i got with
cavif -i 2.png --cpu-used 0 --enable-cdef --crf 10 --threads 4 --rate-control q --enable-full-color-range -o 1.avif
This is the output text i got.
[2020/07/03 18:54:37 INFO ] cavif
[2020/07/03 18:54:37 INFO ] libaom ver: 1.0.0-errata1-avif-414-g0cfdca944
[2020/07/03 18:54:38 INFO ] Encoding: 2.png -> 1.avif
[2020/07/03 18:54:56 INFO ] Encoded: 2.png -> 1.avif in 17.99 [sec]
Any ideas?
Cavif is probably the most balanced CLI tool, i really hope to get this settled.
Hi There
is there jpeg Support for the Input image?
このコマンドを打ったところ
cavif -i /mnt/c/linux_home/avif-test/png/1.png -o /mnt/c/linux_home/avif-test/avif/1-000.avif --crf 55
[2020/01/26 21:16:44 FATAL] failed to encode a frame: Image size must match encoder init configuration size
こう怒られてしまうのですが、どうやって初期化すればよろしいでしょうか?
現在は多分BT.2020で変換していると思うのですがBT.601やBT.709でも変換できるようにしてほしいです
日本語のドキュメントは
--delta-q [none, objective, perceptual]
になっているが、英語版が正しく、none→offですね。
ただし、
--adaptive-quantization
はnoneなので、実装をこちらに合わせるも良きかなと思います。
Blocked by https://bugs.chromium.org/p/aomedia/issues/detail?id=2913
libaom reports assertion error in yuv422:
cavif --enable-full-color-range -i hato.png -o hato.profile2.8bpc.yuv422.monochrome.avif --tune psnr --profile 2 --bit-depth 8 --pix-fmt yuv422 --monochrome --cpu-used 0 --rate-control q --crf 18
cavif: /github/workspace/external/libaom/av1/encoder/partition_search.c:1172: encode_b: Assertion `x->cb_offset[PLANE_TYPE_UV] < ((1 << num_pels_log2_lookup[cpi->common.seq_params.sb_size]) >> (subsampling_x + subsampling_y))' failed.
make: *** [hato.profile2.8bpc.yuv422.monochrome.avif] Aborted (core dumped)
Makefile:242: recipe for target 'hato.profile2.8bpc.yuv422.monochrome.avif' failed
It seems this assertion related to the issue.
Curiously, this assertion failure is reported only when built by Github Actions's Linux. Windows version does not report it.
libaom does not support vmaf v2.0.0
I can't build...
ERROR:
[ 82%] Building CXX object external/libavif-container/CMakeFiles/libavif-container.dir/src/avif/util/File.cpp.o
/home/rodsantos/Downloads/avif/cavif/external/libavif-container/src/avif/util/File.cpp:5:10: fatal error: filesystem: No such file or directory
#include
^~~~~~~~~~~~
For instance I want to do a comparison between avif and webp 2. With webp if can target, for instance 244kb and cwebp will work until it achieves 244kb or smaller. Is this possible with cavif?
daala-distとcdef-distの実装自体はたしかに存在する。しかし、呼ばれていない。
有効にするには、
set_aom_config_var(CONFIG_DIST_8X8 0 "AV1 experiment flag.")
というコンパイルフラグを有効にしないといけない。
まず、これを利用者側で変更する方法がわからない。それを調査する。
さらに、ここを無理やり1に書換えてビルドしたものの、
[2020/01/29 02:20:07 INFO ] cavif
[2020/01/29 02:20:07 INFO ] libaom ver: 1.0.0-errata1-avif
[2020/01/29 02:20:08 INFO ] Encoding: hato.png -> test.avif
cavif: /home/psi/umi/src/github.com/link-u/cavif/external/libaom/av1/encoder/rdopt.c:3425: search_txk_type: Assertion `block_mse_q8 != UINT_MAX' failed.
となって動かない。
masterブランチでなら有効になっているのかどうかをチェックし、もし大丈夫そうなら、自動テスト環境を整えた上で、masterブランチに引き上げる。
Hi!
In console help I see I can attach depth.avif to my final.avif.
--attach-depth
Attach depth plane
But how should I create depth.avif if there is no such option? I need to encode depth map from png to 12-bit avif file.
Thanks!
Lines 136 to 152 in edf3388
This code checks about color type, not bit-depth.
There is something strange going on here! I don't know whether the problem lies in cavif, but maybe someone can shed some light on this:
The problem is that the brightness of the AVIF files seem to change depending on what viewer you use for them.
I will sketch out the scenario that I have. I have converted a sample image via https://convertio.co (We'll call it 'internet' in the scenarios as source) as test image to compare against cavif. This is what happens:
Original: Normal
Cavif: Too bright
Internet: Normal
Original: Normal
Cavif: Normal
Internet: Too bright
I think that in either the AVIF container something is wrong, or in the decoder that is used. Before I convert a ton of images to AVIF, I would like to know what is causing this. I don't want to convert everything and then discover that the colors are messed up in some places. If it's a decoder issue, then which decoder is wrong here? Firefox or nomacs? Given that the internet file and cavif file both look different depending on the application that is used.
For your convenience, I attached the demo images to this post. They are royalty free and taken from https://www.pexels.com/nl-nl/foto/dier-schattig-boerderij-gras-4321311/, so yes, this is perfectly legal. (I had to zip them because GitHub doesn't 'support' AVIF files.)
Demo files: cavif-image-brightness-sample.zip
I've used a couple of different commands to convert the image to AVIF with Cavif, but they all yield the same result. Here is one of the commands that I've used: cavif --rate-control q --crf 10 --row-mt --tile-rows 2 --tile-columns 2 --color-primaries bt2020 --transfer-characteristics bt2020 --enable-full-color-range -i original.png -o out.avif
If you do not enable BT.2020, it seems you can lose colors sometimes. I therefore always enable it.
色情報がICCプロファイルに書かれている時に正しく変換するに使おうと思っているLittleCMSが、Windowsでうまくビルドできない。
https://ci.appveyor.com/project/ledyba-z/cavif/builds/31791421
できそうなもんなんだけどなぁ:
Little CMS < GIMPに必要なライブラリ群のビルド < ビルド | GIMPのビルド - for Windows -
https://gimpbuild.eksd.jp/build_librariesforgimp_littlecms.html
Cannot build on Centos 8 (4.18.0-240.10.1.el8_3.x86_64)
CMake Error at external/libaom/CMakeLists.txt:438 (message):
VMAF library not found.
How can this be fixed?
vmaf fails during build/install...
Overall it seems to be a bad idea to force the user to download and compile all of these libraries (libpng, libaom, libvmaf) when package managers do this well and the entire concept of libraries is that you don't need to download them into your project.
So please consider letting users manage the dependencies and install them as an option if they are not present.
これを判断できるようにすべく、デコーダ時にどんな処理が走るかAV1の定めるデコードプロセスを調べてオプションを分類する。
See e.g. https://github.com/link-u/cavif/actions/runs/1351842568
The Debian bundle at https://github.com/link-u/cavif/releases/tag/v0.1.0-20200331 can still be downloaded and installed, but when you try to use cavif
, the generated AVIF file has errors and can't be opened.
Hi. I've experienced a few build errors. Perhaps someone could help me out.
This first was this one. Per the installation instructions:
git clone --recurse-submodules --recursive [email protected]:link-u/cavif.git
Cloning into 'cavif'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
The fix was to use this:
git clone --recurse-submodules --recursive https://github.com/link-u/cavif.git
After installing the required version of CMake and starting the build, I got this error:
Performing configure step for 'vmaf_repo'
env: ‘meson’: No such file or directory
It looks like VMAF requires Meson which is not in the build instructions.
I installed pip3, installed Meson, then added it to the PATH
apt install python3-pi
pip3 install meson
PATH=$PATH:~/.local/bin/
CMake completed successfully.
I had an error during Make.
Performing configure step for 'lcms_repo'
/bin/sh: 1: /home/pppadmin/cavif/external/Little-CMS/configure: not found
Little-CMS is required, so I cloned it into the directory "/cavif/external/"
git clone https://github.com/mm2/Little-CMS.git
I ran Make again and had this error:
/cavif/external/libavif-container/src/avif/util/File.cpp:5:10: fatal error: filesystem: No such file or directory
#include <filesystem>
^~~~~~~~~~~~
The fix I found was to edit File.cpp
Replace
#include <filesystem>
with
#include <experimental/filesystem>
With that change, I also had to replace:
std::filesystem
with
std::experimental::filesystem
I made the same change for "/cavif/src/img/PNGReader.cpp".
Now I'm stuck on multiple occurrences of this error:
/cavif/src/AVIFBuilder.cpp: In member function ‘void AVIFBuilder::linkAuxImages(uint32_t, uint32_t)’:
/cavif/src/AVIFBuilder.cpp:183:5: sorry, unimplemented: non-trivial designated initializers not supported
I'm excited to try out this utility because it sounds like exactly what I'm looking for. I appreciate the work you all have put into it. Thanks again.
I have the alpha channel removed!
How not to clean it?
Give me config!
Hi, I'm a original developer of cavif.
I leaved link-u, and the development process has been moved to avif-community!
Stay tuned!
@Kotaro-Shibata 迷う人がいるからこういう内容をREADME.mdに書いておいてもらえると助かる
When I convert from PNG to AVIF, I'd like to matched the perceived quality of the source image. I've played around with various options, but couldn't find the best settings. Is there a recommended way to do this?
以前の問題として、タイル分割ができていない。たぶんまた特定のパラメータを適切にセットしないと有効にならない(のでソース読まないといけないやつ)
Really like this CLI encoder, but libaom is a bit slow. Using rav1e if available could significantly speed up encoding.
I'm having issues building on macOS 10.15.6. Is there anyway you can supply a macOS build for each release? Thank you!
Dependabot couldn't find the submodule external/Little-CMS
. Perhaps it isn't committed, or isn't a submodule?
I want to convert old jpg's to this format. After some testing I came to this command
cavif -i 1.png --rate-control q --crf 10 --row-mt --tile-rows 2 --tile-columns 2 --threads 4 -o 1.avif
CRF mode as written in many guides is stands for the most recommended mode. Is it right to this case? When value is 10 I can't spot any difference between original, but size decreased significantly 7,16 MB -> 519 KB. The program is eating 10 GB RAM, is this how it should be? Also, how to disable alpha channel? In photo proprieties I can see color depth is 32 bit, but original was 24.
Windows用のバイナリを作成したいのですがMSYS2ではビルドに失敗してしまいます
AppVeyorでビルドしていてビルドログは以下にあります
https://ci.appveyor.com/project/f11894/cavif
appveyor.ymlの内容はこんな感じになります
https://pastebin.com/q4nrHYs4
Cavif is the first avif encoder which properly does the job for me. I noticed that you've updated libaom, so I wanted to update my cavif version. You did not build a release for that one yet, so I wanted to compile it myself. That is however impossible to do.
Your build instructions list this as the first command: git clone --recurse-submodules --recursive [email protected]:link-u/cavif.git
Which doesn't work, since the access to that URL is denied. If you remove the account from that command, it will at least get into the cloning, but it still doesn't work properly.
Command output:
$ git clone --recurse-submodules --recursive https://github.com/link-u/cavif.git
Cloning into 'cavif'...
remote: Enumerating objects: 32, done.
remote: Counting objects: 100% (32/32), done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 1252 (delta 12), reused 22 (delta 8), pack-reused 1220
Receiving objects: 100% (1252/1252), 207.61 KiB | 543.00 KiB/s, done.
Resolving deltas: 100% (751/751), done.
Submodule 'external/clipp' ([email protected]:muellan/clipp.git) registered for path 'external/clipp'
Submodule 'external/libaom' (https://aomedia.googlesource.com/aom) registered for path 'external/libaom'
Submodule 'external/libavif-container' ([email protected]:link-u/libavif-container.git) registered for path 'external/libavif-container'
Submodule 'external/libpng' (git://git.code.sf.net/p/libpng/code) registered for path 'external/libpng'
Submodule 'external/vmaf' ([email protected]:Netflix/vmaf.git) registered for path 'external/vmaf'
Submodule 'external/zlib' ([email protected]:madler/zlib.git) registered for path 'external/zlib'
Cloning into '/cygdrive/u/Desktop/cavif/external/clipp'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:muellan/clipp.git' into submodule path '/cygdrive/u/Desktop/cavif/external/clipp' failed
Failed to clone 'external/clipp'. Retry scheduled
Cloning into '/cygdrive/u/Desktop/cavif/external/libaom'...
remote: Sending approximately 257.12 MiB ...
remote: Counting objects: 6, done
remote: Total 219654 (delta 174323), reused 219654 (delta 174323)
Receiving objects: 100% (219654/219654), 257.12 MiB | 2.64 MiB/s, done.
Resolving deltas: 100% (174323/174323), done.
Cloning into '/cygdrive/u/Desktop/cavif/external/libavif-container'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:link-u/libavif-container.git' into submodule path '/cygdrive/u/Desktop/cavif/external/libavif-container' failed
Failed to clone 'external/libavif-container'. Retry scheduled
Cloning into '/cygdrive/u/Desktop/cavif/external/libpng'...
remote: Enumerating objects: 107016, done.
remote: Counting objects: 100% (107016/107016), done.
remote: Compressing objects: 100% (13936/13936), done.
remote: Total 107016 (delta 97488), reused 101700 (delta 92844)
Receiving objects: 100% (107016/107016), 23.26 MiB | 1.24 MiB/s, done.
Resolving deltas: 100% (97488/97488), done.
Cloning into '/cygdrive/u/Desktop/cavif/external/vmaf'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:Netflix/vmaf.git' into submodule path '/cygdrive/u/Desktop/cavif/external/vmaf' failed
Failed to clone 'external/vmaf'. Retry scheduled
Cloning into '/cygdrive/u/Desktop/cavif/external/zlib'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:madler/zlib.git' into submodule path '/cygdrive/u/Desktop/cavif/external/zlib' failed
Failed to clone 'external/zlib'. Retry scheduled
Cloning into '/cygdrive/u/Desktop/cavif/external/clipp'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:muellan/clipp.git' into submodule path '/cygdrive/u/Desktop/cavif/external/clipp' failed
Failed to clone 'external/clipp' a second time, aborting
And then as expected, trying to compile the code with CMake also fails:
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.18363.
-- The C compiler identification is MSVC 19.26.28806.0
-- The CXX compiler identification is MSVC 19.26.28806.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSV
C/14.26.28801/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSV
C/14.26.28801/bin/Hostx64/x64/cl.exe - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/M
SVC/14.26.28801/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/M
SVC/14.26.28801/bin/Hostx64/x64/cl.exe - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is MSVC
-- Found assembler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801
/bin/Hostx64/x64/cl.exe
CMake Error at CMakeLists.txt:15 (add_subdirectory):
The source directory
U:/Desktop/cavif/external/libavif-container
does not contain a CMakeLists.txt file.
CMake Error at CMakeLists.txt:20 (add_subdirectory):
The source directory
U:/Desktop/cavif/external/zlib
does not contain a CMakeLists.txt file.
CMake Error at CMakeLists.txt:31 (add_subdirectory):
The source directory
U:/Desktop/cavif/external/libpng
does not contain a CMakeLists.txt file.
CMake Error at CMakeLists.txt:33 (target_include_directories):
Cannot specify include directories for target "png_static" which is not
built by this project.
CMake Error at CMakeLists.txt:35 (target_link_directories):
Cannot specify link directories for target "png_static" which is not built
by this project.
CMake Error at CMakeLists.txt:36 (target_include_directories):
Cannot specify include directories for target "png_static" which is not
built by this project.
CMake Error at CMakeLists.txt:37 (target_link_libraries):
Cannot specify link libraries for target "png_static" which is not built by
this project.
You may have noticed that I am doing this via Cygwin with MSVC, instead of a regular Windows command prompt. I can tell you that it doesn't make a difference: they both fail with the same errors.
Probably these files CMake is complaining about do not exist because the cloning failed. How can this be fixed?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.