Sascha-L / WPF-MediaKit

Microsoft Public License
367 stars 117 forks source link

Library crashes when tries to show camera stream. #94

Open WrongBit opened 5 years ago

WrongBit commented 5 years ago

In WPF app I made VideoCaptureElement named 'camVideo'. In the code I do:

camVideo.VideoCaptureDevice = MultimediaUtil.VideoInputDevices[camIdx];

Previously this program worked, but a few week later I tried to check function again and... it crashes! Inner exception is:

Attempted to read or write protected memory. This is often an indication that other memory is corrupt. System.Exception {System.AccessViolationException}

Stack trace:

at DirectShowLib.ICaptureGraphBuilder2.RenderStream(DsGuid PinCategory, DsGuid MediaType, Object pSource, IBaseFilter pfCompressor, IBaseFilter pfRenderer) at WPFMediaKit.DirectShow.MediaPlayers.VideoCapturePlayer.SetupGraph() in c:\Dev\SideUtils\WPF-MediaKit-master\Source\DirectShow\MediaPlayers\VideoCapturePlayer.cs:line 369 at WPFMediaKit.DirectShow.MediaPlayers.VideoCapturePlayer.Play() in c:\Dev\SideUtils\WPF-MediaKit-master\Source\DirectShow\MediaPlayers\VideoCapturePlayer.cs:line 229 at WPFMediaKit.DirectShow.Controls.MediaElementBase.b__86_0() in c:\Dev\SideUtils\WPF-MediaKit-master\Source\DirectShow\Controls\MediaElementBase.cs:line 562

One of googled issues was... second monitor! (and this is exactly what changed - I got second LCD). But I cannot believe library so stupidly crashes on one of the popular config. Any ideas?

WrongBit commented 5 years ago

Seems I spot that idiotic "point of failure": BITNESS of your build! If you setup project for x86 (or "prefer 32 bit"), everything works fine. But in x64 mode program crashes! We live in 21st century, but MS still cannot make 3D subsystem 64-bit?? (DirectShow module)