savonet / liquidsoap

Liquidsoap is a statically typed scripting general-purpose language with dedicated operators and backend for all thing media, streaming, file generation, automation, HTTP backend and more.
http://liquidsoap.info
GNU General Public License v2.0
1.35k stars 122 forks source link

If ffmpeg is disabled, `autocue.liq` reports warnings #3885

Open vitoyucepi opened 2 months ago

vitoyucepi commented 2 months ago

Describe the bug If I build liquidsoap without ffmpeg support, I get a bunch of warnings at startup.

2.2.x ``` At autocue.liq, line 119 char 14 - line 166 char 3: Warning 4: Unused variable r At autocue.liq, line 119 char 14 - line 166 char 3: Warning 4: Unused variable ratio At autocue.liq, line 119 char 14 - line 166 char 3: Warning 4: Unused variable timeout ```
2.3.x ``` At /usr/share/liquidsoap/libs/extra/autocue.liq, line 71 char 0 - line 131 char 3: def file.autocue.ebur128(~ratio=50., ~timeout=10., uri) = r = request.create(resolve_metadata=false, uri) ... end end Warning 4: Unused variable ratio At /usr/share/liquidsoap/libs/extra/autocue.liq, line 71 char 0 - line 131 char 3: def file.autocue.ebur128(~ratio=50., ~timeout=10., uri) = r = request.create(resolve_metadata=false, uri) ... end end Warning 4: Unused variable timeout ```

To Reproduce

  1. Build liquidsoap without ffmpeg.

    build config ``` * Liquidsoap version : 2.2.5+dev * Compilation options - Release build : false - Git SHA : (none) - OCaml version : 5.1.1 - OS type : Unix - Libs versions : angstrom=0.16.0 bigstringaf=0.9.1 bytes=[distributed with OCaml 4.02 or above] camlp-streams camomile.lib=2.0 cry=1.0.3 curl=0.9.2 dtools=0.4.5 dune-build-info=3.15.0 dune-private-libs.dune-section=3.15.0 dune-site=3.15.0 dune-site.private=3.15.0 duppy=0.9.4 fileutils=0.6.4 gen=1.1 liquidsoap-lang=2.2.5 liquidsoap-lang.console=2.2.5 liquidsoap_builtins liquidsoap_core liquidsoap_optionals liquidsoap_oss liquidsoap_runtime magic-mime=1.3.1 menhirLib=20231231 metadata=0.3.0 mm=0.8.5 mm.audio=0.8.5 mm.base=0.8.5 mm.image=0.8.5 mm.midi=0.8.5 mm.video=0.8.5 pcre=7.5.0 re=1.11.0 sedlex=3.2 seq=[distributed with OCaml 4.07 or above] stdlib-shims=0.3.0 str=5.1.1 stringext=1.6.0 threads=5.1.1 unix=5.1.1 uri=4.4.0 - architecture : amd64 - host : x86_64-pc-linux-musl - target : x86_64-pc-linux-musl - system : linux - ocamlopt_cflags : -O2 -fno-strict-aliasing -fwrapv -pthread -fPIC - native_c_compiler : gcc -O2 -fno-strict-aliasing -fwrapv -pthread -fPIC -D_FILE_OFFSET_BITS=64 - native_c_libraries : -lpthread * Configured paths - mode : posix - standard library : /usr/share/liquidsoap/libs - scripted binaries : /usr/share/liquidsoap/bin - rundir : /var/run/liquidsoap - logdir : /var/log/liquidsoap - camomile files : /usr/share/liquidsoap/camomile * Supported input formats - MP3 : no (requires mad) - AAC : no (requires faad) - Ffmpeg : no (requires ffmpeg) - Flac (native) : no (requires flac) - Flac (ogg) : no (requires ogg) - Opus : no (requires opus) - Speex : no (requires speex) - Theora : no (requires theora) - Vorbis : no (requires vorbis) * Supported output formats - FDK-AAC : no (requires fdkaac) - Ffmpeg : no (requires ffmpeg) - MP3 : no (requires lame) - MP3 (fixed-point) : no (requires shine) - Flac (native) : no (requires flac) - Flac (ogg) : no (requires ogg) - Opus : no (requires opus) - Speex : no (requires speex) - Theora : no (requires theora) - Vorbis : no (requires vorbis) * Tags - Taglib (ID3 tags) : no (requires taglib) - Vorbis : no (requires vorbis) * Input / output - ALSA : no (requires alsa) - AO : no (requires ao) - FFmpeg : no (requires ffmpeg) - GStreamer : no (requires gstreamer) - JACK : no (requires bjack) - OSS : yes - Portaudio : no (requires portaudio) - Pulseaudio : no (requires pulseaudio) - SRT : no (requires srt) * Audio manipulation - FFmpeg : no (requires ffmpeg) - LADSPA : no (requires ladspa) - Lilv : no (requires lilv) - Samplerate : no (requires samplerate) - SoundTouch : no (requires soundtouch) - StereoTool : no (requires ctypes-foreign) * Video manipulation - camlimages : no (requires camlimages) - FFmpeg : no (requires ffmpeg) - frei0r : no (requires frei0r) - ImageLib : no (requires imagelib) - SDL : no (requires tsdl-image & tsdl-ttf) * MIDI manipulation - DSSI : no (requires dssi) * Visualization - GD : no (requires gd) - Graphics : no (requires graphics) - SDL : no (requires tsdl-image & tsdl-ttf) * Additional libraries - FFmpeg filters : no (requires ffmpeg) - FFmpeg devices : no (requires ffmpeg) - inotify : no (requires inotify) - irc : no (requires irc-client-unix) - jemalloc : no (requires jemalloc) - lastfm : no (requires lastfm) - lo : no (requires lo) - memtrace : no (requires memtrace) - mem_usage : no (requires mem_usage) - osc : no (requires osc-unix) - ssl : no (requires ssl) - tls : no (requires tls-liquidsoap) - posix-time2 : no (requires posix) - windows service : no (requires winsvc) - YAML support : no (requires yaml) - XML playlists : no (requires xmlplaylist) * Monitoring - Prometheus : no (requires prometheus) ```

  1. Start liquidsoap with a simple script like output.dummy(sine()).
  2. Observe the warnings in the log.

Expected behavior No warnings. I'm not sure, but probably a bunch of ignore statements in the %else block would work.

Version details

Install method Opam

Common issues

3756, #3753.

Moonbase59 commented 2 months ago

Would probably need some graceful way to disable autocue in this case. All of autocue, autocue2 and autocue.cue_file rely on having ffmpeg.

vitoyucepi commented 2 months ago

@toots, this is now in 2.2.5.

toots commented 2 months ago

It was fixed by https://github.com/savonet/liquidsoap/pull/3870 in 2.2.x. I've kept the warnings around in main as a remainder to backport the autocue stuff there..

vitoyucepi commented 2 months ago

It was fixed by #3870 in 2.2.x.

Nope, I just built 004a3c7418f25c5004ecc99fc9b79a5bac2749ea and here's the warning:

At autocue.liq, line 176 char 14 - line 223 char 3:

Warning 4: Unused variable filename
At autocue.liq, line 176 char 14 - line 223 char 3:

Warning 4: Unused variable ratio
At autocue.liq, line 176 char 14 - line 223 char 3:

Warning 4: Unused variable timeout

https://github.com/savonet/liquidsoap/blob/004a3c7418f25c5004ecc99fc9b79a5bac2749ea/src/libs/autocue.liq#L215-L222

toots commented 2 months ago

ha yeah. Fix pushed.

Moonbase59 commented 2 months ago

Do we have a def for an external ffmpeg binary being available?

I guess I’d need to do the same for autocue.cue_file, but that relies on having a ffmpeg binary available.