Giter VIP home page Giter VIP logo

Comments (9)

y-guyon avatar y-guyon commented on September 26, 2024

The avifenc binary only supports the JPG, PNG and Y4M input formats for now. See https://github.com/AOMediaCodec/libavif/tree/main/apps/shared.

You may use a third party tool to either convert from BMP to one of these supported formats and then use avifenc, or use software that can convert from BMP directly to AVIF. I can think of recent versions of Photoshop, GIMP, ImageMagick, ffmpeg.

from libavif.

zhuya1996 avatar zhuya1996 commented on September 26, 2024

avifenc二进制文件目前仅支持 JPG、PNG 和 Y4M 输入格式。请参见https://github.com/AOMediaCodec/libavif/tree/main/apps/shared。

您可以使用第三方工具从 BMP 转换为这些受支持的格式之一,然后使用avifenc,或者使用可以从 BMP 转换为 AVIF 的软件。我可以想到 Photoshop、GIMP、ImageMagick、ffmpeg 的最新版本。

Can you directly convert YUV images to AVIF? thanks

from libavif.

y-guyon avatar y-guyon commented on September 26, 2024

I think .yuv files (plain raw samples with no container) are supported in libaom for example but not in libavif. They are inconvenient because they do not contain any metadata (image width, height, subsampling etc.) and these fields must be passed explicitly as command line arguments.

I do not know any software converting directly from YUV to AVIF, sorry.

from libavif.

zhuya1996 avatar zhuya1996 commented on September 26, 2024

I think .yuv files (plain raw samples with no container) are supported in libaom for example but not in libavif. They are inconvenient because they do not contain any metadata (image width, height, subsampling etc.) and these fields must be passed explicitly as command line arguments.

I do not know any software converting directly from YUV to AVIF, sorry.

May I ask if you know how to use avif_example_encode.c Can you help me write a demo for encoding. c to read JPG images and convert them to AVIF and save them locally

from libavif.

y-guyon avatar y-guyon commented on September 26, 2024

See the following test for a small snippet to start with:

ImagePtr image = testutil::ReadImage(data_path, "paris_exif_xmp_icc.jpg");
ASSERT_NE(image, nullptr);
EncoderPtr encoder(avifEncoderCreate());
ASSERT_NE(encoder, nullptr);
testutil::AvifRwData encoded;
ASSERT_EQ(avifEncoderWrite(encoder.get(), image.get(), &encoded),
AVIF_RESULT_OK);
std::ofstream(testing::TempDir() + "avifencodetest.avif", std::ios::binary)
.write(reinterpret_cast<char*>(encoded.data), encoded.size);

from libavif.

zhuya1996 avatar zhuya1996 commented on September 26, 2024

See the following test for a small snippet to start with:

ImagePtr image = testutil::ReadImage(data_path, "paris_exif_xmp_icc.jpg");
ASSERT_NE(image, nullptr);
EncoderPtr encoder(avifEncoderCreate());
ASSERT_NE(encoder, nullptr);
testutil::AvifRwData encoded;
ASSERT_EQ(avifEncoderWrite(encoder.get(), image.get(), &encoded),
AVIF_RESULT_OK);
std::ofstream(testing::TempDir() + "avifencodetest.avif", std::ios::binary)
.write(reinterpret_cast<char*>(encoded.data), encoded.size);

Thank you very much for trying it out

from libavif.

zhuya1996 avatar zhuya1996 commented on September 26, 2024

See the following test for a small snippet to start with:

ImagePtr image = testutil::ReadImage(data_path, "paris_exif_xmp_icc.jpg");
ASSERT_NE(image, nullptr);
EncoderPtr encoder(avifEncoderCreate());
ASSERT_NE(encoder, nullptr);
testutil::AvifRwData encoded;
ASSERT_EQ(avifEncoderWrite(encoder.get(), image.get(), &encoded),
AVIF_RESULT_OK);
std::ofstream(testing::TempDir() + "avifencodetest.avif", std::ios::binary)
.write(reinterpret_cast<char*>(encoded.data), encoded.size);

Hello, I was unsuccessful. Can you give me a compressed file that can run VS2022? My email [email protected]

from libavif.

zhuya1996 avatar zhuya1996 commented on September 26, 2024

See the following test for a small snippet to start with:

ImagePtr image = testutil::ReadImage(data_path, "paris_exif_xmp_icc.jpg");
ASSERT_NE(image, nullptr);
EncoderPtr encoder(avifEncoderCreate());
ASSERT_NE(encoder, nullptr);
testutil::AvifRwData encoded;
ASSERT_EQ(avifEncoderWrite(encoder.get(), image.get(), &encoded),
AVIF_RESULT_OK);
std::ofstream(testing::TempDir() + "avifencodetest.avif", std::ios::binary)
.write(reinterpret_cast<char*>(encoded.data), encoded.size);

Hello, I was unsuccessful. Can you give me a compressed file that can run VS2022? My email [email protected]

QQ截图20231215131419
The exe I compiled using this code encountered an error Failed to read input image: BMFF parsing failed

from libavif.

y-guyon avatar y-guyon commented on September 26, 2024

The exe I compiled using this code encountered an error Failed to read input image: BMFF parsing failed

Functions starting with avifDecoderRead*() in the libavif API are designed to decode AVIF files.
inputFilename seems to contain the path to [input.png]. Please use avifReadImage() instead.

from libavif.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.