CLP1611.LiveStreamOp modified to issue an appropriate command for MJPEG RTP stream, VLC removed, ver. 2.16.656

This commit is contained in:
Milan Hanajik
2017-09-14 12:58:26 +02:00
parent 968faf9200
commit b06f4a5781
6 changed files with 11 additions and 49 deletions
@@ -505,7 +505,12 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
public IOperation LiveStreamOp(bool hiRes)
{
return new LiveStreamOp(this, Telnet, hiRes ? "clp/hrlivestream.sh" : "clp/livestream.sh");
int wid = hiRes ? 1280 : 640;
int hgh = hiRes ? 960 : 480;
string command = string.Format("/opt/vc/bin/raspivid -t 0 -cd MJPEG -w {0} -h {1} -fps 30 -b 8000000 -o - | gst-launch-1.0 fdsrc ! \"image/jpeg,framerate=30/1\" ! jpegparse ! rtpjpegpay ! udpsink host={2} port={3}",
wid, hgh, NetAdapter.IPAddress.ToString(), rtpUdpLocalPort);
return new LiveStreamOp(this, Telnet, command);
}
@@ -23,7 +23,6 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
public bool DisplayTerminal;
public bool UseTestImages;
public int TestImagesCount;
public string VlcExePath;
/// Private parameterless constructor invoked by all other (public) constructors
CameraCfg() { }
@@ -37,7 +36,6 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
HardwareAddress = 1;
UseTestImages = false;
TestImagesCount = 0;
VlcExePath = "C:\\Program Files (x86)\\VideoLAN\\VLC\\";
}
public string ToString(int i)
@@ -2,8 +2,6 @@
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Net;
using System.Net.Sockets;
using System.Windows.Forms;
using log4net;
using TBF.BenchControl.Generic;
@@ -76,7 +74,6 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
hwAddressTextBox.Text = config.HardwareAddress.ToString();
useTestImagesCheckBox.Checked = config.UseTestImages;
testImagesCountTextBox.Text = config.TestImagesCount.ToString();
vlcExePathTextBox.Text = config.VlcExePath;
displayTerminalCheckBox.Checked = config.DisplayTerminal;
}
@@ -87,7 +84,6 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
hwAddressTextBox.Enabled = true;
useTestImagesCheckBox.Enabled = true;
testImagesCountTextBox.Enabled = true;
vlcExePathTextBox.Enabled = true;
displayTerminalCheckBox.Enabled = true;
}
@@ -106,7 +102,6 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
{
config.TestImagesCount = int.Parse(testImagesCountTextBox.Text);
}
config.VlcExePath = vlcExePathTextBox.Text;
return flags;
}
@@ -134,11 +129,6 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format("'{0}' should be between 1 and 50", testImagesCountLabel.Text);
}
if (!System.IO.Directory.Exists(vlcExePathTextBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + string.Format("'{0}' is not correct", vlcExePathLabel.Text);
}
return flags;
}
@@ -42,8 +42,6 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
this.useTestImagesCheckBox = new System.Windows.Forms.CheckBox();
this.testImagesCountTextBox = new System.Windows.Forms.TextBox();
this.testImagesCountLabel = new System.Windows.Forms.Label();
this.vlcExePathTextBox = new System.Windows.Forms.TextBox();
this.vlcExePathLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// hwAddressTextBox
@@ -122,7 +120,7 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
//
this.useTestImagesCheckBox.AutoSize = true;
this.useTestImagesCheckBox.Enabled = false;
this.useTestImagesCheckBox.Location = new System.Drawing.Point(114, 183);
this.useTestImagesCheckBox.Location = new System.Drawing.Point(114, 156);
this.useTestImagesCheckBox.Name = "useTestImagesCheckBox";
this.useTestImagesCheckBox.Size = new System.Drawing.Size(101, 17);
this.useTestImagesCheckBox.TabIndex = 10;
@@ -132,7 +130,7 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
// testImagesCountTextBox
//
this.testImagesCountTextBox.Enabled = false;
this.testImagesCountTextBox.Location = new System.Drawing.Point(114, 205);
this.testImagesCountTextBox.Location = new System.Drawing.Point(114, 178);
this.testImagesCountTextBox.Name = "testImagesCountTextBox";
this.testImagesCountTextBox.Size = new System.Drawing.Size(46, 20);
this.testImagesCountTextBox.TabIndex = 12;
@@ -140,37 +138,18 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
// testImagesCountLabel
//
this.testImagesCountLabel.AutoSize = true;
this.testImagesCountLabel.Location = new System.Drawing.Point(28, 208);
this.testImagesCountLabel.Location = new System.Drawing.Point(28, 181);
this.testImagesCountLabel.Name = "testImagesCountLabel";
this.testImagesCountLabel.Size = new System.Drawing.Size(71, 13);
this.testImagesCountLabel.TabIndex = 11;
this.testImagesCountLabel.Text = "Images count";
//
// vlcExePathTextBox
//
this.vlcExePathTextBox.Enabled = false;
this.vlcExePathTextBox.Location = new System.Drawing.Point(114, 147);
this.vlcExePathTextBox.Name = "vlcExePathTextBox";
this.vlcExePathTextBox.Size = new System.Drawing.Size(288, 20);
this.vlcExePathTextBox.TabIndex = 9;
//
// vlcExePathLabel
//
this.vlcExePathLabel.AutoSize = true;
this.vlcExePathLabel.Location = new System.Drawing.Point(28, 150);
this.vlcExePathLabel.Name = "vlcExePathLabel";
this.vlcExePathLabel.Size = new System.Drawing.Size(65, 13);
this.vlcExePathLabel.TabIndex = 8;
this.vlcExePathLabel.Text = "vlc.exe path";
//
// CameraCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.hwAddressTextBox);
this.Controls.Add(this.hwAddressLabel);
this.Controls.Add(this.vlcExePathTextBox);
this.Controls.Add(this.vlcExePathLabel);
this.Controls.Add(this.testImagesCountTextBox);
this.Controls.Add(this.testImagesCountLabel);
this.Controls.Add(this.useTestImagesCheckBox);
@@ -201,7 +180,5 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
private System.Windows.Forms.CheckBox useTestImagesCheckBox;
private System.Windows.Forms.TextBox testImagesCountTextBox;
private System.Windows.Forms.Label testImagesCountLabel;
private System.Windows.Forms.TextBox vlcExePathTextBox;
private System.Windows.Forms.Label vlcExePathLabel;
}
}
@@ -12,8 +12,6 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
bool liveStreamCommandSent;
Process vlcProcess;
/// <summary>
/// Events: Event.None or Event.Error
/// </summary>
@@ -40,12 +38,6 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
telnet.Enqueue(new Telnet.Command(Telnet.CmdAction.SEND_STRING, command));
liveStreamCommandSent = true;
}
vlcProcess = new Process();
vlcProcess.StartInfo = new ProcessStartInfo(System.IO.Path.Combine(camera.CameraCfg.VlcExePath, "vlc.exe"));
vlcProcess.StartInfo.Arguments = string.Format("rtsp://{0}:8554/", camera.IPAddress);
vlcProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
vlcProcess.Start();
}
return Event.None;
}
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.16.655.1")]
[assembly: AssemblyFileVersion("2.16.655.1")]
[assembly: AssemblyVersion("2.16.656.1")]
[assembly: AssemblyFileVersion("2.16.656.1")]