TBF/CameraBinaryFiles2 folder with synchronization for SD v.2.x (!!! file upload NOK).

This commit is contained in:
Milan Hanajik 2020-10-28 15:29:21 +01:00
parent 483e2b4eb7
commit a2556bec35
9 changed files with 46 additions and 6 deletions

View File

@ -437,7 +437,21 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
{
scpClient.Connect();
if (sdCardVer.Length > 0 && sdCardVer[0] == '1')
DirectoryInfo dirInfo = null;
if (sdCardVer.Length > 0)
{
switch (sdCardVer[0])
{
case '1':
dirInfo = new DirectoryInfo(Path.Combine(System.Windows.Forms.Application.StartupPath, "CameraBinaryFiles"));
break;
case '2':
dirInfo = new DirectoryInfo(Path.Combine(System.Windows.Forms.Application.StartupPath, "CameraBinaryFiles2"));
break;
}
}
if (dirInfo != null)
{
///
/// Synchronize files in camera /home/tbf/clp directory with the files in "TBF/CameraBinaryFiles" project folder
@ -446,7 +460,6 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
{
sshClient.Connect();
DirectoryInfo dirInfo = new DirectoryInfo(Path.Combine(System.Windows.Forms.Application.StartupPath, "CameraBinaryFiles"));
SHA1 sha1calculator = SHA1.Create();
StringBuilder sha1str = new StringBuilder();
@ -467,14 +480,14 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
{
/// Copy a file to the camera if SHA1 sum is different of the file is missing
log.InfoFormat("{0}, IP={1}, Uploading file {2}", Name, IPAddress, fi.Name);
scpClient.Upload(fi, string.Format("clp/{0}", fi.Name));
scpClient.Upload(fi, string.Format("~/clp/{0}", fi.Name));
}
}
if (!sha1sumResponse.Contains(fi.Name))
{
/// Change file properties if it was a new file
string command = string.Format("chmod 755 clp/{0}", fi.Name);
string command = string.Format("chmod 755 ~/clp/{0}", fi.Name);
log.InfoFormat("{0}, IP={1}, Executing command '{2}'", Name, IPAddress, command);
sshClient.CreateCommand(command).Execute();
@ -723,8 +736,10 @@ namespace TBF.BenchControl.Network.Camera.CLP1611
{
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, rtpUdpLocalPort);
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, rtpUdpLocalPort);
//string command = string.Format("~/userland/build/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, rtpUdpLocalPort);
return new LiveStreamOp(this, Telnet, command);
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
/opt/vc/bin/raspivid -o - -t 0 | /usr/bin/cvlc stream:///dev/stdin --sout "#rtp{sdp=rtsp://:8554/}" :demux=h264

View File

@ -0,0 +1 @@
/opt/vc/bin/raspivid -w 640 -h 480 -fps 30 -o - -t 0 | /usr/bin/cvlc stream:///dev/stdin --sout "#rtp{sdp=rtsp://:8554/}" :demux=h264

View File

@ -0,0 +1,2 @@
/opt/vc/bin/raspivid -t 0 -cd MJPEG -w 1280 -h 960 -fps 30 -b 8000000 -o - | gst-launch-1.0 fdsrc ! "image/jpeg,framerate=40/1" ! jpegparse ! rtpjpegpay ! udpsink host=192.168.0.200 port=20000

View File

@ -3459,6 +3459,27 @@
<Content Include="CameraBinaryFiles\DiscoveryDaemon">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="CameraBinaryFiles2\DiscoveryDaemon">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="CameraBinaryFiles2\GrabImage">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="CameraBinaryFiles2\hrlivestream.sh">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="CameraBinaryFiles2\livestream.sh">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="CameraBinaryFiles2\Measurement">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="CameraBinaryFiles2\mjpegrtpstream.sh">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="CameraBinaryFiles2\RoiDetection">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="packages.config" />
<None Include="Properties\app.manifest">
<SubType>Designer</SubType>