Skip to content

Commit

Permalink
Adapt to new ffmpeg layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
toots committed Jan 7, 2020
1 parent 1bace5d commit da78b5d
Show file tree
Hide file tree
Showing 12 changed files with 113 additions and 68 deletions.
8 changes: 7 additions & 1 deletion Makefile.defs.in
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,13 @@ W_SDL=@W_TSDL@
W_SDL_TTF=@W_TSDL_TTF@
W_SDL_IMAGE=@W_TSDL_IMAGE@
W_GAVL=@W_GAVL@
W_FFMPEG=@W_FFMPEG@
W_FFMPEG_AVUTIL=@W_FFMPEG_AVUTIL@
W_FFMPEG_AV=@W_FFMPEG_AV@
W_FFMPEG_AVFILTER=@W_FFMPEG_AVFILTER@
W_FFMPEG_SWRESAMPLE=@W_FFMPEG_SWRESAMPLE@
W_FFMPEG_SWSCALE=@W_FFMPEG_SWSCALE@
W_FFMPEG_DECODER=@W_FFMPEG_DECODER@
W_FFMPEG_ENCODER=@W_FFMPEG_ENCODER@
W_CAMLIMAGES=@W_CAMLIMAGES@
W_GSTREAMER=@W_GSTREAMER@
W_FREI0R=@W_FREI0R@
Expand Down
50 changes: 44 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,37 @@ AC_CHECK_OCAML_BINDING([gavl])
# FFMPEG
#

AC_CHECK_OCAML_BINDING([ffmpeg])
AC_CHECK_OCAML_BINDING([ffmpeg-avutil])
AC_CHECK_OCAML_BINDING([ffmpeg-av])
AC_CHECK_OCAML_BINDING([ffmpeg-avcodec])
AC_CHECK_OCAML_BINDING([ffmpeg-avfilter])
AC_CHECK_OCAML_BINDING([ffmpeg-swresample])
AC_CHECK_OCAML_BINDING([ffmpeg-swscale])

if test -n "${W_FFMPEG_AV}" && test -n "${W_FFMPEG_AVFILTER}" &&
test -n "${W_FFMPEG_SWSCALE}" && test -n "${W_FFMPEG_SWRESAMPLE}"; then
W_FFMPEG_DECODER=yes
w_FFMPEG_DECODER=yes
b_FFMPEG_DECODER=true
else
W_FFMPEG_DECODER=""
w_FFMPEG_DECODER="no (require ffmpeg-av, ffmpeg-avfilter, ffmpeg-swscale and ffmpeg-swresample)"
b_FFMPEG_DECODER=false
fi

AC_SUBST(W_FFMPEG_DECODER)

if test -n "${W_FFMPEG_AV}" && test -n "${W_FFMPEG_SWSCALE}" && test -n "${W_FFMPEG_SWRESAMPLE}"; then
W_FFMPEG_ENCODER=yes
w_FFMPEG_ENCODER=yes
b_FFMPEG_ENCODER=true
else
W_FFMPEG_ENCODER=""
w_FFMPEG_ENCODER="no (require ffmpeg-av, ffmpeg-swscale and ffmpeg-swresample)"
b_FFMPEG_ENCODER=false
fi

AC_SUBST(W_FFMPEG_ENCODER)

#
# Jack
Expand Down Expand Up @@ -989,7 +1019,7 @@ cat <<EOMSG
* Supported input formats
- MP3 : $w_MAD
- AAC : $w_FAAD
- Ffmpeg : $w_FFMPEG
- Ffmpeg : $w_FFMPEG_DECODER
- Flac (native) : $w_FLAC
- Flac (ogg) : $w_FLAC_OGG
- Lastfm : $w_LASTFM
Expand All @@ -1001,7 +1031,7 @@ cat <<EOMSG

* Supported output formats
- FDK-AAC : $w_FDKAAC
- Ffmpeg : $w_FFMPEG
- Ffmpeg : $w_FFMPEG_ENCODER
- MP3 : $w_LAME
- MP3 (fixed-point) : $w_SHINE
- Opus : $w_OPUS
Expand All @@ -1017,6 +1047,7 @@ cat <<EOMSG
* Input / output
- ALSA : $w_ALSA
- AO : $w_AO
- FFmpeg : $w_FFMPEG_AV
- Icecast/Shoutcast : $w_CRY
- GStreamer : $w_GSTREAMER
- JACK : $w_BJACK
Expand All @@ -1026,14 +1057,15 @@ cat <<EOMSG
- SRT : $w_SRT

* Audio manipulation
- FFmpeg : $w_FFMPEG_SWRESAMPLE
- LADSPA : $w_LADSPA
- Lilv : $w_LILV
- Samplerate : $w_SAMPLERATE
- SoundTouch : $w_SOUNDTOUCH

