Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check failed: build of ffmpeg failed #27

Open
mikeswanson opened this issue Mar 16, 2024 · 24 comments
Open

check failed: build of ffmpeg failed #27

mikeswanson opened this issue Mar 16, 2024 · 24 comments

Comments

@mikeswanson
Copy link

Everything seemed to work until the ffmpeg build. The end of my build-ffmpeg.log file:

duplicate symbol '_av1_sgr_params' in:
    /Users/michael/Dev/ffmpeg-compile/tool/lib/libSvtAv1Enc.a[48](selfguided_neon.c.o)
    /tmp/lto.o
ld: 1 duplicate symbols
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [ffprobe_g] Error 1
make: *** Waiting for unfinished jobs....
duplicate symbol '_av1_sgr_params' in:
    /Users/michael/Dev/ffmpeg-compile/tool/lib/libSvtAv1Enc.a[48](selfguided_neon.c.o)
    /tmp/lto.o
ld: 1 duplicate symbols
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [ffplay_g] Error 1
duplicate symbol '_dec_init' in:
    /Users/michael/Dev/ffmpeg-compile/ffmpeg/ffmpeg/fftools/ffmpeg_dec.o
    /Users/michael/Dev/ffmpeg-compile/tool/lib/libbluray.a[28](libbluray_la-dec.o)
duplicate symbol '_av1_sgr_params' in:
    /Users/michael/Dev/ffmpeg-compile/tool/lib/libSvtAv1Enc.a[48](selfguided_neon.c.o)
    /tmp/lto.o
ld: 2 duplicate symbols
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [ffmpeg_g] Error 1
rm libavfilter/metal/vf_yadif_videotoolbox.metal.air libavfilter/metal/vf_yadif_videotoolbox.metallib libavfilter/metal/vf_yadif_videotoolbox.metallib.c
+ checkStatus 2 'build of ffmpeg failed'
+ '[' 2 -ne 0 ']'
+ echo 'check failed: build of ffmpeg failed'
check failed: build of ffmpeg failed
+ exit 1
@Vargol
Copy link
Owner

Vargol commented Mar 17, 2024

Xcode 15 strikes again, it looks like Apple have decided that duplicate symbols should fail their linker, and I can't see a flag to work around it, and reverting to classic behaviour is doing the same.

No real fixes, so the only what I can see to fix this ATM is remove the --enable-libsvtav1 and --enable-libbluray options from build-ffmpeg.sh

I can try raising errors with the STV-AV1 team as they also work with the libaom and I've already had work with them to get rid of duplicate symbols before. The one has in libbluray and ffmpeg may be trickier as the vlc team seem to ignore administrator emails for their mailing list so don't allow new people so it may be the ffmpeg team that need to sort it and they are quite slow to respond to issues sometimes.

@mikeswanson
Copy link
Author

Thanks. That's actually what I ended up doing. The tests fail, but oh well.

Thank you for your work!

@Vargol
Copy link
Owner

Vargol commented Mar 17, 2024

The svt-av1 issue raised as
https://gitlab.com/AOMediaCodec/SVT-AV1/-/issues/2162

Someone else has raised the libbluray issue, which is a good job as is seems joining the VLC gitlab is as gated as there mailing lists. The ffmpeg team threw it over the fence to libbluray.

@Vargol
Copy link
Owner

Vargol commented Mar 18, 2024

SVT-AV1 should be back working again (as in it works for me :-) )

@Vargol
Copy link
Owner

Vargol commented Mar 23, 2024

No action from the vlc team with regard to libbluray, so I hacked itv tp compile and created a patch.
No idea if libbluray still works as I've got no idea if I've got any non-encrypted blu-ray discs, but its does at least
recognises the encrypted ones.

@ThijmenDam
Copy link

ThijmenDam commented Mar 31, 2024

Hi @Vargol, thanks for all your work.

I receive the same (or a similar?) error, i.e. duplicate symbol '_dec_init':

