using AiQ_GUI; using Emgu.CV.Dai; using LibVLCSharp.Shared; using LibVLCSharp.WinForms; using System.IO; using System.Security.Policy; internal class VLC { public static LibVLC libVLC; static VLC() { // Ensure LibVLC is initialized before first use Core.Initialize(); libVLC = new LibVLC(); } public static string SnapshotPath = Path.Combine(LDS.MAVPath, "Mobile_ov_snapshot.png"); public static void Play(VideoView VLCVV) { var media = new Media(libVLC, $"rtsp://ADMIN:1234@{MainForm.Instance.CamOnTest.IP}:554/live/main", FromType.FromLocation); VLCVV.MediaPlayer.Play(media); } public static bool IsPLaying(VideoView VLCVV) { return VLCVV.MediaPlayer.IsPlaying; } public static void TakeSnapshot(VideoView VLCVV, string filename = "Mobile_ov_snapshot.png") { string path = Path.Combine(LDS.MAVPath, filename); VLCVV.MediaPlayer.TakeSnapshot(0, path, 1280, 720); } public static void Stop(VideoView VLCVV) { VLCVV.MediaPlayer.Stop(); } }