strukturag / libheif

libheif is an HEIF and AVIF file format decoder and encoder.
Other
1.71k stars 298 forks source link

SVT-AV1: encoding small images fails #724

Closed dloebl closed 1 year ago

dloebl commented 1 year ago

test.jpg test.jpg

$ heif-enc -A -e svt test.jpg
Svt[info]: -------------------------------------------
Svt[info]: SVT [version]:   SVT-AV1 Encoder Lib v1.3.0-36-g4794f938
Svt[info]: SVT [build]  :   Apple LLVM 14.0.0 (clang-1400.0.29.202)  64 bit
Svt[info]: LIB Build date: Nov 22 2022 11:17:58
Svt[info]: -------------------------------------------
Svt[error]: Instance 1: Source Width must be at least 64
Svt[error]: Instance 1: Source Height must be at least 64
Svt[error]: Instance 1: Forced Max Width must be at least 64
Svt[error]: Instance 1: Forced Max Height must be at least 64
Svt[warn]: If you are using tiles with the intent of increasing the decoder speed, please also consider using --fast-decode 1, especially if the intended decoder is running with limited multi-threading capabilities.

$ heif-info test.avif
MIME type: image/avif
main brand: avif
compatible brands: avif, mif1, miaf

Could not read HEIF/AVIF file: Invalid input: Item has no data: Item with ID 1 has no compressed data

With aom it works just fine:

$ heif-enc -A -e aom test.jpg
$ heif-info test.avif

MIME type: image/avif
main brand: avif
compatible brands: avif, mif1, miaf

image: 60x40 (id=1), primary
  color profile: prof
  alpha channel: no 
  depth channel: no
metadata:
  Exif: 184 bytes

Not sure if it's something that can be improved in libheif or something related to SVT-AV1.

Version: latest master (da9eea36d3815ec064cafe47bf9a0ac59809fd8b)

farindk commented 1 year ago

Thank you. The above change should fix this.