MAN	doc/ffmpeg-all.1
LD	ffmpeg_g
LD	ffprobe_g
ld: warning: ignoring duplicate libraries: '-lbrotlicommon', '-lbrotlidec', '-lbz2', '-lc++', '-ldl', '-lfreetype', '-liconv', '-lm', '-logg', '-lpng16', '-lpthread', '-lsharpyuv', '-lvorbis', '-lvpx', '-lwebp', '-lz'
ld: warning: ignoring duplicate libraries: '-lbrotlicommon', '-lbrotlidec', '-lbz2', '-lc++', '-ldl', '-lfreetype', '-liconv', '-lm', '-logg', '-lpng16', '-lpthread', '-lsharpyuv', '-lvorbis', '-lvpx', '-lwebp', '-lz'
duplicate symbol '_dec_init' in:
    /Users/thijmen/repositories/ffmpeg-apple-arm64-build/ffmpeg-compile/ffmpeg/ffmpeg/fftools/ffmpeg_dec.o
    /Users/thijmen/repositories/ffmpeg-apple-arm64-build/ffmpeg-compile/tool/lib/libbluray.a[28](libbluray_la-dec.o)
ld: 1 duplicate symbols
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [ffmpeg_g] Error 1
make: *** Waiting for unfinished jobs....
+ checkStatus 2 'build of ffmpeg failed'
+ '[' 2 -ne 0 ']'
+ echo 'check failed: build of ffmpeg failed'
check failed: build of ffmpeg failed
+ exit 1

Is there anything I can do about this right now? If this requires a separate issue, please let me know!

M1 Mac Mini on Sonoma 14.4.1.

@Vargol
Copy link
Owner

Vargol commented Mar 31, 2024

Did you download the release ?
Download the repository zip instead, big green "Code" button, download zip option at the bottom of the pop up menu.
That should work.

@ThijmenDam
Copy link

@Vargol I cloned the most recent version of this repository using the Git CLI. That should give me the most recent version, right?

@Vargol
Copy link
Owner

Vargol commented Mar 31, 2024

Yes that should work, assuming you didn't clone a branch.

Check build/build-libbluray.sh has the following line

git apply $1/libblu_dec_init.patch

I'm running a fresh build from a clone to check.

@ThijmenDam
Copy link

ThijmenDam commented Mar 31, 2024

@Vargol yes, build/build-libbluray.sh contains

git apply $1/libblu_dec_init.patch

on line 46.

@Vargol
Copy link
Owner

Vargol commented Mar 31, 2024

and thats the version thats not working for you, as that is the latest version that has just successfully built for me.

compile ffmpeg
took 182s
compilation finished successfully
took 918s

bundle result
  adding: ffmpeg (deflated 58%)
  adding: ffprobe (deflated 58%)

run tests
tests executed successfully

@ThijmenDam
Copy link

Yes, the latest version has not been working for me. I double checked that I indeed had the latest version, and tried to build twice as well. Could I help by providing additional information?

@Vargol
Copy link
Owner

Vargol commented Mar 31, 2024

Sure, first I need your build-libbluray.log from for build directory.
I can only think the patch needed to modify libbluray to fix the error has failed on your system for some reason.

@Vargol
Copy link
Owner

Vargol commented Mar 31, 2024

Also can you check in the build directory
go to tool/lib

and try running the following command

nm libbluray.a | grep dec_init

which should return somethin like

000000000000025c T _lbr_dec_init
                 U _lbr_dec_init

if the 'lbr_' on the front of dec_init is missing thats more proof the patch is not applying.

@ThijmenDam
Copy link

@Vargol indeed, the patch doesn't apply:

❯ nm libbluray.a | grep dec_init
000000000000025c T _dec_init
                 U _dec_init

I'm certain I have the latest version of your repository; I even deleted the repo folder and cloned it again. Do you have any clue on what might be going wrong? Perhaps caching-related issues?

@Vargol
Copy link
Owner

Vargol commented Mar 31, 2024

Can you send me the build log build-libbluray.log

It strange as there been no changes to the libbluray source for a year, there's only been one version of the patch, so its
got to be something strange, like you'e got an old version of git that doesn't support the apply function or maybe a non standard ascii character in your path and git isn't coping (or maybe a space maybe although I would have though a lot more would failed with a space in the path). Maybe try changing the apply command to add quotes around the path

git apply "$1/libblu_dec_init.patch"

alternatively you can try applying the patch using the patch command. To do that change the command

git apply $1/libblu_dec_init.patch

to

patch -p1 -i  "$1/libblu_dec_init.patch"

in build/build-libbluray.sh

