private static void clientdata(IAsyncResult ar) { var client = ((UdpClient)ar.AsyncState); if (client == null || client.Client == null) { return; } var port = ((IPEndPoint)client.Client.LocalEndPoint).Port; if (client != null) { client.Close(); } if (!File.Exists(GStreamer.gstlaunch)) { var gstpath = GStreamer.LookForGstreamer(); if (File.Exists(gstpath)) { GStreamer.gstlaunch = gstpath; } else { if (CustomMessageBox.Show("A video stream has been detected, but gstreamer has not been configured/installed.\nDo you want to install/config it now? It will download in the background.", "GStreamer", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) { //CustomMessageBox.Show("Please download gstreamer 1.9.2 from [link;HERE;https://gstreamer.freedesktop.org/data/pkg/windows/1.9.2/gstreamer-1.0-x86-1.9.2.msi]\n And install it using the 'COMPLETE' option"); var output = Settings.GetDataDirectory() + "gstreamer-1.0-x86-1.9.2.zip"; Download.ParallelDownloadFile( "http://firmware.ardupilot.org/MissionPlanner/gstreamer/gstreamer-1.0-x86-1.9.2.zip", output); ZipArchive zip = new ZipArchive(File.OpenRead(output)); zip.ExtractToDirectory(Settings.GetDataDirectory()); zip.Dispose(); GStreamer.gstlaunch = GStreamer.LookForGstreamer(); if (!File.Exists(GStreamer.gstlaunch)) { return; } } else { return; } } } GStreamer.UdpPort = port; gst = GStreamer.Start(); }
private static void clientdata(IAsyncResult ar) { var client = ((UdpClient)ar.AsyncState); if (client == null || client.Client == null) { return; } var port = ((IPEndPoint)client.Client.LocalEndPoint).Port; if (client != null) { client.Close(); } //removeme GStreamer.LookForGstreamer(); if (!File.Exists(GStreamer.gstlaunch)) { var gstpath = GStreamer.LookForGstreamer(); if (File.Exists(gstpath)) { GStreamer.gstlaunch = gstpath; } else { if (CustomMessageBox.Show("A video stream has been detected, but gstreamer has not been configured/installed.\nDo you want to install/config it now?", "GStreamer", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) { CustomMessageBox.Show( "Please download gstreamer 1.9.2 from [link;HERE;https://gstreamer.freedesktop.org/data/pkg/windows/1.9.2/gstreamer-1.0-x86-1.9.2.msi]\n And install it using the 'COMPLETE' option"); if (GStreamer.getGstLaunchExe()) { } else { return; } } else { return; } } } GStreamer.UdpPort = port; gst = GStreamer.Start(); }
private static void clientdata(IAsyncResult ar) { var client = ((UdpClient)ar.AsyncState); if (client == null || client.Client == null) { return; } var port = ((IPEndPoint)client.Client.LocalEndPoint).Port; if (client != null) { client.Close(); } //removeme GStreamer.LookForGstreamer(); if (!File.Exists(GStreamer.gstlaunch)) { var gstpath = GStreamer.LookForGstreamer(); if (File.Exists(gstpath)) { GStreamer.gstlaunch = gstpath; } else { return; if (CustomMessageBox.Show("A video stream has been detected, but gstreamer has not been configured/installed.\nDo you want to config it now", "GStreamer", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) { if (GStreamer.getGstLaunchExe()) { } else { return; } } else { return; } } } GStreamer.UdpPort = port; GStreamer.Start(); }
private static void clientdata(IAsyncResult ar) { var client = ((UdpClient)ar.AsyncState); if (client == null || client.Client == null) { return; } var port = ((IPEndPoint)client.Client.LocalEndPoint).Port; if (client != null) { client.Close(); } if (!File.Exists(GStreamer.gstlaunch)) { var gstpath = GStreamer.LookForGstreamer(); if (File.Exists(gstpath)) { GStreamer.gstlaunch = gstpath; } else { if (CustomMessageBox.Show("A video stream has been detected, but gstreamer has not been configured/installed.\nDo you want to install/config it now?", "GStreamer", System.Windows.Forms.MessageBoxButtons.YesNo) == (int)System.Windows.Forms.DialogResult.Yes) { DownloadGStreamer(); if (!File.Exists(GStreamer.gstlaunch)) { return; } } else { return; } } } GStreamer.UdpPort = port; GStreamer.StartA("udpsrc port=" + port + " buffer-size=300000 ! application/x-rtp ! rtph264depay ! avdec_h264 ! videoconvert ! video/x-raw,format=BGRA ! appsink name=outsink"); }
public static void DownloadGStreamer() { ProgressReporterDialogue prd = new ProgressReporterDialogue(); ThemeManager.ApplyThemeTo(prd); prd.DoWork += sender => { GStreamer.DownloadGStreamer(((i, s) => { prd.UpdateProgressAndStatus(i, s); if (prd.doWorkArgs.CancelRequested) { throw new Exception("User Request"); } })); }; prd.RunBackgroundOperationAsync(); GStreamer.gstlaunch = GStreamer.LookForGstreamer(); }
private static void skyviper(object state) { try { if (Ping("192.168.99.1")) { log.Info("Detected a SkyViper IP"); bool skyviper = false; // skyviper rtsp try { var rtspclient = new TcpClient("192.168.99.1", 554); rtspclient.Close(); skyviper = true; } catch { } // skyviper video try { var test = new WebClient().DownloadString("http://192.168.99.1/"); if (test.Contains("SkyViper")) { skyviper = true; } } catch { } if (skyviper) { log.Info("Detected a SkyViper"); if (!File.Exists(GStreamer.gstlaunch)) { GStreamer.gstlaunch = GStreamer.LookForGstreamer(); if (GStreamer.gstlaunch == "") { if (CustomMessageBox.Show( "A video stream has been detected, but gstreamer has not been configured/installed.\nDo you want to install/config it now?", "GStreamer", System.Windows.Forms.MessageBoxButtons.YesNo) == (int)System.Windows.Forms.DialogResult.Yes) { DownloadGStreamer(); } } } //slave to sender clock and Pipeline clock time GStreamer.StartA("rtspsrc location=rtsp://192.168.99.1/media/stream2 debug=false buffer-mode=1 latency=100 ntp-time-source=3 ! application/x-rtp ! rtph264depay ! avdec_h264 ! videoconvert ! video/x-raw,format=BGRA ! appsink name=outsink"); /* * string url = "http://192.168.99.1/ajax/video.mjpg"; * * Settings.Instance["mjpeg_url"] = url; * * CaptureMJPEG.Stop(); * * CaptureMJPEG.URL = url; * * CaptureMJPEG.OnNewImage += FlightData.instance.CaptureMJPEG_OnNewImage; * * CaptureMJPEG.runAsync(); */ } } } catch (Exception ex) { log.Error(ex); } }