0

I am using LibVLCSharp in a solution that includes some native projects. If I debug in Native or Mixed mode, then LibVLC(Sharp) seems to spew a lot of print statements. A sample of these print statements follows.

main spu text debug: looking for text renderer module matching "any": 3 candidates
'LibVLCSharp.Windows.Net40.Sample.exe' (Win32): Loaded 'C:\Windows\System32\DWrite.dll'. 
main vout display debug: VoutDisplayEvent 'resize' 1280x720
freetype spu text debug: Using DWrite backend
freetype spu text debug: DWrite_GetFamily(): family name: Arial
freetype spu text debug: DWrite_ParseFamily(): using font at index 0 with weight 400 for bold: 0, italic: 0
freetype spu text debug: DWrite_ParseFamily(): using font at index 1 with weight 700 for bold: 1, italic: 0
freetype spu text debug: DWrite_ParseFamily(): using font at index 2 with weight 400 for bold: 0, italic: 1
freetype spu text debug: DWrite_ParseFamily(): using font at index 3 with weight 700 for bold: 1, italic: 1
main spu text debug: using text renderer module "freetype"
main generic debug: looking for hw decoder module matching "any": 2 candidates
d3d11va generic warning: failed to get the 0 MatchingDeviceId (2)
d3d11va generic debug: different 1 device p vs P
d3d11va generic debug: different 2 device p vs P 

This is annoying and it also seems to slow down the loading/rendering. So I need a way to disable these print statements. They don't show up if I debug in Managed mode but that is insufficient for my purposes.

I have tried to dial down the verbosity of LibVLC(Sharp) every way that I can. I have tried at least all of the following mechanisms.

libVlc = new LibVLC("--verbose", "-1");
libVlc = new LibVLC("--verbose=-1");
libVlc = new LibVLC(false, "--verbose", "2");
libVlc = new LibVLC(false, "--verbose", "0");
libVlc = new LibVLC(false, "--verbose", "-1");
libVlc = new LibVLC(false, "--verbose=2");
libVlc = new LibVLC(false, "--verbose=0");
libVlc = new LibVLC(false, "--verbose=-1");
libVlc = new LibVLC(false, "--verbose=--1");
libVlc = new LibVLC(false, "--verbose", "2");
libVlc = new LibVLC(false, "--verbose", "0");
libVlc = new LibVLC(false, "--verbose", "-1");
libVlc = new LibVLC(false, "-q");
libVlc = new LibVLC(false, "--quiet");
libVlc = new LibVLC("-q");
libVlc = new LibVLC("--quiet");

None of that works. Can anyone please suggest a way to disable these verbose print statements?

I don't think it has anything to do with my code. I can reproduce the issue with the vanilla LibVLCSharp.Windows.Net40.Sample. The only thing that I need to change to get the debug prints to spew is the Debug mode. If I check the "Enable native code debugging" checkbox in the Debug properties of the project, it starts the spew.

enter image description here

Darren
  • 138
  • 6

1 Answers1

1

Seems like there is currently no way to change that.

https://github.com/videolan/vlc/blob/1b500a19695aa3e0c4179e89abccbe8e5bfce285/src/misc/messages.c#L134

Build your own VLC by removing this, or suggest a flag to avoid this line to be hit in libvlc's bugtracker at code.videolan.org

cube45
  • 3,429
  • 2
  • 24
  • 35
  • Thanks for the link to the file. That's helpful. But I don't think I need to ask for a flag to be added. There already seems to be a flag, OBJECT_FLAGS_QUIET. I think I just need to figure out how to properly set that flag as a consumer of LibVLCSharp. But, hopefully, knowing the name of the flag will help me figure out how to do that. – Darren Feb 11 '22 at 22:13
  • This flag was used by modules to disable further logging from them. This flag has been removed in vlc4, and there's no way for you to set it – cube45 Feb 12 '22 at 07:17
  • Seems to be `VLC_VERBOSE` env variable you can set as well. Still, some messages will always appear unless you patch the code. – mfkl Feb 14 '22 at 01:54
  • The log callbacks are not affected by the verbosity level, and I don't think they will apply here either unfortunately. Maybe that's a suggestion for libvlc. – cube45 Feb 14 '22 at 15:35