@ThijmenDam
Copy link

ThijmenDam commented Apr 1, 2024

Older / incompatible Git version sounds plausible. I had not installed Git myself, I used the version that Apple includes in macOS. I have just installed Git (version 2.44.0) using Homebrew, and I'll try again. Will report back ASAP.

build-libbluray.log

EDIT (1): no luck using a different Git version. There are no spaces or unusual characters in my paths, thus I will try again after adapting build/libbluray.sh (i.e. patch -p1 -i "$1/libblu_dec_init.patch").

EDIT (2): adapting build/libbluray.sh worked! All tests ran successfully.

Thanks @Vargol for the extensive support.

@phips
Copy link

phips commented May 30, 2024

alternatively you can try applying the patch using the patch command. To do that change the command

git apply $1/libblu_dec_init.patch

to

patch -p1 -i  "$1/libblu_dec_init.patch"

in build/build-libbluray.sh

BTW, latest checkout (30-May-24) and it was failing the same way for me (Apple M1-Max) — I did this change, and it's built ok 👌

@ethanrjones97
Copy link

It looks like Xcode had an update two weeks ago- did it break everything again?
Getting a seemingly different check failed: build of ffmpeg failed error

Snippet from build-ffmpeg.log

CC      libavcodec/vc2enc.o
CC      libavcodec/vc2enc_dwt.o
CC      libavcodec/vcr1.o
CC      libavcodec/version.o
CC      libavcodec/videodsp.o
2 warnings generated.
CC      libavcodec/videotoolbox.o
CC      libavcodec/videotoolbox_vp9.o
CC      libavcodec/videotoolboxenc.o
CC      libavcodec/vima.o
CC      libavcodec/vlc.o
CC      libavcodec/vmdaudio.o
CC      libavcodec/vmdvideo.o
CC      libavcodec/vmixdec.o
CC      libavcodec/vmnc.o
CC      libavcodec/vorbis.o
CC      libavcodec/vorbis_data.o
CC      libavcodec/vorbis_parser.o
CC      libavcodec/vorbisdec.o
libavcodec/videotoolbox.c:352:24: error: no member named 'temporal_id_nesting_flag' in 'struct HEVCSPS'; did you mean 'temporal_id_nesting'?
                  sps->temporal_id_nesting_flag << 2 |
                       ^~~~~~~~~~~~~~~~~~~~~~~~
                       temporal_id_nesting
libavcodec/videotoolbox.c:156:29: note: expanded from macro 'AV_W8'
#define AV_W8(p, v) *(p) = (v)
                            ^
libavcodec/hevc_ps.h:249:13: note: 'temporal_id_nesting' declared here
    uint8_t temporal_id_nesting;
            ^
1 error generated.
make: *** [libavcodec/videotoolbox.o] Error 1
make: *** Waiting for unfinished jobs....
CC      libavcodec/vorbisdsp.o
CC      libavcodec/vorbisenc.o
rm libavfilter/metal/vf_yadif_videotoolbox.metal.air
+ checkStatus 2 'build of ffmpeg failed'
+ '[' 2 -ne 0 ']'
+ echo 'check failed: build of ffmpeg failed'
check failed: build of ffmpeg failed
+ exit 1

build-ffmpeg.log

@Vargol
Copy link
Owner

Vargol commented Jun 1, 2024

Not sure, this one is looking like a ffmpeg issue, as the error says

error: no member named 'temporal_id_nesting_flag' in 'struct HEVCSPS'

but that flag is or was part of HEVCSPS see the ffmpeg docs.
https://ffmpeg.org/doxygen/7.0/structHEVCSPS.html

I'm guessing the flag has been changed in the git repo, but no one has changed the video toolbox interface.

Just got to do some digging to verify that, like find the HEVCSPS definition in the repo

@Vargol
Copy link
Owner

Vargol commented Jun 1, 2024

@Vargol
Copy link
Owner

Vargol commented Jun 1, 2024

Issue raised on the ffmpeg tracker.
https://trac.ffmpeg.org/ticket/11042

@Vargol
Copy link
Owner

Vargol commented Jun 1, 2024

And it appears to be fixed now.

@ethanrjones97
Copy link

Thank you for your quick response!
I didn't have "bug in ffmpeg" as my first guess 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants