diff --git a/projects/IoTNode/DeviceServices/Onvif/OnvifService.cs b/projects/IoTNode/DeviceServices/Onvif/OnvifService.cs index fdb52abb..fc30b987 100644 --- a/projects/IoTNode/DeviceServices/Onvif/OnvifService.cs +++ b/projects/IoTNode/DeviceServices/Onvif/OnvifService.cs @@ -144,9 +144,9 @@ namespace IoTNode.DeviceServices.Onvif this.UpdateData(deviceRepo, device, device.CreateData("Record", "否", DeviceDataType.String, "录像")); this.UpdateData(deviceRepo, device, device.CreateData("ffmpeg.file", file, DeviceDataType.String, "ffmpeg路径", hidden: true)); this.UpdateData(deviceRepo, device, device.CreateData("ffmpeg.args", this._cfg["ffmpeg.args"], DeviceDataType.String, "ffmpeg.args", hidden: true)); - this.UpdateData(deviceRepo, device, device.CreateData("rtmp", $"rtmp://{this._cfg["stream.rtmp"]}/live/{ipCamera.Id}", DeviceDataType.String, "rtmp")); - this.UpdateData(deviceRepo, device, device.CreateData("flv", $"http://{this._cfg["stream.flv"]}/live/{ipCamera.Id}.flv", DeviceDataType.String, "flv")); - this.UpdateData(deviceRepo, device, device.CreateData("hls", $"http://{this._cfg["stream.hls"]}/live/{ipCamera.Id}.m3u8", DeviceDataType.String, "hls")); + //this.UpdateData(deviceRepo, device, device.CreateData("rtmp", $"rtmp://{this._cfg["stream.rtmp"]}/live/{ipCamera.Id}", DeviceDataType.String, "rtmp")); + //this.UpdateData(deviceRepo, device, device.CreateData("flv", $"http://{this._cfg["stream.flv"]}/live/{ipCamera.Id}.flv", DeviceDataType.String, "flv")); + //this.UpdateData(deviceRepo, device, device.CreateData("hls", $"http://{this._cfg["stream.hls"]}/live/{ipCamera.Id}.m3u8", DeviceDataType.String, "hls")); } var profiles = this._onvifDeviceManagement.GetProfiles(ipCamera.DeviceUrl, ipCamera.MediaUrl); var needAuth = false; @@ -318,7 +318,7 @@ namespace IoTNode.DeviceServices.Onvif var rtspUrl = $"rtsp://{(needAuth ? $"{camera.UserName}:{camera.Password}@" : "")}{streamUri.Substring(7)}"; var fileName = $"ffmpeg-{Helper.Instance.GetRunTime()}{(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".exe" : "")}"; var file = camera.GetData("ffmpeg.file")?.Value; - var rtmp = camera.Data.FirstOrDefault(o => o.Key == "rtmp").Value; + var rtmp = $"rtmp://{this._cfg["stream.rtmp"]}/live/{camera.Number}"; //camera.Data.FirstOrDefault(o => o.Key == "rtmp").Value; Console.WriteLine(file); var arguments = camera.Data.FirstOrDefault(o => o.Key == "ffmpeg.args").Value; Process process = null; diff --git a/projects/IoTNode/Program.cs b/projects/IoTNode/Program.cs index 635bd4c9..e5c785ae 100644 --- a/projects/IoTNode/Program.cs +++ b/projects/IoTNode/Program.cs @@ -35,7 +35,7 @@ namespace IoTNode new EFConfigurationValue { Id = "server.urls", Value= "http://*:8002" }, new EFConfigurationValue { Id = "notify:enabled", Value= "true"}, new EFConfigurationValue { Id = "notify:host", Value= $"{host}:8011"}, - new EFConfigurationValue { Id = "timer.seconds", Value="600"}, + new EFConfigurationValue { Id = "timer.seconds", Value="300"}, new EFConfigurationValue { Id = "onvif.timer", Value="1"}, new EFConfigurationValue { Id = "onvif.speed", Value="0.2"}, new EFConfigurationValue { Id = "camera.usr", Value="admin"}, diff --git a/projects/WebApp/wwwroot/pages/iot/device/camera.html b/projects/WebApp/wwwroot/pages/iot/device/camera.html index 1945f0b5..73293b6c 100644 --- a/projects/WebApp/wwwroot/pages/iot/device/camera.html +++ b/projects/WebApp/wwwroot/pages/iot/device/camera.html @@ -258,8 +258,8 @@ }, computed: { url: function () { - //return location.protocol + '//' + location.hostname + location.pathname + 'music.flv'; - return getDeviceDataValue(this.device, 'flv'); + return location.protocol + '//' + location.hostname + '/live/' + this.device.number + '.flv'; + //return getDeviceDataValue(this.device, 'flv'); }, isFlvSupported: function () { return flvjs.isSupported();