Yahweasel / libav.js

This is a compilation of the libraries associated with handling audio and video in ffmpeg—libavformat, libavcodec, libavfilter, libavutil, libswresample, and libswscale—for emscripten, and thus the web.
288 stars 18 forks source link

Is there a way to silence libav (set loglevel?) #39

Closed reinhrst closed 7 months ago

reinhrst commented 7 months ago

When running ffmpeg(), one can set log level (and avoid lots of messages in the console), by adding something like ["-hide_banner", "-loglevel", "error"].

I can't seem to find a similar setting when one uses the API to open a file (ff_init_demuxer_file()). Am I just overlooking something?

Yahweasel commented 7 months ago

I haven't yet exposed the appropriate functions, but only because nobody's asked for it until now. The appropriate function is av_log_set_level (and av_log_get_level to check the current value). It's trivial to add them; expect them upstream momentarily.

reinhrst commented 7 months ago

Very much appreciated, works like a charm

I'm sending a PR to add the constants to types.d.ts