m-ab-s / media-autobuild_suite

This Windows Batchscript helps setup a Mingw-w64 compiler environment for building ffmpeg and other media tools under Windows.
GNU General Public License v3.0
1.54k stars 267 forks source link

[mingw64] [ffmpeg with libsvtav1] libsvtav1 and libaom seems to conflict with each other #1364

Closed moisespr123 closed 5 years ago

moisespr123 commented 5 years ago

I'm not sure why I was not seeing this make error before, but now that I'm disabling and testing different options in order to successfully use SVT-AV1 in ffmpeg with most plugins, I came to this issue:

Likely error:
D:/repos/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/repos/media-autobuild_suite/local64/lib/libSvtAv1Enc.a(convolve_avx2.c.obj):convolve_avx2.c:(.text+0xc90): multiple definition of `av1_build_compound_diffwtd_mask_d16_avx2'; D:/repos/media-autobuild_suite/local64/lib/libaom.a(reconinter_avx2.c.o):reconinter_avx2.c:(.text+0x350): first defined here

D:/repos/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/repos/media-autobuild_suite/local64/lib/libSvtAv1Enc.a(convolve_avx2.c.obj):convolve_avx2.c:(.text+0x1cc0): multiple definition of `av1_wedge_sse_from_residuals_avx2'; D:/repos/media-autobuild_suite/local64/lib/libaom.a(wedge_utils_avx2.c.o):wedge_utils_avx2.c:(.text+0x0): first defined here

D:/repos/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/repos/media-autobuild_suite/local64/lib/libSvtAv1Enc.a(convolve_avx2.c.obj):convolve_avx2.c:(.text+0x1da0): multiple definition of `aom_subtract_block_avx2'; D:/repos/media-autobuild_suite/local64/lib/libaom.a(subtract_avx2.c.o):subtract_avx2.c:(.text+0x0): first defined here

D:/repos/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/repos/media-autobuild_suite/local64/lib/libSvtAv1Enc.a(convolve_avx2.c.obj):convolve_avx2.c:(.text+0x20f0): multiple definition of `aom_sse_avx2'; D:/repos/media-autobuild_suite/local64/lib/libaom.a(sse_avx2.c.o):sse_avx2.c:(.text+0x0): first defined here

D:/repos/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/repos/media-autobuild_suite/local64/lib/libSvtAv1Enc.a(convolve_avx2.c.obj):convolve_avx2.c:(.text+0x27d0): multiple definition of `aom_lowbd_blend_a64_d16_mask_avx2'; D:/repos/media-autobuild_suite/local64/lib/libaom.a(blend_a64_mask_avx2.c.o):blend_a64_mask_avx2.c:(.text+0x0): first defined here

D:/repos/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/repos/media-autobuild_suite/local64/lib/libSvtAv1Enc.a(convolve_avx2.c.obj):convolve_avx2.c:(.text+0x37a0): multiple definition of `aom_sum_squares_i16_sse2'; D:/repos/media-autobuild_suite/local64/lib/libaom.a(sum_squares_sse2.c.o):sum_squares_sse2.c:(.text+0x410): first defined here

D:/repos/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/repos/media-autobuild_suite/local64/lib/libSvtAv1Enc.a(convolve_avx2.c.obj):convolve_avx2.c:(.text+0x3810): multiple definition of `av1_wedge_sign_from_residuals_avx2'; D:/repos/media-autobuild_suite/local64/lib/libaom.a(wedge_utils_avx2.c.o):wedge_utils_avx2.c:(.text+0xe0): first defined here

D:/repos/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/repos/media-autobuild_suite/local64/lib/libSvtAv1Enc.a(convolve_avx2.c.obj):convolve_avx2.c:(.text+0x3910): multiple definition of `av1_wedge_compute_delta_squares_avx2'; D:/repos/media-autobuild_suite/local64/lib/libaom.a(wedge_utils_avx2.c.o):wedge_utils_avx2.c:(.text+0x1e0): first defined here

It seems that libaom and libsvtav1 cannot be enabled together. Compilation fails as shown above.

I'm now trying to build ffmpeg with libaom disabled and see if I can get SVT-AV1 running in ffmpeg.

1480c1 commented 5 years ago

I'm pretty sure I saw some kind of issue upstream about this

1480c1 commented 5 years ago

https://github.com/OpenVisualCloud/SVT-AV1/issues/453 was the original issue

1480c1 commented 5 years ago

It seems some of those functions were introduced in https://github.com/OpenVisualCloud/SVT-AV1/commit/a14560c4f9687807fe1131a0cf9a5526a2973ccf 11 days ago

moisespr123 commented 5 years ago

Ok, still the video cannot be encoded with libaom disabled. I'm going to continue trying to identify which library is messing with it.

moisespr123 commented 5 years ago

ffmpeg is actually crashing and creating a memory dump... Only happens with SVT-AV1.

moisespr123 commented 5 years ago

Another compile error, now about libsvthevc and the last one seems to be about libxvid....

H:/repos/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: H:/repos/media-autobuild_suite/local64/lib/libSvtAv1Enc.a(EbModeDecisionConfiguration.c.obj):EbModeDecisionConfiguration.c:(.text+0x0): multiple definition of `MdcRefinement'; H:/repos/media-autobuild_suite/local64/lib/libSvtHevcEnc.a(EbModeDecisionConfiguration.c.obj):EbModeDecisionConfiguration.c:(.text+0x0): first defined here
H:/repos/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: H:/repos/media-autobuild_suite/local64/lib/libSvtAv1Enc.a(EbModeDecisionConfiguration.c.obj):EbModeDecisionConfiguration.c:(.text+0x570): multiple definition of `RefinementPredictionLoop'; H:/repos/media-autobuild_suite/local64/lib/libSvtHevcEnc.a(EbModeDecisionConfiguration.c.obj):EbModeDecisionConfiguration.c:(.text+0x7a0): first defined here
H:/repos/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: H:/repos/media-autobuild_suite/local64/lib/libSvtAv1Enc.a(EbModeDecisionConfiguration.c.obj):EbModeDecisionConfiguration.c:(.text+0x770): multiple definition of `ForwardCuToModeDecision'; H:/repos/media-autobuild_suite/local64/lib/libSvtHevcEnc.a(EbModeDecisionConfiguration.c.obj):EbModeDecisionConfiguration.c:(.text+0xc30): first defined here
H:/repos/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: H:/repos/media-autobuild_suite/local64/lib/libSvtAv1Enc.a(EbModeDecisionConfiguration.c.obj):EbModeDecisionConfiguration.c:(.text+0x9c0): multiple definition of `MdcInterDepthDecision'; H:/repos/media-autobuild_suite/local64/lib/libSvtHevcEnc.a(EbModeDecisionConfiguration.c.obj):EbModeDecisionConfiguration.c:(.text+0xe50): first defined here
H:/repos/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: H:/repos/media-autobuild_suite/local64/lib/libSvtAv1Enc.a(EbModeDecisionConfiguration.c.obj):EbModeDecisionConfiguration.c:(.text+0xbd0): multiple definition of `PredictionPartitionLoop'; H:/repos/media-autobuild_suite/local64/lib/libSvtHevcEnc.a(EbModeDecisionConfiguration.c.obj):EbModeDecisionConfiguration.c:(.text+0x1110): first defined here
H:/repos/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: H:/repos/media-autobuild_suite/local64/lib/libSvtAv1Enc.a(EbModeDecisionConfiguration.c.obj):EbModeDecisionConfiguration.c:(.rdata+0x0): multiple definition of `incrementalCount'; H:/repos/media-autobuild_suite/local64/lib/libSvtHevcEnc.a(EbModeDecisionConfiguration.c.obj):EbModeDecisionConfiguration.c:(.rdata+0x0): first defined here
H:/repos/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: H:/repos/media-autobuild_suite/local64/lib/libSvtAv1Enc.a(EbMotionEstimationContext.c.obj):EbMotionEstimationContext.c:(.text+0x130): multiple definition of `MotionEstimetionPredUnitCtor'; H:/repos/media-autobuild_suite/local64/lib/libSvtHevcEnc.a(EbMotionEstimationContext.c.obj):EbMotionEstimationContext.c:(.text+0x0): first defined here
H:/repos/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: H:/repos/media-autobuild_suite/local64/lib/libxvidcore.a(idct.obj): warning: common of `idct' overridden by definition from H:/repos/media-autobuild_suite/local64/lib/libcodec2.a(dct2.c.o)
collect2.exe: error: ld returned 1 exit status
make: *** [/build/ffmpeg-git/Makefile:111: ffmpeg_g.exe] Error 1
moisespr123 commented 5 years ago

libsvtav1 also doesn't play nice with libopencore-amrwb

H:/repos/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: H:/repos/media-autobuild_suite/local64/lib/libSvtAv1Enc.a(EbIntraPrediction.c.obj): warning: common of `pred' overridden by definition from H:/repos/media-autobuild_suite/msys64/mingw64/lib/libopencore-amrwb.a(dec_gain2_amr_wb.o)
collect2.exe: error: ld returned 1 exit status
moisespr123 commented 5 years ago

Now it's working! I don't know why it seemed to compile at first given the above issues that showed up while disabling several libraries.

I'm going to enable some of the ones I disabled that were not in the errors and see if it still works.

This is mostly an issue with SVT-AV1 itself. They seem to have redeclared some stuff that conflicts with other libraries, as shown above...

1480c1 commented 5 years ago

I see

1480c1 commented 5 years ago

Might be good to report any true conflicts with other libs and ping hassount, kylophone, and jsunintel to fix any conflicts with other libs that might be used in ffmpeg

moisespr123 commented 5 years ago

Now, there seems to be a library in the ffmpeg_options_full that for some reason didn't show the above errors. I disabled everything, except libsvthevc and libsvtav1 and that's where the errors started displaying.

I've enabled them, leaving only libsvthevc disabled as well as the ones disabled by default in the script. libsvthevc has issues with libsvtav1 even after the patches are applied. Also disabled are libaom and libopencore-amrwb.

I opened an issue with these conflicts on their repo: https://github.com/OpenVisualCloud/SVT-AV1/issues/567.

Now, related to the suite, should these libraries be disabled if libsvtav1 is enabled? As they will not let the encoder run.

1480c1 commented 5 years ago

Probably yes, although it might be good to add a note somewhere so that way if they are fixed, we can revert the changes

moisespr123 commented 5 years ago

A note in media-suite_compile.sh. before the patch?

1480c1 commented 5 years ago

Preferably near where they are disabled etc. So yea