当前位置:网站首页>Development and code analysis of easycvr national standard user defined streaming address function
Development and code analysis of easycvr national standard user defined streaming address function
2022-06-23 20:41:00 【Tsingsee green rhino video】
Security video cloud service platform EasyCVR As a mature and stable video distribution platform , There is no need to adjust the existing monitoring architecture , Support CDN Push flow , Flexible to adapt to the original architecture ; And flexible expansion on demand 、 Shrinking resources , No plug-in installation 、 Browser restrictions, etc , No plug-ins are implemented 、 Multi platform free viewing playback .
At some user sites , Appear in the EasyCVR There are different network segments in the devices connected to the , So we need to add a new feature , I.e. customized collection address , Distinguish the collection addresses of different devices .
Functional analysis , You need to edit the device , Provide interface for the front end , Then collect the incoming stream from the front end ip Record in the database , When the user plays , Find out , To the device .
Add the following code , First, add fields to the database , Record the device stream collection information during initialization . Then play and return .
q := db.SQLite.Model(models.Device{}).Where("`index`=?", device.DeviceID)
q.Find(&gbsdevs)
if len(gbsdevs) != 1 {
err = fmt.Errorf("device[%d] not found", device.DeviceID)
return
}
//[ transmission mode ]
gbsdevs[0].MediaTransport = device.Transport
//[ Enable ]
gbsdevs[0].Enable = device.Enable
db.SQLite.Model(models.Device{}).Save(gbsdevs[0])
//
sipDev := uas.Server.GetDevice(gbsdevs[0].ID)
if sipDev == nil {
err = fmt.Errorf("device[%s] not found", gbsdevs[0].ID)
return
}
gbschns := make([]*models.Channel, 0)After editing at the front end again , Then the back end plays , The custom stream address configuration takes effect .
边栏推荐
- [golang] how to clear slices gracefully
- [golang] quick review guide quickreview (VII) -- Interface
- Logstash start -r parameter
- The substring() method in. JS can be used to intercept all characters after the specified string
- Is it safe for Huatai Securities to open an account online for securities companies with low handling fees and commissions
- [open source] goravel (golang Web Framework) - new cache module
- How do I close and restore ports 135, 139 and 445?
- Leaders of Hangcheng street, Bao'an District and their delegation visited lianchengfa for investigation
- Yaokui tower in Fengjie, Chongqing, after its completion, will be the safety tower for Sichuan river shipping with five local scholars in the company
- [golang] quick review guide quickreview (IV) -- functions
猜你喜欢

35歲危機?內卷成程序員代名詞了…

Kubernetes resource topology aware scheduling optimization

GL Studio 5 installation and experience

UST 崩盘后,稳定币市场格局将迎来新机遇?

Zabbix监控- Aruba AP运行数据

LeetCode 260. Number III that appears only once

JS advanced programming version 4: generator learning

Technology sharing | wvp+zlmediakit realizes streaming playback of camera gb28181

After the collapse of UST, will the stable currency market pattern usher in new opportunities?

Open source SPL redefines OLAP server
随机推荐
What is the difference between a database and a cloud disk drive? What functions can cloud disk drives achieve?
What is the difference between object storage and cloud disk service? What are the functions of cloud disk service?
徽商期货交易软件正规吗?如何安全下载?
UGeek大咖说 | 可观测之超融合存储系统的应用与设计
Script tag attributes and & lt; noscript> label
Realize vscode to write markdown documents + pictures to be automatically uploaded to Tencent cloud cos
[golang] quick review guide quickreview (VIII) -- goroutine
@@Script implementation of ishell automatic deployment
【Golang】快速复习指南QuickReview(六)——struct
【Golang】深究字符串——从byte rune string到Unicode与UTF-8
Is Huishang futures trading software formal? How to download safely?
GL Studio 5 installation and experience
【Golang】怎么实现Go程序的实时热更新
Deep learning of handlebar handwriting (15): building your own corpus on hugging face
Tupu software digital twin intelligent water service, breaking through the development dilemma of sponge City
Kubernetes resource topology aware scheduling optimization
35歲危機?內卷成程序員代名詞了…
【Golang】快速复习指南QuickReview(二)——切片slice
Digital procurement transformation solution: SaaS procurement management platform promotes enterprise sunshine procurement
GL Studio 5 安装与体验