0

I am running into an issue with my C# WPF application crashing silently when I am trying to play on 16 VideoViews. I did not see any error messaged popup, nor did I see anything in Windows Event viewer.

Each player instance have WindowsFormHost and hosting a VideoView in that and I am playing RTSP streams on them.

Crash time is not fixed, sometimes it crash after 2 hours, and sometimes after 7-8 hours.

            Core.Initialize(AppInfo.VlcDir.FullName);

            private LibVLC libVlc = null;
            private LibVLCSharp.Shared.MediaPlayer mediaPlayer = null;

            this.libVlc = new LibVLC(this.GetParsedPlayerOptions().ToArray());
            this.mediaPlayer = new LibVLCSharp.Shared.MediaPlayer(this.libVlc);
            this.videoPlayer.MediaPlayer = this.mediaPlayer;

            this.mediaPlayer.Volume = 0;
            this.mediaPlayer.EnableKeyInput = false;
            this.mediaPlayer.EnableMouseInput = false;

            // Then I added a bunch of event handlers for VideoView and MediaPlayer.

            // Then I have a different function which plays videos
            if (this.mediaPlayer != null)
            {
                var media = new Media(this.libVlc,GetPlaybackStreamUrl(this.Server), FromType.FromLocation);
                this.mediaPlayer.Media = media;
                this.mediaPlayer.Play();
                try
                {
                    media.Dispose();
                }
                catch
                {
                }
            }

Please let me know if you need any more information.

Any suggestions of what I could be doing wrong, or anything missing?

I am running on Windows 10. Visual Studio 2019, application compiled as X86.

I am not able to find the option to upload log file, but I did attach that to the issue on videolan forum, which can be found here: https://code.videolan.org/videolan/LibVLCSharp/-/issues/564

Thanks.

Harshvir
  • 21
  • 2
  • What exactly means "crashing"? Does the UI freeze? Or is the process killed? – Klaus Gütter Jun 21 '22 at 03:46
  • The process is killed. Sometimes I see an out of memory error and then it crashes, and sometimes its a silent kill, no error message, nothing in event log. – Harshvir Jun 21 '22 at 03:48
  • Start your app, start https://learn.microsoft.com/en-us/sysinternals/downloads/procdump, wait for your crash, and analyze your dump file. If you're lucky, you'll have the stack trace caught. But first analyze Event Viewer, if you have any reports about your app. – Maciek Świszczowski Jun 21 '22 at 09:59
  • Thanks @MaciekŚwiszczowski, I tried doing that, but I did not see any dumps recorded, the EXE was running and from the notes it looked like it registered for the dump file collection, and I also tried call with -u to uninstall as per the documents, but I did not see any dump files. – Harshvir Jun 23 '22 at 17:35
  • As far as I know. ProcDump is very stable and reliable, and used on production environments. Create a simple console which crashes after a short time, and test if ProcDump have rights to the folder where you want it to generate dumps. Catching unhandled exceptions with -e may also be useful for you, by the way. – Maciek Świszczowski Jun 24 '22 at 08:28

1 Answers1

0

I was not able to find the problem with the code or the crash stack for where it's dying. But I was able to fix the problem by increasing the address space, by using editbin to add /LARGEADDRESSSPACE to process post build.

Harshvir
  • 21
  • 2