* Video manipulation
- camlimages : $w_CAMLIMAGES
- FFmpeg : $w_FFMPEG
- FFmpeg : $w_FFMPEG_SWSCALE
- frei0r : $w_FREI0R
- Gavl : $w_GAVL
- SDL-image : $w_TSDL_IMAGE
Expand Down Expand Up @@ -1118,7 +1150,14 @@ variables {
ogg_flac-enabled: $b_FLAC_OGG
mad-enabled: $b_MAD
faad-enabled: $b_FAAD
ffmpeg-enabled: $b_FFMPEG
ffmpeg-avutil-enabled: $b_FFMPEG_AVUTIL
ffmpeg-av-enabled: $b_FFMPEG_AV
ffmpeg-avcodec-enabled: $b_FFMPEG_AVCODEC
ffmpeg-avfilter-enabled: $b_FFMPEG_AVFILTER
ffmpeg-swresample-enabled: $b_FFMPEG_SWRESAMPLE
ffmpeg-swscale-enabled: $b_FFMPEG_SWSCALE
ffmpeg-decoder-enabled: $b_FFMPEG_DECODER
ffmpeg-encoder-enabled: $b_FFMPEG_ENCODER
xmlplaylist-enabled: $b_XMLPLAYLIST
lastfm-enabled: $b_LASTFM
lame-enabled: $b_LAME
Expand All @@ -1139,7 +1178,6 @@ variables {
soundtouch-enabled: $b_SOUNDTOUCH
ladspa-enabled: $b_LADSPA
gavl-enabled: $b_GAVL
ffmpeg-enabled: $b_FFMPEG
frei0r-enabled: $b_FREI0R
camlimages-enabled: $b_CAMLIMAGES
dssi-enabled: $b_DSSI
Expand Down
4 changes: 2 additions & 2 deletions doc/content/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Libraries not developed by Savonet are:
| Dependency | Version |
| -------------- | ------------------------- |
| OCaml compiler | >= 4.08.0 |
| ocaml-dtools | >= 0.4.1 |
| ocaml-dtools | >= 0.4.2 |
| ocaml-duppy | >= 0.8.1 |
| ocaml-mm | >= 0.6.0 |
| ocaml-pcre | |
Expand All @@ -68,7 +68,7 @@ Libraries not developed by Savonet are:
| ocaml-dssi | >= 0.1.3 | DSSI sound synthesis |
| ocaml-faad | >= 0.5.0 | AAC stream decoding |
| ocaml-fdkaac | >= 0.3.1 | AAC(+) encoding |
| ocaml-ffmpeg | >= 0.2.0 | Video conversion using the ffmpeg library |
| ocaml-ffmpeg | >= 0.5.0 | Audio and video tools from the ffmpeg library |
| ocaml-flac | >= 0.2.0 | Flac and Ogg/Flac codec |
| ocaml-frei0r | >= 0.1.0 | Frei0r plugins |
| ocaml-gavl | >= 0.1.4 | Video conversion using the gavl library |
Expand Down
2 changes: 1 addition & 1 deletion doc/content/build.md.in
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Libraries not developed by Savonet are:
| ocaml-dssi | @dssi_version_descr@ | DSSI sound synthesis |
| ocaml-faad | @faad_version_descr@ | AAC stream decoding |
| ocaml-fdkaac | @fdkaac_version_descr@ | AAC(+) encoding |
| ocaml-ffmpeg | @ffmpeg_version_descr@ | Video conversion using the ffmpeg library |
| ocaml-ffmpeg | @ffmpeg_avutil_version_descr@ | Audio and video tools from the ffmpeg library |
| ocaml-flac | @flac_version_descr@ | Flac and Ogg/Flac codec |
| ocaml-frei0r | @frei0r_version_descr@ | Frei0r plugins |
| ocaml-gavl | @gavl_version_descr@ | Video conversion using the gavl library |
Expand Down
16 changes: 13 additions & 3 deletions liquidsoap.opam
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ for more information." {failure}
"✨ Congratulations on installing liquidsoap! ✨" {success}

"We noticed that you did not install any mp3 decoder. This is a feature most
users want. You might need to install the mad or ffmpeg package." {success & !mad-enabled & !ffmpeg-enabled}
users want. You might need to install the mad or ffmpeg package." {success & !mad-enabled & !ffmpeg-decoder-enabled}

"We noticed that you did not install any mp3 encoder. This is a feature most
users want. You might need to install the lame or shine package." {success & !lame-enabled & !shine-enabled}
Expand Down Expand Up @@ -73,7 +73,12 @@ depopts: [
"dssi"
"faad"
"fdkaac"
"ffmpeg"
"ffmpeg-avutil"
"ffmpeg-av"
"ffmpeg-avcodec"
"ffmpeg-avfilter"
"ffmpeg-swresample"
"ffmpeg-swscale"
"flac"
"frei0r"
"gavl"
Expand Down Expand Up @@ -115,7 +120,12 @@ conflicts: [
"dssi" {< "0.1.3"}
"faad" {< "0.5.0"}
"fdkaac" {< "0.3.1"}
"ffmpeg" {< "0.2.0"}
"ffmpeg-avutil" {< "0.5.0"}
"ffmpeg-av" {< "0.5.0"}
"ffmpeg-avcodec" {< "0.5.0"}
"ffmpeg-avfilter" {< "0.5.0"}
"ffmpeg-swresample" {< "0.5.0"}
"ffmpeg-swscale" {< "0.5.0"}
"flac" {< "0.2.0"}
"frei0r" {< "0.1.0"}
"gavl" {< "0.1.4"}
Expand Down
2 changes: 1 addition & 1 deletion m4/detect_binding.m4
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ AC_ARG_WITH([binding()-dir],
[--with-binding()-dir=path],
[look for ocaml-binding() library in "path" (autodetected by default)]))
m4_define([PKG_VERSION],m4_esyscmd([cat liquidsoap.opam | grep $1 | grep '<\|>' | sed 's/.*{[ ]*[<|>][=]\{0,1\}[ ]*"\([^"]*\)"[ ]*}/\1/' | tr -d '\r\n']))
m4_define([PKG_VERSION],m4_esyscmd([cat liquidsoap.opam | grep $1 | grep '<\|>' | head -n 1 | sed 's/.*{[ ]*[<|>][=]\{0,1\}[ ]*"\([^"]*\)"[ ]*}/\1/' | tr -d '\r\n']))
m4_define([VERSION_CHECK],[ifelse(PKG_VERSION,[],[],[ >= PKG_VERSION])])
[]binding()_version_descr="VERSION_CHECK"
Expand Down
10 changes: 5 additions & 5 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ ogg_muxer = \
audio_converters = \
converters/audio/native_audio_converter.ml \
$(if $(W_SAMPLERATE),converters/audio/libsamplerate_converter.ml) \
$(if $(W_FFMPEG),converters/audio/ffmpeg_audio_converter.ml)
$(if $(W_FFMPEG_SWRESAMPLE),converters/audio/ffmpeg_audio_converter.ml)

video_converters = \
converters/video_converter.ml \
converters/video/native_video_converter.ml \
$(if $(W_GAVL),converters/video/gavl_converter.ml) \
$(if $(W_FFMPEG),converters/video/ffmpeg_video_converter.ml)
$(if $(W_FFMPEG_SWSCALE),converters/video/ffmpeg_video_converter.ml)

decoders = \
decoder/metadata_decoder.ml \
decoder/wav_aiff_decoder.ml decoder/midi_decoder.ml \
decoder/image_decoder.ml decoder/image/ppm_decoder.ml \
decoder/external_decoder.ml decoder/raw_audio_decoder.ml \
decoder/id3v2_plug.ml \
$(if $(W_FFMPEG),decoder/ffmpeg_decoder.ml) \
$(if $(W_FFMPEG_DECODER),decoder/ffmpeg_decoder.ml) \
$(if $(W_FLAC),decoder/flac_decoder.ml) \
$(if $(W_FAAD),decoder/aac_decoder.ml) \
$(if $(W_OGG),decoder/ogg_decoder.ml) \
Expand Down Expand Up @@ -127,7 +127,7 @@ encoders = \
$(if $(W_SHINE),encoder/shine_encoder.ml) \
$(if $(W_LAME),encoder/lame_encoder_builtin.ml) \
$(if $(W_FLAC),encoder/flac_encoder.ml) \
$(if $(W_FFMPEG),encoder/ffmpeg_encoder.ml) \
$(if $(W_FFMPEG_ENCODER),encoder/ffmpeg_encoder.ml) \
$(if $(W_FDKAAC),encoder/fdkaac_encoder_builtin.ml) \
$(if $(W_TAGLIB),encoder/taglib_id3v2.ml) \
$(if $(W_GSTREAMER),encoder/gstreamer_encoder.ml)
Expand Down Expand Up @@ -184,7 +184,7 @@ tools = tools/extralib.ml tools/JSON.ml \
tools/file_watcher.ml tools/file_watcher_mtime.ml \
$(if $(W_DYNLINK),tools/dyntools.ml) \
configure.ml tools/console.ml tools/process_handler.ml \
$(if $(W_FFMPEG),tools/ffmpeg_config.ml) \
$(if $(W_FFMPEG_AVUTIL),tools/ffmpeg_config.ml) \
tools/http.ml \
$(if $(W_SSL),tools/https.ml) \
$(if $(W_OSX_SECURE_TRANSPORT),tools/https_secure_transport.ml) \
Expand Down
2 changes: 0 additions & 2 deletions src/converters/audio/ffmpeg_audio_converter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
*****************************************************************************)

module Swresample = FFmpeg.Swresample

module Resampler =
Swresample.Make (Swresample.FltPlanarBigArray) (Swresample.FltPlanarBigArray)

Expand Down
1 change: 0 additions & 1 deletion src/converters/video/ffmpeg_video_converter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
*****************************************************************************)

open Video_converter
open FFmpeg
module Img = Image.Generic
module P = Img.Pixel

Expand Down
Loading

0 comments on commit da78b5d

Please sign in to comment.