strukturag / libheif

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

libheif 1.18.0: Test suite fails with encode and region tests even with LIBHEIF_PLUGIN_PATH set #1281

Open ellenjohnson opened 2 months ago

ellenjohnson commented 2 months ago

Hello! On Linux, I'm building libheif v1.18.0 with libde265 as a dynamic plugin:

WITH_LIBDE265:BOOL=ON WITH_LIBDE265_PLUGIN:BOOL=ON

The build runs fine, but the tests fail -- only two tests are run, encode and region - and they both fail similar to the descriptions in https://github.com/strukturag/libheif/issues/986 and https://github.com/strukturag/libheif/issues/965. I see solution is to set LIBHEIF_PLUGIN_PATH. Does this mean set it to the absolute path where the plugins are built during the build process, meaning libheif/plugins which contains (amongst the decoder/coder c files) the libheif-libde265.so? Or the absolute path to the location of the libde265.so that I built when building libde265 v1.0.15 (prior to building libheif)? When I set it to the libheif/plugins path, I get the following results (just showing results for encode test for brevity):

Start testing: Aug 22 10:21 EDT
----------------------------------------------------------
1/2 Testing: encode
1/2 Test: encode
Command: "/mathworks/devel/sandbox/ellenj/3p-tmw/3p/derived/glnxa64/libheif/tests/encode"
Directory: /mathworks/devel/sandbox/ellenj/3p-tmw/3p/derived/glnxa64/libheif/tests
"encode" start time: Aug 22 10:21 EDT
Output:
----------------------------------------------------------

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
encode is a Catch v2.13.9 host application.
Run with -? for options

-------------------------------------------------------------------------------
ispe odd size
-------------------------------------------------------------------------------
/mathworks/devel/sandbox/ellenj/3p-tmw/3p/derived/glnxa64/libheif/tests/encode.cc:165
...............................................................................

/mathworks/devel/sandbox/ellenj/3p-tmw/3p/derived/glnxa64/libheif/tests/encode.cc:140: FAILED:
  REQUIRE( err.code == heif_error_Ok )
with expansion:
  3 == 0

===============================================================================
test cases: 1 | 1 failed
assertions: 4 | 3 passed | 1 failed

<end of output>
Test time =   0.01 sec
----------------------------------------------------------
Test Failed.
"encode" end time: Aug 22 10:21 EDT
"encode" time elapsed: 00:00:00
----------------------------------------------------------

When I set it to the path to containing libde265.so from building libde265, I get glibc errors:

Start testing: Aug 22 11:00 EDT 
----------------------------------------------------------
1/2 Testing: encode
1/2 Test: encode
Command: "/mathworks/devel/sandbox/ellenj/3p-tmw/3p/derived/glnxa64/libheif/tests/encode"
Directory: /mathworks/devel/sandbox/ellenj/3p-tmw/3p/derived/glnxa64/libheif/tests
"encode" start time: Aug 22 11:00 EDT 
Output:
----------------------------------------------------------
/mathworks/devel/sandbox/ellenj/3p-tmw/3p/derived/glnxa64/libheif/tests/encode: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /mathworks/devel/sandbox/ellenj/3p-tmw/3p/derived/glnxa64/libheif/tests/encode)
`/mathworks/devel/sandbox/ellenj/3p-tmw/3p/derived/glnxa64/libheif/tests/encode:` /lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.13' not found (required by /mathworks/devel/sandbox/ellenj/3p-tmw/3p/derived/glnxa64/libheif/tests/encode)
/mathworks/devel/sandbox/ellenj/3p-tmw/3p/derived/glnxa64/libheif/tests/encode: /lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.13' not found (required by /mathworks/devel/sandbox/ellenj/3p-tmw/3p/derived/glnxa64/libheif/libheif/libheif.so.1)
/mathworks/devel/sandbox/ellenj/3p-tmw/3p/derived/glnxa64/libheif/tests/encode: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /mathworks/devel/sandbox/ellenj/3p-tmw/3p/derived/glnxa64/libheif/libheif/libheif.so.1)
<end of output>
Test time =   0.01 sec 
----------------------------------------------------------
Test Failed.
"encode" end time: Aug 22 11:00 EDT 
"encode" time elapsed: 00:00:00

I'm not sure what I'm doing wrong here, any help is appreciated!

bradh commented 4 days ago

I think there was a problem with 1.18.x where tests that required the uncompressed codec were enabled even if the uncompressed codec was not enabled. The failures are harmless, but you can turn on that codec to address the problem.

farindk commented 4 days ago

The "encode" test does very basic encoding with HEVC and AV1. I'm pretty sure it is simply a wrongly set plugin path. With v1.19.x this should now be pretty automatic. I.e. when you run the tests from the build directory, it should set the plugin path automatically. If the matching encoders are not compiled, the tests are now skipped (it will report so).