Commit 7d27b60f by 鲁志-悦动

音视频流IP可以配置 And 在Replay页面显示跟踪框

parent 0388efc7
//------------------------------------------------------------------------------ 
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace XamlGeneratedNamespace {
/// <summary>
/// GeneratedInternalTypeHelper
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed class GeneratedInternalTypeHelper : System.Windows.Markup.InternalTypeHelper {
/// <summary>
/// CreateInstance
/// </summary>
protected override object CreateInstance(System.Type type, System.Globalization.CultureInfo culture) {
return System.Activator.CreateInstance(type, ((System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)
| (System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.CreateInstance)), null, null, culture);
}
/// <summary>
/// GetPropertyValue
/// </summary>
protected override object GetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, System.Globalization.CultureInfo culture) {
return propertyInfo.GetValue(target, System.Reflection.BindingFlags.Default, null, null, culture);
}
/// <summary>
/// SetPropertyValue
/// </summary>
protected override void SetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, object value, System.Globalization.CultureInfo culture) {
propertyInfo.SetValue(target, value, System.Reflection.BindingFlags.Default, null, null, culture);
}
/// <summary>
/// CreateDelegate
/// </summary>
protected override System.Delegate CreateDelegate(System.Type delegateType, object target, string handler) {
return ((System.Delegate)(target.GetType().InvokeMember("_CreateDelegate", (System.Reflection.BindingFlags.InvokeMethod
| (System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)), null, target, new object[] {
delegateType,
handler}, null)));
}
/// <summary>
/// AddEventHandler
/// </summary>
protected override void AddEventHandler(System.Reflection.EventInfo eventInfo, object target, System.Delegate handler) {
eventInfo.AddEventHandler(target, handler);
}
}
}
...@@ -10,11 +10,11 @@ none ...@@ -10,11 +10,11 @@ none
false false
2-725104376 21870986562
3947974750 31364711570
17-1462717611 17-1683084370
Themes\Generic.xaml;Widgets\FootballFieldPanel\FootballFieldPanel.xaml; Themes\Generic.xaml;Widgets\FootballFieldPanel\FootballFieldPanel.xaml;
True False
 C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\obj\x64\Debug\GeneratedInternalTypeHelper.g.cs
FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\Themes\Generic.xaml;; FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\Themes\Generic.xaml;;
FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\Widgets\FootballFieldPanel\FootballFieldPanel.xaml;; FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Common\Widgets\FootballFieldPanel\FootballFieldPanel.xaml;;
......
...@@ -12,6 +12,7 @@ using VIZ.FGOUT.Connection; ...@@ -12,6 +12,7 @@ using VIZ.FGOUT.Connection;
using VIZ.Framework.Common; using VIZ.Framework.Common;
using VIZ.Framework.Core; using VIZ.Framework.Core;
using System.Windows; using System.Windows;
using VIZ.Framework.Domain;
namespace VIZ.FGOUT.Module namespace VIZ.FGOUT.Module
{ {
...@@ -457,7 +458,7 @@ namespace VIZ.FGOUT.Module ...@@ -457,7 +458,7 @@ namespace VIZ.FGOUT.Module
private bool ExecuteRestartAlgorithm_StartUDP() private bool ExecuteRestartAlgorithm_StartUDP()
{ {
// 添加新的UDP管理器 // 添加新的UDP管理器
string clientIP = ApplicationDomainEx.IniStorage.GetValue<UdpConfig, string>(p => p.UDP_Algorithm_IP); string clientIP = ApplicationDomain.IniStorage.GetValue<UdpConfig, string>(p => p.UDP_Algorithm_IP);
// UDP算法IP, 如果该值不配置,那么会获取本机的第一个IPV4地址 // UDP算法IP, 如果该值不配置,那么会获取本机的第一个IPV4地址
if (string.IsNullOrWhiteSpace(clientIP)) if (string.IsNullOrWhiteSpace(clientIP))
{ {
...@@ -465,25 +466,29 @@ namespace VIZ.FGOUT.Module ...@@ -465,25 +466,29 @@ namespace VIZ.FGOUT.Module
} }
// 从配置文件中获取流的目标 // 从配置文件中获取流的目标
string streamIP = null; //string streamIP = null;
NDIStream ndiStream = VideoStreamManager.Get<NDIStream>(this.Support.ViewKey); string streamIP = ApplicationDomain.IniStorage.GetValue<UdpConfig, string>(p => p.UDP_Stream_IP);
// 尝试5次从流信息中获取流的IP if (string.IsNullOrWhiteSpace(streamIP))
int count = 0;
while (count < 5 && !string.IsNullOrWhiteSpace(this.Support.ViewConfig.StreamName))
{ {
NDIStreamInfo streamInfo = ndiStream.StreamInfos.FirstOrDefault(p => p.FullName == this.Support.ViewConfig.StreamName); NDIStream ndiStream = VideoStreamManager.Get<NDIStream>(this.Support.ViewKey);
// 尝试5次从流信息中获取流的IP
if (streamInfo == null) int count = 0;
while (count < 5 && !string.IsNullOrWhiteSpace(this.Support.ViewConfig.StreamName))
{ {
System.Threading.Thread.Sleep(1000); NDIStreamInfo streamInfo = ndiStream.StreamInfos.FirstOrDefault(p => p.FullName == this.Support.ViewConfig.StreamName);
++count;
continue;
}
streamIP = (streamInfo.Address ?? string.Empty).Split(':').FirstOrDefault()?.Trim(); if (streamInfo == null)
break; {
} System.Threading.Thread.Sleep(1000);
++count;
continue;
}
streamIP = (streamInfo.Address ?? string.Empty).Split(':').FirstOrDefault()?.Trim();
break;
}
}
AlgorithmStrategy strategy = ApplicationDomainEx.CsvContext.AlgorithmStrategys.FirstOrDefault(p => p.Type == this.Support.ViewConfig.StrategyType); AlgorithmStrategy strategy = ApplicationDomainEx.CsvContext.AlgorithmStrategys.FirstOrDefault(p => p.Type == this.Support.ViewConfig.StrategyType);
if (strategy == null) if (strategy == null)
......
...@@ -12,7 +12,6 @@ using VIZ.FGOUT.Storage; ...@@ -12,7 +12,6 @@ using VIZ.FGOUT.Storage;
using VIZ.Framework.Common; using VIZ.Framework.Common;
using VIZ.Framework.Connection; using VIZ.Framework.Connection;
using VIZ.Framework.Core; using VIZ.Framework.Core;
using VIZ.Framework.Domain;
namespace VIZ.FGOUT.Module namespace VIZ.FGOUT.Module
{ {
...@@ -23,6 +22,9 @@ namespace VIZ.FGOUT.Module ...@@ -23,6 +22,9 @@ namespace VIZ.FGOUT.Module
{ {
private readonly FrameBuffer _frameBuffer = new FrameBuffer(TimeSpan.FromSeconds(10)); private readonly FrameBuffer _frameBuffer = new FrameBuffer(TimeSpan.FromSeconds(10));
private readonly TrackingBoxInfoBuffer _trackingBoxInfoBuffer =
new TrackingBoxInfoBuffer(TimeSpan.FromSeconds(10));
/// <summary> /// <summary>
/// 重置3D鼠标 /// 重置3D鼠标
/// </summary> /// </summary>
...@@ -249,8 +251,22 @@ namespace VIZ.FGOUT.Module ...@@ -249,8 +251,22 @@ namespace VIZ.FGOUT.Module
dsExtend.DataStream.Write(lowResolutionData, 0, newLength); dsExtend.DataStream.Write(lowResolutionData, 0, newLength);
dsExtend.DataStream.Position = 0; dsExtend.DataStream.Position = 0;
//遍历跟踪框队列
Queue<TrackingBoxInfo> infoBuffers = _trackingBoxInfoBuffer.GetInfos();
List<TrackingBoxInfo> infos = new List<TrackingBoxInfo>();
if (infoBuffers.Count > 0)
{
foreach (var info in infoBuffers)
{
if (info.TimeCode == dse.TimeStamp)
{
infos.Add(info);
}
}
}
//如果是Start滑块在动 //如果是Start滑块在动
if (view.vm.IsStartValue) if (view.vm.IsStartValue)
StartTime = dse.TimeStamp; StartTime = dse.TimeStamp;
else if (view.vm.IsEndValue) else if (view.vm.IsEndValue)
EndTime = dse.TimeStamp; EndTime = dse.TimeStamp;
...@@ -261,7 +277,11 @@ namespace VIZ.FGOUT.Module ...@@ -261,7 +277,11 @@ namespace VIZ.FGOUT.Module
try try
{ {
var view3 = this.FindChild<NDIView>(Application.Current.MainWindow, NDIViewKeys.cam3); var view3 = this.FindChild<NDIView>(Application.Current.MainWindow, NDIViewKeys.cam3);
// 更新视频流
view3.video.UpdateVideoFrame(dsExtend, true); view3.video.UpdateVideoFrame(dsExtend, true);
// 更新视频控件跟踪框信息
if (infos.Count > 0)
view3.video.UpdateTrackingBox(infos);
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -380,6 +400,34 @@ namespace VIZ.FGOUT.Module ...@@ -380,6 +400,34 @@ namespace VIZ.FGOUT.Module
} }
} }
public class TrackingBoxInfoBuffer
{
private Queue<TrackingBoxInfo> buffer;
private int bufferSize;
private TimeSpan bufferDuration;
public TrackingBoxInfoBuffer(TimeSpan duration)
{
bufferDuration = duration;
bufferSize = duration.Seconds * 50;
buffer = new Queue<TrackingBoxInfo>(bufferSize);
}
public void AddInfo(TrackingBoxInfo frame)
{
buffer.Enqueue(frame);
// 如果缓冲区超过容量,则移除最旧的帧
if (buffer.Count > 500)
buffer.Dequeue();
}
public Queue<TrackingBoxInfo> GetInfos()
{
return buffer;
}
}
public class FrameBuffer public class FrameBuffer
{ {
//private Queue<Mat> buffer; //private Queue<Mat> buffer;
......
...@@ -153,6 +153,7 @@ namespace VIZ.FGOUT.Module ...@@ -153,6 +153,7 @@ namespace VIZ.FGOUT.Module
info.DrawingBorderColor = this.IsShowAlgorithmTargetBox ? this.DETECT_BOX_BORDER_COLOR : this.DETECT_BOX_BORDER_COLOR_TRANSPARENT; info.DrawingBorderColor = this.IsShowAlgorithmTargetBox ? this.DETECT_BOX_BORDER_COLOR : this.DETECT_BOX_BORDER_COLOR_TRANSPARENT;
info.TimeCode = msg.timecode; info.TimeCode = msg.timecode;
infos.Add(info); infos.Add(info);
_trackingBoxInfoBuffer.AddInfo(info);
} }
} }
......
C:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\obj\x64\Debug\GeneratedInternalTypeHelper.g.cs 
FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\NDIMainView\View\NDIMainView.xaml;; FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\NDIMainView\View\NDIMainView.xaml;;
FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\NDIPreviewView\View\NDIPreviewView.xaml;; FC:\Projects\FGOUT\VIZ.FGOUT\VIZ.FGOUT.Module\NDIPreviewView\View\NDIPreviewView.xaml;;
......
...@@ -43,5 +43,11 @@ namespace VIZ.FGOUT.Storage ...@@ -43,5 +43,11 @@ namespace VIZ.FGOUT.Storage
/// </summary> /// </summary>
[Ini(Section = "UDP", DefaultValue = "8001", Type = typeof(int))] [Ini(Section = "UDP", DefaultValue = "8001", Type = typeof(int))]
public string UDP_Algorithm_PORT { get; set; } public string UDP_Algorithm_PORT { get; set; }
/// <summary>
/// UDP音视频流IP
/// </summary>
[Ini(Section = "UDP", DefaultValue = "", Type = typeof(string))]
public string UDP_Stream_IP { get; set; }
} }
} }
This source diff could not be displayed because it is too large. You can view the blob instead.
2024-02-26 11:45:52,062 [1] INFO VIZ.Framework.Connection.UdpEndpointManagerExpand - 发送UDPJosn串:{"type":"RECONFIRM","start_time":2767009,"status":1} 2024-02-27 17:54:15,262 [1] INFO VIZ.Framework.Connection.UdpEndpointManagerExpand - 发送UDPJosn串:{"type":"REPLAY","start_time":0,"end_time":0,"status":1}
2024-02-26 11:45:52,913 [1] INFO VIZ.Framework.Connection.UdpEndpointManagerExpand - 发送UDPJosn串:{"type":"RECONFIRM","start_time":2767009,"status":1} 2024-02-27 17:54:15,267 [1] INFO VIZ.Framework.Connection.UdpEndpointManagerExpand - 发送UDPJosn串:{"type":"REPLAY","start_time":0,"end_time":0,"status":1}
2024-02-26 11:45:53,749 [1] INFO VIZ.Framework.Connection.UdpEndpointManagerExpand - 发送UDPJosn串:{"type":"RECONFIRM","start_time":2767009,"status":1} 2024-02-27 17:54:25,077 [1] INFO VIZ.Framework.Connection.UdpEndpointManagerExpand - 发送UDPJosn串:{"type":"REPLAY","start_time":0,"end_time":0,"status":0}
2024-02-26 11:46:33,351 [1] INFO VIZ.Framework.Connection.UdpEndpointManagerExpand - 发送UDPJosn串:{"type":"RECONFIRM","start_time":2767009,"status":1} 2024-02-27 17:54:25,083 [1] INFO VIZ.Framework.Connection.UdpEndpointManagerExpand - 发送UDPJosn串:{"type":"REPLAY","start_time":0,"end_time":0,"status":0}
2024-02-26 11:46:43,581 [1] INFO VIZ.Framework.Connection.UdpEndpointManagerExpand - 发送UDPJosn串:{"type":"RECONFIRM","start_time":2767009,"status":0}
2024-02-26 11:46:44,206 [1] INFO VIZ.Framework.Connection.UdpEndpointManagerExpand - 发送UDPJosn串:{"type":"RECONFIRM","start_time":2767009,"status":0}
2024-02-26 11:46:44,712 [1] INFO VIZ.Framework.Connection.UdpEndpointManagerExpand - 发送UDPJosn串:{"type":"RECONFIRM","start_time":2767009,"status":0}
2024-02-26 11:46:58,933 [1] INFO VIZ.Framework.Connection.UdpEndpointManagerExpand - 发送UDPJosn串:{"type":"RECONFIRM","start_time":2767009,"status":0}
2024-02-26 11:51:58,746 [1] INFO VIZ.Framework.Connection.UdpEndpointManagerExpand - 发送UDPJosn串:{"type":"REPLAY","start_time":0,"end_time":0,"status":1}
2024-02-26 11:51:58,747 [1] INFO VIZ.Framework.Connection.UdpEndpointManagerExpand - 发送UDPJosn串:{"type":"REPLAY","start_time":0,"end_time":0,"status":1}
2024-02-26 11:53:29,787 [1] INFO VIZ.Framework.Connection.UdpEndpointManagerExpand - 发送UDPJosn串:{"type":"REPLAY","start_time":0,"end_time":0,"status":0}
2024-02-26 11:53:29,787 [1] INFO VIZ.Framework.Connection.UdpEndpointManagerExpand - 发送UDPJosn串:{"type":"REPLAY","start_time":0,"end_time":0,"status":0}
2024-02-26 11:54:11,515 [1] INFO VIZ.FGOUT.Module.NDIMainViewModel - 快捷键:
2024-02-26 11:54:12,054 [1] INFO VIZ.FGOUT.Module.NDIMainViewModel - 快捷键:D6
2024-02-26 11:54:36,723 [1] INFO VIZ.FGOUT.Module.NDIMainViewModel - 快捷键:
2024-02-26 11:54:36,902 [1] INFO VIZ.FGOUT.Module.NDIMainViewModel - 快捷键:D3
2024-02-26 15:54:05,632 [1] INFO VIZ.Framework.Connection.UdpEndpointManagerExpand - 发送UDPJosn串:{"type":"RECONFIRM","start_time":2767009,"status":0}
...@@ -83,6 +83,8 @@ UDP_UESETTING_PORT=8888 ...@@ -83,6 +83,8 @@ UDP_UESETTING_PORT=8888
;UDP_Algorithm_IP=192.168.31.33 ;UDP_Algorithm_IP=192.168.31.33
;UDP算法端口 ;UDP算法端口
UDP_Algorithm_PORT=8001 UDP_Algorithm_PORT=8001
;UDP音视频流IP, 如果该值不配置,那么会从流中获取
;UDP_Stream_IP=192.168.31.70
; ============================================================ ; ============================================================
; === Algorithm === ; === Algorithm ===
; ============================================================ ; ============================================================
......
...@@ -83,6 +83,8 @@ UDP_UESETTING_PORT=8888 ...@@ -83,6 +83,8 @@ UDP_UESETTING_PORT=8888
;UDP_Algorithm_IP=192.168.31.33 ;UDP_Algorithm_IP=192.168.31.33
;UDP算法端口 ;UDP算法端口
UDP_Algorithm_PORT=8001 UDP_Algorithm_PORT=8001
;UDP音视频流IP, 如果该值不配置,那么会从流中获取
;UDP_Stream_IP=192.168.31.70
; ============================================================ ; ============================================================
; === Algorithm === ; === Algorithm ===
; ============================================================ ; ============================================================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment