Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ffmpeg logs #1620

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ tools = tools/extralib.ml tools/JSON.ml tools/lifecycle.ml \
tools/stringView.ml tools/strings.ml tools/runtime_error.ml \
tools/utils.ml tools/doc.ml tools/plug.ml \
tools/rqueue.ml tools/unifier.ml \
$(if $(W_FFMPEG_AVDEVICE),tools/liqavdevice.ml) \
$(if $(W_LAME_DYN),tools/lame_dynlink.ml) \
$(if $(W_FDKAAC_DYN),tools/fdkaac_dynlink.ml) \
tools/wav_aiff.ml tools/tutils.ml \
Expand Down Expand Up @@ -239,6 +238,7 @@ builtins = lang/lang_builtins.ml lang/builtins_ref.ml \
liquidsoap_sources= \
tools/log.ml $(tools) converters/audio_converter.ml $(stream) \
$(if $(W_FFMPEG_AVUTIL),tools/ffmpeg_utils.ml) \
$(if $(W_FFMPEG_AVDEVICE),tools/liqavdevice.ml) \
converters/video_converter.ml \
decoder/decoder_utils.ml decoder/decoder.ml \
tools/liq_time.ml $(if $(W_POSIX_TIME2),tools/liq_posix_time.ml) \
Expand Down
8 changes: 4 additions & 4 deletions src/tools/ffmpeg_utils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ let conf_alpha =
Dtools.Conf.bool ~p:(conf_ffmpeg#plug "alpha") ~d:false
"Import and export alpha layers when converting to and from ffmpeg frames."

(*
let () =
Lifecycle.before_start (fun () ->
let log_start_atom =
Dtools.Init.make (fun () ->
let verbosity =
match conf_verbosity#get with
| "quiet" -> `Quiet
Expand All @@ -83,7 +82,8 @@ let () =
let level = conf_level#get in
Avutil.Log.set_level verbosity;
Avutil.Log.set_callback (fun s -> log#f level "%s" (String.trim s)))
*)

let () = Lifecycle.before_start (fun () -> Dtools.Init.exec log_start_atom)

let best_pts frame =
match Avutil.frame_pts frame with
Expand Down
1 change: 1 addition & 0 deletions src/tools/ffmpeg_utils.mli
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
open Mm

val log : Log.t
val log_start_atom : Dtools.Init.t
val conf_ffmpeg : Dtools.Conf.ut
val conf_log : Dtools.Conf.ut
val conf_verbosity : string Dtools.Conf.t
Expand Down
3 changes: 2 additions & 1 deletion src/tools/liqavdevice.ml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
let () = Avdevice.init ()
let () =
ignore (Dtools.Init.make ~after:[Ffmpeg_utils.log_start_atom] Avdevice.init)