Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Odd image dimentions and svt-av1 encoder #544

Open
novomesk opened this issue Mar 16, 2021 · 3 comments
Open

Odd image dimentions and svt-av1 encoder #544

novomesk opened this issue Mar 16, 2021 · 3 comments

Comments

@novomesk
Copy link
Contributor

SVT encoder doesn't like odd image dimensions:

-------------------------------------------
SVT [version]:  SVT-AV1 Encoder Lib v0.8.6
SVT [build]  :  GCC 9.3.0        64 bit
LIB Build date: Jan 11 2021 09:20:51
-------------------------------------------
Error Instance 1: Source Width must be even for YUV_420 colorspace
Error Instance 1: Source Height must be even for YUV_420 colorspace
SvtMalloc[info]: you have no memory leak

How to deal with the situation?

  1. Add 1 pixel column/row to the image (in application level) and define avifCleanApertureBox?
  2. Can libavif automate actions in 1) ?
  3. Wait, maybe future version of SVT-AV1 brings some solution.
@joedrago
Copy link
Collaborator

This is definitely something for SVT to implement, just like the other AV1 implementations.

@kingsznhone
Copy link

This is a reallly annoy problem while i'm trying to archive some odd length image

@wantehchang
Copy link
Collaborator

Hi @kingsznhone,

I assume your input images are in the YUV 4:2:0 format.

You can use avifenc with libaom as the AV1 encoder. libaom supports 4:2:0 input images of odd dimensions.

If you prefer SVT-AV1 as the AV1 encoder, you can use heif-enc (from libheif). heif-enc pads the image to even dimensions and then adds a clean aperture (clap) property to the AVIF file to crop the padded image to the original size. (This is solution 1 in #544 (comment).)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants