strukturag / libheif

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

FFmpeg not listed as available decoder in heif-convert #998

Closed diizzyy closed 11 months ago

diizzyy commented 11 months ago

If libde265 support is enabled heif-covert lists

HEIC decoders:
- libde265 = libde265 HEVC decoder, version 1.0.12

If libde265 and ffmpeg support is enabled heif-covert lists

HEIC decoders:
- libde265 = libde265 HEVC decoder, version 1.0.12

Only ffmpeg show no decoders available, looks like a bug?

Tested on FreeBSD 13.2 and master branch

farindk commented 11 months ago

If you enabled the ffmpeg plugin, it might still be that cmake could not find the ffmpeg installation. What do you get in the plugin summary output from cmake? In my case, it looks like this:

=== Summary of compiled codecs ===
 libde265 HEVC decoder        : + separate plugin
 FFMPEG HEVC decoder (HW acc) : + separate plugin
 x265 HEVC encoder            : + separate plugin
 Kvazaar HEVC encoder         : + separate plugin
 AOM AV1 decoder              : + separate plugin
 AOM AV1 encoder              : + separate plugin
 Dav1d AV1 decoder            : + separate plugin
 SVT AV1 encoder              : + separate plugin
 Rav1e AV1 encoder            : - not found
 JPEG decoder                 : + separate plugin
 JPEG encoder                 : + separate plugin
 OpenJPEG J2K decoder         : + separate plugin
 OpenJPEG J2K encoder         : + separate plugin

Here, Rav1e is not compiled even though it was enabled, because I don't have it currently installed.

diizzyy commented 11 months ago
-- Found FFMPEG: /usr/local/include (found version "6.0") found components: avcodec
=== Summary of compiled codecs ===
libde265 HEVC decoder        : + built-in
FFMPEG HEVC decoder (HW acc) : + built-in
x265 HEVC encoder            : + built-in
Kvazaar HEVC encoder         : - disabled
AOM AV1 decoder              : + built-in
AOM AV1 encoder              : + built-in
Dav1d AV1 decoder            : + separate plugin
SVT AV1 encoder              : - disabled
Rav1e AV1 encoder            : - disabled
JPEG decoder                 : + built-in
JPEG encoder                 : + built-in
OpenJPEG J2K decoder         : + separate plugin
OpenJPEG J2K encoder         : + separate plugin
...
Compiling 'ffmpegdec' as built-in backend

Also -DHAVE_FFMPEG_DECODER=1 is being set

Yet it shows,

heif-convert --list-decoders
HEIC decoders:
- libde265 = libde265 HEVC decoder, version 1.0.12
AVIF decoders:
- dav1d = dav1d v6.9.0
- aom = AOMedia Project AV1 Decoder 3.7.0
JPEG decoders:
- jpeg = libjpeg-turbo 3.0.0 (libjpeg 8.0)
JPEG-2000 decoders:
- openjpeg = OpenJPEG 2.5.0
uncompressed: no
farindk commented 11 months ago

Right, there was a bug that built-in compilation of the ffmpeg plugin was not included. The above commit corrects this. Thank you for reporting this.

diizzyy commented 11 months ago

Thanks for promptly addressing the issue

bigcat88 commented 8 months ago

Can I have an example for any OS, how can I build libheif that it would see FFMPEG?

I tried on macOS without success. Tried on Ubuntu without success too.

diizzyy commented 8 months ago

Run CMake with -DWITH_FFMPEG_DECODER:BOOL=true supplied as argument

bigcat88 commented 8 months ago

ffmpeg -version:

ffmpeg version 6.1-1build2~22.04 Copyright (c) 2000-2023 the FFmpeg developers built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04)

cmake -DWITH_FFMPEG_DECODER:BOOL=true Could NOT find FFMPEG (missing: FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARIES avcodec)

How I should install ffmpeg?

bigcat88 commented 8 months ago

Good, if anyone will struggle with this, looks like just need to install:

apt install libavcodec-dev libavformat-dev libavfilter-dev

bradh commented 8 months ago

@bigcat88 Possibly that could go into the documentation (e.g. README.md)?

bigcat88 commented 8 months ago

a little bit later, when I will gather all info how plugin system behaves on different OSes/configs, to be it like a little mini-guide.