Former-commit-id: 347c1ab49424ba178efbf8c5422d63c7f675797f
TangShanKaiPing
wanggang 6 years ago
parent 5914e57a8b
commit eb0314a253

@ -104,6 +104,9 @@ namespace IoT.Shared.DeviceServices.Onvif
deviceInfoRepo.SaveChanges();
this.SendDeviceInfo(deviceInfo);
}
var deviceNodeRepo = scope.ServiceProvider.GetService<IRepository<Node>>();
var node = deviceNodeRepo.ReadOnlyTable().FirstOrDefault();
var deviceRepo = scope.ServiceProvider.GetService<IRepository<Device>>();
var device = deviceRepo.Table().Include(o => o.Data).FirstOrDefault(o => o.Number == ipCamera.Id);
if (device == null)
@ -115,7 +118,8 @@ namespace IoT.Shared.DeviceServices.Onvif
Icon = "camera",
CategoryNumber = "10",
InfoNumber = deviceInfoNumber,
InfoId = deviceInfo.Id
InfoId = deviceInfo.Id,
NodeId = node.Id
};
device.AddorUpdateData("mainrtmp", $"rtmp://{this._configuration["stream.rtmp"]}/live/main{ipCamera.Id}", DeviceDataType.String, "主码流rtmp");
device.AddorUpdateData("mainflv", $"http://{this._configuration["stream.flv"]}/live/main{ipCamera.Id}.flv", DeviceDataType.String, "主码流flv");

@ -13,6 +13,7 @@ namespace IoTNode
public static void Main(string[] args)
{
var host = "localhost";
var stream = "49.4.92.112";
WebHost.CreateDefaultBuilder(args)
.Run<Startup>(new List<EFConfigurationValue> {
new EFConfigurationValue { Id = "id", Value= "根据设备编号生成的授权码" },
@ -36,6 +37,15 @@ namespace IoTNode
new EFConfigurationValue { Id = "influxdb:url", Value= "http://localhost:8086"},
new EFConfigurationValue { Id = "influxdb:usr", Value= "admin"},
new EFConfigurationValue { Id = "influxdb:pwd", Value= "admin"},
new EFConfigurationValue { Id = "onvif.timer", Value="1"},
new EFConfigurationValue { Id = "onvif.speed", Value="0.2"},
new EFConfigurationValue { Id = "camera.usr", Value="admin"},
new EFConfigurationValue { Id = "camera.pwd", Value="dsideal123"},
new EFConfigurationValue { Id = "stream.rtmp", Value=stream},
new EFConfigurationValue { Id = "stream.flv", Value=$"{stream}:8080"},
new EFConfigurationValue { Id = "stream.hls", Value=$"{stream}:8080"},
new EFConfigurationValue { Id = "ffmpeg.args", Value=" -y -threads {0} -rtsp_transport tcp -use_wallclock_as_timestamps 1 -stimeout 3000000 -i \"{1}\" -fflags +genpts -c copy -f flv \"{2}\""},
new EFConfigurationValue { Id = "ffmpeg.file", Value="/usr/ffmpeg-rkmp/bin/ffmpeg"},
//
new EFConfigurationValue { Id = "name", Value= "物联网节点"},
new EFConfigurationValue { Id = "logo", Value= "/images/logo.png",Type= InputType.ImageUrl},

@ -24,7 +24,7 @@ namespace IoTNode
public override void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<ClientService>(); ;
services.AddSingleton<ClientService>();
services.AddSingleton<SerialPortService>();
services.AddSingleton<OnvifService>();
services.AddSingleton<FBeeService>();

@ -1,6 +0,0 @@
{
"version": "1.0",
"defaultProvider": "cdnjs",
"libraries": [
]
}
Loading…
Cancel
Save