savonet / ocaml-ffmpeg

OCaml bindings to the FFmpeg library.
http://www.liquidsoap.info/ocaml-ffmpeg/
GNU Lesser General Public License v2.1
48 stars 12 forks source link

opam install ffmpeg fails #52

Closed maardsma closed 3 years ago

maardsma commented 3 years ago

Brand new Ubuntu 18.4 VPS

installed opam via apt opam init opam switch create 4.08.0 opam install ffmpeg

Fails with this error:

[ERROR] The compilation of ffmpeg-avutil.1.0.0~rc1 failed at "dune build -p ffmpeg-avutil -j 1 @install".

#=== ERROR while compiling ffmpeg-avutil.1.0.0~rc1 ============================#
# context     2.1.0~rc2 | linux/x86_64 | ocaml-base-compiler.4.08.0 | https://opam.ocaml.org#81d2d054
# path        ~/.opam/4.08.0/.opam-switch/build/ffmpeg-avutil.1.0.0~rc1
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p ffmpeg-avutil -j 1 @install
# exit-code   1
# env-file    ~/.opam/log/ffmpeg-avutil-29035-5aaa46.env
# output-file ~/.opam/log/ffmpeg-avutil-29035-5aaa46.out
### output ###
# avutil_stubs.c:1641:13: error: request for member ‘sw_format’ in something not a structure or union
# [...]
#              ^~
# avutil_stubs.c:1642:13: error: request for member ‘width’ in something not a structure or union
#    frames_ctx->width = Int_val(_width);
#              ^~
# avutil_stubs.c:1643:13: error: request for member ‘height’ in something not a structure or union
#    frames_ctx->height = Int_val(_height);
#              ^~
# avutil_stubs.c:1646:9: warning: implicit declaration of function ‘av_hwframe_ctx_init’; did you mean ‘av_frame_clone’? [-Wimplicit-function-declaration]
#    ret = av_hwframe_ctx_init(hw_frames_ref);
#          ^~~~~~~~~~~~~~~~~~~
#          av_frame_clone
maardsma commented 3 years ago

This was resolved by attempting the install on Ubuntu Server 20.04 instead of Ubuntu Server 18.4 I was using before.

toots commented 3 years ago

Thanks for letting us know. Yeah, ubuntu 18.04 is too old for this binding.

ItsMitchh commented 2 years ago

@toots Would this be possible to be fixed for Ubuntu 18.04? 18.04 is still in support for another few years and it's bit harsh removing this from a supported platform.

toots commented 2 years ago

Frankly, this is a tricky task that I am not sure I have time to tackle. This binding is already pretty complex. But you have a PPA to install ffmpeg here: https://launchpad.net/~savoury1/+archive/ubuntu/ffmpeg4

Also, with the increasing adoption of virtualized containers, you should be able to run liquidsoap inside a container image with all required dependencies regardless of your server's OS. We do provide production images based on ubuntu here: https://hub.docker.com/r/savonet/liquidsoap and based on alpine here: https://hub.docker.com/r/savonet/liquidsoap-alpine