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

Cannot install ffmpeg-avfilter #39

Closed luisogandob closed 4 years ago

luisogandob commented 4 years ago

Hi! I'm trying to install ffmpeg-avfilter with Opam but it says that package named ffmpeg-avfilter is not found. I also try to install from the repo adding a pin to git but it fails too.

Running: Centos 7 Ocaml: 4.10.0 Opam: 2.0.6

Processing  1/2: [ffmpeg-avfilter: dune build]
00:04.288  PARALLEL               Collected task for job 923901731 (ret:1)
[ERROR] The compilation of ffmpeg-avfilter failed at "/home/centos/.opam/opam-init/hooks/sandbox.sh build dune build -p
        ffmpeg-avfilter -j 1 @install".
00:04.288  PARALLEL               Job 923901731 finished
00:04.288  PARALLEL               Starting job 682682566 (worker 1/1): ∗ ffmpeg-avfilter.0.5.0
00:04.288  PARALLEL               Job 682682566 finished

#=== ERROR while compiling ffmpeg-avfilter.0.5.0 ==============================#
# context     2.0.6 | linux/x86_64 | ocaml-system.4.10.0 | pinned(git+https://github.com/savonet/ocaml-ffmpeg.git#841f1f16)
# path        ~/.opam/default/.opam-switch/build/ffmpeg-avfilter.0.5.0
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p ffmpeg-avfilter -j 1 @install
# exit-code   1
# env-file    ~/.opam/log/ffmpeg-avfilter-3571-865888.env
# output-file ~/.opam/log/ffmpeg-avfilter-3571-865888.out
### output ###
# [...]
# avfilter_stubs.c: In function ‘ocaml_avfilter_buffersink_get_channels’:
# avfilter_stubs.c:382:3: warning: implicit declaration of function ‘av_buffersink_get_channels’ [-Wimplicit-function-declaration]
#    int channels = av_buffersink_get_channels((AVFilterContext *)_src);
#    ^
# avfilter_stubs.c: In function ‘ocaml_avfilter_buffersink_get_channel_layout’:
# avfilter_stubs.c:392:3: warning: implicit declaration of function ‘av_buffersink_get_channel_layout’ [-Wimplicit-function-declaration]
#    uint64_t layout = av_buffersink_get_channel_layout((AVFilterContext *)_src);
#    ^
# avfilter_stubs.c: In function ‘ocaml_avfilter_buffersink_get_sample_rate’:
# avfilter_stubs.c:402:3: warning: implicit declaration of function ‘av_buffersink_get_sample_rate’ [-Wimplicit-function-declaration]
#    int sample_rate = av_buffersink_get_sample_rate((AVFilterContext *)_src);
#    ^
toots commented 4 years ago

Hi!

It looks like your version of ffmpeg is too old. Looking at: https://pkgs.org/search/?q=ffmpeg ffmpeg packages for Centos 7 are version 2.x. I believe that you need at least 4.x for this binding to work.

luisogandob commented 4 years ago

@toots thanks for the help. I figured it out yesterday after compiling ffmpeg. Problem is with ffmpeg-devel libraries (libavcodec, libavfilters) available for Centos in Epel or Nux as you pointed out. Even so, i have no more advances with this cause after i installed ffmpeg-avfilter opam doesn't allow me to install liquidsoap cause incompatibility with ffmpeg. So, is there any way to install ffmpeg-avfilter from opam without sources? And, is not very clear to me, what do i need to use %ffmpeg like the example for HLS cause it was given me a Unsupported Format Error with default Opam installation method. Highly appreciate your help.

toots commented 4 years ago

You can do two combinations:

  1. Liquidsoap 1.4.1 with ffmpeg 0.4.1. These are the currently released version
  2. Liquisaoap master with ffmpeg master. The are the currently developed versions

If you want to use %ffmpeg with HLS, solution 1 is enough and easier.

Unsupported format errors can also happen if ffmpeg was compiled without support for a format that you are trying to use, typically libfdk_aac..

I'll close this issue, please feel free to follow-up on slack or by opening a new issue!