Winform VlcControl shows black screen

37 Views Asked by At

I'm using Vlc.DotNet.Forms to play a webcam stream.

The vlcControl plays stream good on Windows 10, but if I copy the program to my Windows7 x64 PC,its video can not be played.But the sound came from the webcam could be heard. Strangely,the video stream could be played well in VLC Player, but not in vlcControl.
My Environment:
OS:Windows 7 x64
Vlc.DotNet.Forms version 3.1.0
vlclib version 3.0.20
Winform .net framework 4.5.2
Project build architecture : x64

My code below:
Initializing my vlcControl:

    this.vlcControl = new VlcControl();
    this.vlcControl.Dock = DockStyle.Fill;
    this.vlcControl.BackColor = System.Drawing.Color.Black;
    this.vlcControl.BeginInit();
    var currentDirectory = Directory.GetCurrentDirectory();
    this.vlcControl.VlcLibDirectory = new DirectoryInfo(currentDirectory + "\\libvlc\\win-x64\\");
    this.vlcControl.VlcMediaplayerOptions = new[] {
        "-vv",
#if DEBUG
        "-I",
        "dummy",
        "--ignore-config",
        "--extraintf=logger",
        "--verbose=2",
        "--file-logging",
        "--logfile=vlc-log.txt"
#endif
        };
    this.vlcControl.EndInit();

Playing the stream:

    var playUrl = await QueryPlayUrl(cameraIndexCode);
    var options = new string[]
    {
        ":vout=direct3d11",
    };
    this.vlcControl.Play(playUrl, options);

Could anybody help me with my issue? Thanks in advance.

I tried to dump the vlc's log:
-- logger module started --
main debug: VLC media player - 3.0.20 Vetinari
main debug: Copyright © 1996-2023 the VideoLAN team
main debug: revision 3.0.20-0-g6f0d0ab126
main debug: configured with /builds/videolan/vlc/extras/package/win32/../../../configure '--enable-update-check' '--enable-lua' '--enable-faad' '--enable-flac' '--enable-theora' '--enable-avcodec' '--enable-merge-ffmpeg' '--enable-dca' '--enable-mpc' '--enable-libass' '--enable-schroedinger' '--enable-realrtsp' '--enable-live555' '--enable-shout' '--enable-goom' '--enable-sse' '--enable-mmx' '--enable-libcddb' '--enable-zvbi' '--disable-telx' '--enable-nls' '--host=x86_64-w64-mingw32' '--with-contrib=../contrib/x86_64-w64-mingw32' '--with-breakpad=https://win.crashes.videolan.org' '--enable-qt' '--enable-skins2' '--enable-dvdread' '--enable-caca' 'host_alias=x86_64-w64-mingw32' 'CFLAGS= -D_WIN32_WINNT=0x0502 -DWINVER=0x502 -D__MSVCRT_VERSION__=0x700 ' 'CXXFLAGS= -D_WIN32_WINNT=0x0502 -DWINVER=0x502 -D__MSVCRT_VERSION__=0x700 ' 'PKG_CONFIG=pkg-config' 'PKG_CONFIG_LIBDIR=/usr/x86_64-w64-mingw32/lib/pkgconfig:/usr/lib/x86_64-w64-mingw32/pkgconfig'
main debug: using multimedia timers as clock source
main debug: min period: 1 ms, max period: 1000000 ms
main debug: searching plug-in modules
main debug: loading plugins cache file C:\Users\Administrator\Desktop\IM_Camera\Debug\libvlc\win-x64\plugins\plugins.dat
main debug: recursively browsing C:\Users\Administrator\Desktop\IM_Camera\Debug\libvlc\win-x64\plugins' main debug: plug-ins loaded: 497 modules main debug: looking for logger module matching "any": 2 candidates file debug: opening logfile vlc-log.txt'
main debug: using logger module "file"
main debug: translation test: code is "C"
main debug: looking for keystore module matching "memory": 3 candidates
main debug: using keystore module "memory"
main debug: CPU has capabilities MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 FPU
main debug: creating audio output
main debug: looking for audio output module matching "any": 6 candidates
mmdevice debug: using default device
mmdevice debug: display name changed: VLC media player (LibVLC 3.0.20)
mmdevice debug: version 2 session control unavailable
mmdevice debug: volume from -192.000000 dB to +0.000000 dB with 1.500000 dB increments
main debug: using audio output module "mmdevice"
main debug: keeping audio output
main debug: looking for interface module matching "logger,none": 16 candidates
logger error: The logger interface no longer exists.
logger: As of VLC version 0.9.0, use --file-logging to write logs to a file.
main debug: no interface modules matched
main error: no suitable interface module
main error: interface "logger,none" initialization failed
main debug: creating audio output
main debug: looking for audio output module matching "any": 6 candidates
mmdevice debug: using default device
mmdevice debug: version 2 session control unavailable
mmdevice debug: volume from -192.000000 dB to +0.000000 dB with 1.500000 dB increments
main debug: using audio output module "mmdevice"
main debug: keeping audio output
main debug: Creating an input for 'rtsp://xx.xx.xx.xx:554/openUrl/PWvKA5W'
main debug: using timeshift granularity of 50 MiB
main debug: using timeshift path: C:\Users\ADMINI~1\AppData\Local\Temp
main debug: rtsp://xx.xx.xx.xx:554/openUrl/PWvKA5W' gives access rtsp' demux any' path xx.xx.xx.xx:554/openUrl/PWvKA5W'
main debug: creating demux: access='rtsp' demux='any' location='xx.xx.xx.xx:554/openUrl/PWvKA5W' file='\xx.xx.xx.xx:554\openUrl\PWvKA5W'
main debug: looking for access_demux module matching "rtsp": 15 candidates
live555 debug: version 2016.11.28
live555 debug: RTP subsession 'video/H264'
main debug: selecting program id=0
live555 debug: setup start: 0.000000 stop:0.000000
live555 debug: We have a timeout of 8 seconds
live555 debug: play start: 0.000000 stop:0.000000
main debug: using access_demux module "live555"
main debug: looking for packetizer module matching "any": 25 candidates
main debug: using packetizer module "h264"
main debug: looking for video decoder module matching "any": 20 candidates
avcodec debug: using ffmpeg Lavc58.134.100
avcodec debug: CPU flags: 0x000fd3db
avcodec debug: allowing 6 thread(s) for decoding
avcodec debug: codec (h264) started
avcodec debug: using frame thread mode with 6 threads
main debug: using video decoder module "avcodec"
main debug: looking for meta reader module matching "any": 2 candidates lua debug: Trying Lua scripts in C:\Users\Administrator\AppData\Roaming\vlc\lua\meta\reader
lua debug: Trying Lua scripts in C:\Users\Administrator\Desktop\IM_Camera\Debug\libvlc\win-x64\lua\meta\reader
main debug: no meta reader modules matched
main debug: rtsp://xx.xx.xx.xx:554/openUrl/PWvKA5W' successfully opened main debug: Buffering 0% main debug: Buffering 1% main debug: Buffering 4% main debug: Buffering 8% h264 warning: waiting for SPS/PPS h264 warning: waiting for SPS/PPS main debug: Buffering 12% h264 warning: waiting for SPS/PPS h264 debug: found NAL_SPS (sps_id=0) main debug: Buffering 82% h264 debug: found NAL_PPS (pps_id=0 sps_id=0) main debug: Stream buffering done (1109 ms in 760 ms) main error: buffer deadlock prevented main debug: Decoder wait done in 0 ms main debug: killing decoder fourcc h264'
main debug: removing module "avcodec"
main debug: removing module "h264"
main debug: removing module "live555"
main debug: Program doesn't contain anymore ES
main debug: removing module "mmdevice"
main debug: exiting
main debug: no exit handler
main debug: removing all interfaces
main debug: destroying
main debug: deactivating the playlist
main debug: removing module "mmdevice"
main debug: deleting item `Playlist'
main debug: removing module "memory"
-- logger module stopped --

1

There are 1 best solutions below

2
cube45 On

First, Vlc.DotNet is no longer maintained. Second, don't pass vout option as that will conflict with the internal implementation. Also, you can remove -I dummy (doesn't do anything I know in libvlc), extraintf (which the log says it doesn't exist anymore) and --verbose=2 which is already set by -vv