Skip to content

heif-dec fails to decode avc image created by heif-enc #1866

Closed

Description

@tonycoz

My own libheif wrapper was failing with a similar error, which I've reproduced with heif-enc/dec:

tony@ares:~/dev/imager/git/imager-file-heif$ LD_LIBRARY_PATH=~/local/libheif-1.23.1/lib/ ~/local/libheif-1.23.1/bin/heif-enc --avc foo.png foo.avc
tony@ares:~/dev/imager/git/imager-file-heif$ LD_LIBRARY_PATH=~/local/libheif-1.23.1/lib/ ~/local/libheif-1.23.1/bin/heif-dec foo.avc out.png
File contains 1 image
Could not decode image: Invalid input: Invalid image size: Decoded image does not have the size signaled in the file.
tony@ares:~/dev/imager/git/imager-file-heif$ file foo.png foo.avc
foo.png: PNG image data, 150 x 150, 8-bit/color RGB, non-interlaced
foo.avc: ISO Media
tony@ares:~/dev/imager/git/imager-file-heif$ LD_LIBRARY_PATH=~/local/libheif-1.23.1/lib/ ~/local/libheif-1.23.1/bin/heif-info foo.avc
MIME type: image/avci
main brand: avci
compatible brands: mif1, avci, miaf

image: 150x150 (id=1), primary
  colorspace: YCbCr, 4:2:0
  bit depth: 8
  color profile: nclx
    colour primaries: 1 (BT.709)
    transfer characteristics: 13 (IEC 61966-2-1 (sRGB))
    matrix coefficients: 6 (BT.601)
    full range flag: 1 (full)
  alpha channel: no 
  depth channel: no
metadata:
  none
transformations:
  crop: left=0 top=0 right=5 bottom=5
region annotations:
  none
text items:
  none
properties:
none
MIME items:
tony@ares:~/dev/imager/git/imager-file-heif$ LD_LIBRARY_PATH=~/local/libheif-1.23.1/lib/ ~/local/libheif-1.23.1/bin/heif-enc --list-encoders
AVC encoders:
- x264 = x264 AVC encoder ( r3108 31e19f9) [default]
AVIF encoders:
- aom = AOMedia Project AV1 Encoder v3.12.1 [default]
- rav1e = Rav1e encoder v0.7.1
HEIC encoders:
- x265 = x265 HEVC encoder (4.1+1-1d117be) [default]
JPEG encoders:
- jpeg = libjpeg-turbo 2.1.5 (libjpeg 6.2) [default]
JPEG 2000 encoders:
JPEG 2000 (HT) encoders:
Uncompressed encoders:
- uncompressed = builtin [default]
VVIC encoders:

tony@ares:~/dev/imager/git/imager-file-heif$ LD_LIBRARY_PATH=~/local/libheif-1.23.1/lib/ ~/local/libheif-1.23.1/bin/heif-dec --list-decoders
AVC decoders:
- openh264 = OpenH264 2.6.0
AVIF decoders:
- dav1d = dav1d v7.0.0
- aom = AOMedia Project AV1 Decoder v3.12.1
HEIC decoders:
- libde265 = libde265 HEVC decoder, version 1.0.15
JPEG decoders:
- jpeg = libjpeg-turbo 2.1.5 (libjpeg 6.2)
JPEG 2000 decoders:
JPEG 2000 (HT) decoders:
uncompressed:
- uncompressed = builtin
VVIC decoders:

Activity

  1. bradh commented on Jul 12, 2026

    @bradh
    Contributor

    Can you attach the two files? I think you will need to zip them for github.

  2. tonycoz commented on Jul 12, 2026

    @tonycoz
    Author

    foo.zip The files, zipped.

  3. farindk commented on Aug 31, 2026

    @farindk
    Member

    Thank you. Should be fixed with 4cedda9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions