ocaml-ffmpeg icon indicating copy to clipboard operation
ocaml-ffmpeg copied to clipboard

ffmpeg-avutil failing to compile on Apple Silicon

Open Allavaz opened this issue 1 month ago • 0 comments

Hi, when I try to install ffmpeg on opam I get this error:

[ERROR] The compilation of ffmpeg-avutil.1.1.11 failed at "dune build -p ffmpeg-avutil -j 10 @install".

#=== ERROR while compiling ffmpeg-avutil.1.1.11 ===============================#
# context     2.1.5 | macos/arm64 | ocaml.5.1.1 | https://opam.ocaml.org#2b6e600e
# path        ~/.opam/default/.opam-switch/build/ffmpeg-avutil.1.1.11
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p ffmpeg-avutil -j 10 @install
# exit-code   1
# env-file    ~/.opam/log/ffmpeg-avutil-22244-6f7cf3.env
# output-file ~/.opam/log/ffmpeg-avutil-22244-6f7cf3.out
### output ###
# avutil_stubs.c:1322:8: error: use of undeclared identifier 'AV_OPT_TYPE_CHANNEL_LAYOUT'; did you mean 'AV_OPT_TYPE_CHLAYOUT'?
# [...]
# /opt/homebrew/Cellar/ffmpeg/7.0_1/include/libavutil/opt.h:252:5: note: 'AV_OPT_TYPE_CHLAYOUT' declared here
#     AV_OPT_TYPE_CHLAYOUT,
#     ^
# avutil_stubs.c:1324:9: error: call to undeclared function 'av_get_channel_name'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
#     if (av_get_channel_name(option->default_val.i64)) {
#         ^
# avutil_stubs.c:1324:9: note: did you mean 'av_channel_name'?
# /opt/homebrew/Cellar/ffmpeg/7.0_1/include/libavutil/channel_layout.h:438:5: note: 'av_channel_name' declared here
# int av_channel_name(char *buf, size_t buf_size, enum AVChannel channel);
#     ^
# 17 errors generated.



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions failed
| - build ffmpeg-avutil 1.1.11
+-
- No changes have been performed

I'm using the ocaml 5.1.1 compiler. I tested it on an Intel mac (hackintosh actually) and it works, so I guess it only happens with the Apple Silicon chips.

Allavaz avatar May 06 '24 01:05 Allavaz