Can't get anything but a black screen
Posted: 12 Dec 2018 03:31
... and I've searched every "black screen" thread I could find. This is my first attempt at using libVLC in a project (Windows, to be ported to Linux), and it's driving me nuts. Regardless of the media, all I can get is a black screen. The code is spread out over three C++ classes, but the sequence of calls into the libVLC is:
libvlc_new
libvlc_media_player_new
libvlc_media_new_path
libvlc_media_player_set_hwnd
libvlc_media_duplicate
libvlc_media_player_is_playing
libvlc_media_player_set_media
libvlc_media_player_play
Since important structure definition is missing from the header files, it is impossible to check the pointers at each step, but they look reasonable and I don't get any error reports. I first tried JPEG files, but realizing that VLC has trouble with a lot of JPEG's, I tried an MP4. No video, no sound. Trace output is:
Window creation:
m_window_handle = ::CreateWindow(TEXT("static"),
TEXT(" "),
WS_POPUP | WS_VISIBLE,
40,40, 640, 480,
// screensize.left, // Original measurements for full screen.
// screensize.top,
// screensize.right - screensize.left,
// screensize.bottom - screensize.top,
desktop, NULL, GetModuleHandle(NULL), 0);
libvlc_new called with following arguments on the most recent attempt:
const char *cmd_line_parms[] = {
"C:\\Development\\arduino\\Pammm\\bin\\Debug",
"--extraintf=logger",
"--verbose=2",
"--logfile=C:\\temp\\vlc.log",
"--no-directx-overlay",
// "--logmode=text"
// "--file-logging"
};
Other information that might be useful: development on Code::Blocks 17.12 with MinGW 5.1.0, 32-bit target, Windows 7 Professional (Microsoft's last halfway-decent OS), libVLC version 3.0.4. The files play fine on VLC of the same version. I would appreciate any suggestions, as I'm losing my hair.
libvlc_new
libvlc_media_player_new
libvlc_media_new_path
libvlc_media_player_set_hwnd
libvlc_media_duplicate
libvlc_media_player_is_playing
libvlc_media_player_set_media
libvlc_media_player_play
Since important structure definition is missing from the header files, it is impossible to check the pointers at each step, but they look reasonable and I don't get any error reports. I first tried JPEG files, but realizing that VLC has trouble with a lot of JPEG's, I tried an MP4. No video, no sound. Trace output is:
Code: Select all
[003b21e0] main libvlc debug: VLC media player - 3.0.4 Vetinari
[003b21e0] main libvlc debug: Copyright -¬ 1996-2018 the VideoLAN team
[003b21e0] main libvlc debug: revision 3.0.4-0-gf615db6332
[003b21e0] main libvlc debug: configured with ../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-dvdread' '--enable-shout' '--enable-goom' '--enable-caca' '--enable-qt' '--enable-skins2' '--enable-sse' '--enable-mmx' '--enable-libcddb' '--enable-zvbi' '--disable-telx' '--enable-nls' '--host=i686-w64-mingw32' '--with-breakpad=https://win.crashes.videolan.org' 'host_alias=i686-w64-mingw32' 'PKG_CONFIG_LIBDIR=/home/jenkins/workspace/vlc-release/windows/vlc-release-win32-x86/contrib/i686-w64-mingw32/lib/pkgconfig'
[003b21e0] main libvlc debug: using multimedia timers as clock source
[003b21e0] main libvlc debug: min period: 1 ms, max period: 1000000 ms
[003b21e0] main libvlc debug: searching plug-in modules
[003b21e0] main libvlc debug: loading plugins cache file C:\Development\arduino\Stroker\Pammm\bin\Debug\plugins\plugins.dat
[003b21e0] main libvlc warning: cannot read C:\Development\arduino\Stroker\Pammm\bin\Debug\plugins\plugins.dat: No such file or directory
[003b21e0] main libvlc debug: recursively browsing `C:\Development\arduino\Stroker\Pammm\bin\Debug\plugins'
[003b21e0] main libvlc debug: plug-ins loaded: 490 modules
[003b2388] main logger debug: looking for logger module matching "any": 2 candidates
[003b2388] main logger debug: using logger module "console"
[003b21e0] main libvlc debug: translation test: code is "C"
[0241bff8] main keystore debug: looking for keystore module matching "memory": 3 candidates
[0241bff8] main keystore debug: using keystore module "memory"
[003b21e0] main libvlc debug: CPU has capabilities MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 FPU
[0243c048] main playlist debug: creating audio output
[0243c288] main audio output debug: looking for audio output module matching "any": 6 candidates
[0243c288] mmdevice audio output debug: using default device
[0243c288] mmdevice audio output debug: version 2 session control unavailable
[0243c288] mmdevice audio output debug: display name changed: VLC media player (LibVLC 3.0.4)
[0243c288] mmdevice audio output debug: volume from -95.250000 dB to +0.000000 dB with 0.031250 dB increments
[0243c288] main audio output debug: using audio output module "mmdevice"
[0243c048] main playlist debug: keeping audio output
[02437860] main generic debug: creating audio output
[0243f848] main input debug: Creating an input for preparsing 'Debug--extraintf=logger'
[0243d908] main audio output debug: looking for audio output module matching "any": 6 candidates
[023b9d10] main meta fetcher debug: looking for meta fetcher module matching "any": 1 candidates
[0243d908] mmdevice audio output debug: using default device
[023b9d10] lua meta fetcher debug: Trying Lua scripts in C:\Users\Duane\AppData\Roaming\vlc\lua\meta\fetcher
[0243d908] mmdevice audio output debug: version 2 session control unavailable
[023b9d10] lua meta fetcher debug: Trying Lua scripts in C:\Development\arduino\Stroker\Pammm\bin\Debug\lua\meta\fetcher
[0243d908] mmdevice audio output debug: volume from -95.250000 dB to +0.000000 dB with 0.031250 dB increments
[023b9d10] main meta fetcher debug: no meta fetcher modules matched
[0243d908] main audio output debug: using audio output module "mmdevice"
[023b9d10] main art finder debug: looking for art finder module matching "any": 2 candidates
[02437860] main generic debug: keeping audio output
[023b9d10] lua art finder debug: Trying Lua scripts in C:\Users\Duane\AppData\Roaming\vlc\lua\meta\art
[02442a68] main input debug: Creating an input for 'All Summer In A Day Pt 2 - YouTube.mp4'
[023b9d10] lua art finder debug: Trying Lua scripts in C:\Development\arduino\Stroker\Pammm\bin\Debug\lua\meta\art
[02442a68] main input debug: using timeshift granularity of 50 MiB
[023b9d10] main art finder debug: no art finder modules matched
[02442a68] main input debug: using timeshift path: C:\Users\Duane\AppData\Local\Temp
[02442a68] main input debug: `file:///C:/pammmedia/1/All%20Summer%20In%20A%20Day%20Pt%202%20-%20YouTube.mp4' gives access `file' demux `any' path `/C:/pammmedia/1/All%20Summer%20In%20A%20Day%20Pt%202%20-%20YouTube.mp4'
[0242aa48] main input source debug: creating demux: access='file' demux='any' location='/C:/pammmedia/1/All%20Summer%20In%20A%20Day%20Pt%202%20-%20You
Tube.mp4' file='C:\pammmedia\1\All Summer In A Day Pt 2 - YouTube.mp4'
[02426a48] main demux debug: looking for access_demux module matching "file": 15 candidates
[02426a48] main demux debug: no access_demux modules matched
[0242cb28] main stream debug: creating access: file:///C:/pammmedia/1/All%20Summer%20In%20A%20Day%20Pt%202%20-%20YouTube.mp4
[0242cb28] main stream debug: (path: C:\pammmedia\1\All Summer In A Day Pt 2 - YouTube.mp4)
[0242cb28] main stream debug: looking for access module matching "file": 26 candidates
[0242cb28] main stream debug: using access module "filesystem"
[0242cc08] main stream debug: looking for stream_filter module matching "prefetch,cache_read": 24 candidates
[0242cc08] cache_read stream debug: Using stream method for AStream*
[0242cc08] cache_read stream debug: starting pre-buffering
[0242cc08] cache_read stream debug: received first data after 17 ms
[0242cc08] cache_read stream debug: pre-buffering done 1024 bytes in 0s - 24 KiB/s
[0242cc08] main stream debug: using stream_filter module "cache_read"
[0242cce8] main stream debug: looking for stream_filter module matching "any": 24 candidates
[0242cce8] lua stream debug: Trying Lua scripts in C:\Users\Duane\AppData\Roaming\vlc\lua\playlist
[0242cce8] lua stream debug: Trying Lua scripts in C:\Development\arduino\Stroker\Pammm\bin\Debug\lua\playlist
[0242cce8] main stream debug: no stream_filter modules matched
[02320230] main stream_directory debug: looking for stream_directory module matching "any": 1 candidates
[02320230] main stream_directory debug: no stream_directory modules matched
[0242aa48] main input source debug: attachment of directory-extractor failed for file:///C:/pammmedia/1/All%20Summer%20In%20A%20Day%20Pt%202%20-%20YouTube.mp4
[0242cce8] main stream debug: looking for stream_filter module matching "record": 24 candidates
[0242cce8] main stream debug: using stream_filter module "record"
[0242aa48] main input source debug: creating demux: access='file' demux='any' location='/C:/pammmedia/1/All%20Summer%20In%20A%20Day%20Pt%202%20-%20YouTube.mp4' file='C:\pammmedia\1\All Summer In A Day Pt 2 - YouTube.mp4'
[02426a48] main demux debug: looking for demux module matching "mp4": 55 candidates
[0242cce8] mp4 stream warning: unknown box type Xtra (incompletely loaded)
[0242cce8] mp4 stream debug: dumping root Box "root"
[0242cce8] mp4 stream debug: | + ftyp size 28 offset 0
[0242cce8] mp4 stream debug: | + moov size 195616 offset 28
[0242cce8] mp4 stream debug: | | + mvhd size 108 offset 36
[0242cce8] mp4 stream debug: | | + iods size 21 offset 144
[0242cce8] mp4 stream debug: | | + trak size 107541 offset 165
[0242cce8] mp4 stream debug: | | | + tkhd size 92 offset 173
[0242cce8] mp4 stream debug: | | | + mdia size 107441 offset 265
[0242cce8] mp4 stream debug: | | | | + mdhd size 32 offset 273
[0242cce8] mp4 stream debug: | | | | + hdlr size 66 offset 305
[0242cce8] mp4 stream debug: | | | | + minf size 107335 offset 371
[0242cce8] mp4 stream debug: | | | | | + smhd size 16 offset 379
[0242cce8] mp4 stream debug: | | | | | + dinf size 36 offset 395
[0242cce8] mp4 stream debug: | | | | | | + dref size 28 offset 403
[0242cce8] mp4 stream debug: | | | | | | | + url size 12 offset 419
[0242cce8] mp4 stream debug: | | | | | + stbl size 107275 offset 431
[0242cce8] mp4 stream debug: | | | | | | + stsd size 91 offset 439
[0242cce8] mp4 stream debug: | | | | | | | + mp4a size 75 offset 455
[0242cce8] mp4 stream debug: | | | | | | | | + esds size 39 offset 491
[0242cce8] mp4 stream debug: | | | | | | + stts size 24 offset 530
[0242cce8] mp4 stream debug: | | | | | | + stsc size 40 offset 554
[0242cce8] mp4 stream debug: | | | | | | + stsz size 102440 offset 594
[0242cce8] mp4 stream debug: | | | | | | + stco size 4672 offset 103034
[0242cce8] mp4 stream debug: | | + trak size 87019 offset 107706
[0242cce8] mp4 stream debug: | | | + tkhd size 92 offset 107714
[0242cce8] mp4 stream debug: | | | + mdia size 86919 offset 107806
[0242cce8] mp4 stream debug: | | | | + mdhd size 32 offset 107814
[0242cce8] mp4 stream debug: | | | | + hdlr size 66 offset 107846
[0242cce8] mp4 stream debug: | | | | + minf size 86813 offset 107912
[0242cce8] mp4 stream debug: | | | | | + vmhd size 20 offset 107920
[0242cce8] mp4 stream debug: | | | | | + dinf size 36 offset 107940
[0242cce8] mp4 stream debug: | | | | | | + dref size 28 offset 107948
[0242cce8] mp4 stream debug: | | | | | | | + url size 12 offset 107964
[0242cce8] mp4 stream debug: | | | | | + stbl size 86749 offset 107976
[0242cce8] mp4 stream debug: | | | | | | + stsd size 161 offset 107984
[0242cce8] mp4 stream debug: | | | | | | | + avc1 size 145 offset 108000
[0242cce8] mp4 stream debug: | | | | | | | | + avcC size 39 offset 108086
[0242cce8] mp4 stream debug: | | | | | | | | + btrt size 20 offset 108125
[0242cce8] mp4 stream debug: | | | | | | + stts size 24 offset 108145
[0242cce8] mp4 stream debug: | | | | | | + stss size 1908 offset 108169
[0242cce8] mp4 stream debug: | | | | | | + stsc size 8680 offset 110077
[0242cce8] mp4 stream debug: | | | | | | + stsz size 71296 offset 118757
[0242cce8] mp4 stream debug: | | | | | | + stco size 4672 offset 190053
[0242cce8] mp4 stream debug: | | + udta size 919 offset 194725
[0242cce8] mp4 stream debug: | | | + meta size 748 offset 194733
[0242cce8] mp4 stream debug: | | | | + hdlr size 33 offset 194745
[0242cce8] mp4 stream debug: | | | | + ilst size 703 offset 194778
[0242cce8] mp4 stream debug: | | | | | + gsst size 25 offset 194786
[0242cce8] mp4 stream debug: | | | | | | + data size 17 offset 194794
[0242cce8] mp4 stream debug: | | | | | + gstd size 30 offset 194811
[0242cce8] mp4 stream debug: | | | | | | + data size 22 offset 194819
[0242cce8] mp4 stream debug: | | | | | + gssd size 56 offset 194841
[0242cce8] mp4 stream debug: | | | | | | + data size 48 offset 194849
[0242cce8] mp4 stream debug: | | | | | + gspu size 152 offset 194897
[0242cce8] mp4 stream debug: | | | | | | + data size 144 offset 194905
[0242cce8] mp4 stream debug: | | | | | + gspm size 152 offset 195049
[0242cce8] mp4 stream debug: | | | | | | + data size 144 offset 195057
[0242cce8] mp4 stream debug: | | | | | + gshh size 280 offset 195201
[0242cce8] mp4 stream debug: | | | | | | + data size 272 offset 195209
[0242cce8] mp4 stream debug: | | | + Xtra size 163 offset 195481 (????)
[0242cce8] mp4 stream debug: | + mdat size 39840693 offset 195644
[02426a48] mp4 demux debug: unrecognized major media specification (mp42).
[02426a48] mp4 demux debug: found 2 tracks
[02426a48] mp4 demux debug: track[Id 0x1] read 1164 chunk
[02426a48] mp4 demux warning: STTS table of 1 entries
[02426a48] mp4 demux debug: track[Id 0x1] read 25605 samples length:594s
[02442a68] main input debug: selecting program id=0
[02426a48] mp4 demux debug: adding track[Id 0x1] audio (enable) language undef
[02426a48] mp4 demux debug: track[Id 0x2] read 1164 chunk
[02426a48] mp4 demux warning: STTS table of 1 entries
[02426a48] mp4 demux debug: track[Id 0x2] read 17819 samples length:594s
[02426a48] mp4 demux debug: adding track[Id 0x2] video (enable) language undef
[02426a48] main demux debug: using demux module "mp4"
[02442a68] main input debug: looking for a subtitle file in C:\pammmedia\1\
[02482370] main decoder debug: looking for audio decoder module matching "any": 23 candidates
[02482370] main decoder debug: using audio decoder module "faad"
[02467c90] main decoder debug: looking for video decoder module matching "any": 17 candidates
[02467c90] avcodec decoder debug: using ffmpeg Lavc58.6.103
[02467c90] avcodec decoder debug: CPU flags: 0x000853db
[02467c90] avcodec decoder debug: allowing 6 thread(s) for decoding
[02467c90] avcodec decoder debug: codec (h264) started
[02467c90] avcodec decoder debug: using frame thread mode with 6 threads
[02467c90] main decoder debug: using video decoder module "avcodec"
[0059f9a0] main demux meta debug: looking for meta reader module matching "any": 2 candidates
[0059f9a0] main demux meta debug: using meta reader module "taglib"
[02426a48] main demux debug: removing module "taglib"
[02442a68] main input debug: `file:///C:/pammmedia/1/All%20Summer%20In%20A%20Day%20Pt%202%20-%20YouTube.mp4' successfully opened
[02426a48] mp4 demux debug: track[Id 0x2] using Sync Sample Box (stss)
[02426a48] mp4 demux debug: stss gives 0 --> 0 (sample number)
[02442a68] main input debug: Buffering 0%
[02442a68] main input debug: Buffering 83%
[02442a68] main input debug: Stream buffering done (500 ms in 30 ms)
[02482370] faad decoder warning: decoded zero sample
[02467c90] avcodec decoder debug: available hardware decoder output format 119 (cuda)
[02437860] main generic debug: reusing audio output
[02467c90] avcodec decoder debug: available hardware decoder output format 53 (dxva2_vld)
[0244bb90] main generic debug: looking for aout stream module matching "any": 2 candidates
[02467c90] avcodec decoder debug: available hardware decoder output format 118 (d3d11va_vld)
[02467c90] avcodec decoder debug: available hardware decoder output format 174 (d3d11)
[0244bb90] wasapi generic debug: modified format
[02467c90] avcodec decoder debug: available software decoder output format 0 (yuv420p)
[02467c90] avcodec decoder debug: trying format d3d11va_vld
[0458aec0] main spu text debug: looking for text renderer module matching "any": 3 candidates
[0458aec0] freetype spu text warning: DirectWrite initialization failed. Falling back to GDI/Uniscribe
[0458aec0] main spu text debug: using text renderer module "freetype"
[0244bb90] wasapi generic debug: buffer size : 96000 frames
[045a91b8] main scale debug: looking for video converter module matching "any": 24 candidates
[0244bb90] wasapi generic debug: maximum latency: 10666600 ns
[045a91b8] swscale scale debug: 32x32 (32x32) chroma: YUVA -> 16x16 (16x16) chroma: RGBA with scaling using Bicubic (good quality)
[0244bb90] wasapi generic debug: default period : 10000000 ns
[045a91b8] main scale debug: using video converter module "swscale"
[0244bb90] wasapi generic debug: minimum period : 3000000 ns
[045cc2b8] main scale debug: looking for video converter module matching "any": 24 candidates
[0244bb90] main generic debug: using aout stream module "wasapi"
[045cc2b8] yuvp scale debug: YUVP to YUVA converter
[0243d908] main audio output debug: output 'f32l' 48000 Hz Stereo frame=1 samples/8 bytes
[045cc2b8] main scale debug: using video converter module "yuvp"
[023f7668] main volume debug: looking for audio volume module matching "any": 2 candidates
[0458a2e0] main video output debug: Deinterlacing available
[023f7668] main volume debug: using audio volume module "float_mixer"
[0458a2e0] main video output debug: deinterlace -1, mode auto, is_needed 0
[0243d908] main audio output debug: input 'f32l' 44100 Hz Stereo frame=1 samples/8 bytes
[045cc540] main audio filter debug: looking for audio filter module matching "scaletempo": 16 candidates
[023f7d48] main window debug: looking for vout window module matching "embed-hwnd,any": 3 candidates
[045cc540] scaletempo audio filter debug: format: 44100 rate, 2 nch, 4 bps, fl32
[023f7d48] main window debug: using vout window module "drawable"
[045cc540] scaletempo audio filter debug: params: 30 stride, 0.200 overlap, 14 search
[0059fac0] main inhibit debug: looking for inhibit module matching "any": 1 candidates
[045cc540] scaletempo audio filter debug: 1.000 scale, 1323.000 stride_in, 1323 stride_out, 1059 standing, 264 overlap, 617 search, 2204 queue, fl32 mode
[045cc540] main audio filter debug: using audio filter module "scaletempo"
[0243d908] main audio output debug: conversion: 'f32l'->'f32l' 44100 Hz->44100 Hz Stereo->Stereo
[0059fac0] main inhibit debug: using inhibit module "inhibit"
[0243d908] main audio output debug: conversion pipeline complete
[0458a2e0] main video output debug: Opening vout display wrapper
[0243d908] main audio output debug: conversion: 'f32l'->'f32l' 44100 Hz->44100 Hz Stereo->Stereo
[0242ec50] main vout display debug: looking for vout display module matching "any": 12 candidates
[0243d908] main audio output debug: conversion pipeline complete
[045d3488] main audio resampler debug: looking for audio resampler module matching "any": 3 candidates
[0242ec50] direct3d9 vout display debug: Using Direct3D9 Extended API!
[045d3488] main audio resampler debug: using audio resampler module "samplerate"
[0242ec50] direct3d9 vout display debug: creating Vout EventThread
[0242ec50] direct3d9 vout display debug: Win32VoutCreateWindow
[0242ec50] main vout display debug: VoutDisplayEvent 'resize' 480x360
[0242ec50] direct3d9 vout display debug: inclinometer not found. (hr=0x80070490)
m_window_handle = ::CreateWindow(TEXT("static"),
TEXT(" "),
WS_POPUP | WS_VISIBLE,
40,40, 640, 480,
// screensize.left, // Original measurements for full screen.
// screensize.top,
// screensize.right - screensize.left,
// screensize.bottom - screensize.top,
desktop, NULL, GetModuleHandle(NULL), 0);
libvlc_new called with following arguments on the most recent attempt:
const char *cmd_line_parms[] = {
"C:\\Development\\arduino\\Pammm\\bin\\Debug",
"--extraintf=logger",
"--verbose=2",
"--logfile=C:\\temp\\vlc.log",
"--no-directx-overlay",
// "--logmode=text"
// "--file-logging"
};
Other information that might be useful: development on Code::Blocks 17.12 with MinGW 5.1.0, 32-bit target, Windows 7 Professional (Microsoft's last halfway-decent OS), libVLC version 3.0.4. The files play fine on VLC of the same version. I would appreciate any suggestions, as I'm losing my hair.