oaubert / python-vlc

Python vlc bindings
GNU Lesser General Public License v2.1
382 stars 109 forks source link

log_set() by python-vlc module NOT all log message #191

Open DiazSo opened 3 years ago

DiazSo commented 3 years ago

Hi All,

why python-vlc log_set() does not get all log message while VLC is playing video? Does anyone have ideas?

when I try to use python-vlc to start VLC to play a video, I like to capture log message from VLC. But it seems NOT all log can be captured via log_set() API. for example : the code below shows log handler callback: def init(self, *args): from ctypes import cdll libc = ctypes.cdll.LoadLibrary("msvcrt") @vlc.CallbackDecorators.LogCb def log_handler(instance, log_level, ctx, fmt, va_list): bufferString = ctypes.create_string_buffer(16384) libc.vsprintf(bufferString, fmt, ctypes.cast(va_list, ctypes.c_void_p)) msg = bufferString.value.decode('utf-8') module, _file, _line = vlc.libvlc_log_get_context(ctx) module = module.decode('utf-8') print("LOG:",msg)

if args: instance = vlc.Instance(*args) self.media = instance.media_player_new() else: instance = vlc.Instance("--verbose 2") instance.log_set(log_handler, None) self.media = instance.media_player_new()

The messages DOES NOT display via log_set(): [000001a82756dd50] main audio output error: too low audio sample frequency (0) [000001a827803f70] main decoder error: failed to create audio output [000001a82756dd50] main audio output error: module not functional [000001a827803f70] main decoder error: failed to create audio output

the message below will display via log_set(): LOG: using default device LOG: version 2 session control unavailable LOG: looking for meta fetcher module matching "any": 1 candidates LOG: volume from -65.250000 dB to +0.000000 dB with 0.031250 dB increments LOG: using audio output module "mmdevice"