当前位置:网站首页>How to determine whether easycvr local streaming media is started successfully?

How to determine whether easycvr local streaming media is started successfully?

2022-06-24 01:53:00 Tsingsee green rhino video

EasyCVR Video protocol convergence platform not only supports the access of conventional protocol , We also expanded Haikang SDK、 Dahua SDK、Ehome Private agreement . If the front-end device protocol is different and the number is large , You can use the EasyCVR Platform to integrate and manage all video channels . and ,EasyCVR Provides a wealth of API Interface , Users can call through the interface document .

Some users propose to use EasyCVR When , It is not clear whether the local streaming media has been started successfully , You need to check in the process manager , Very inconvenient , You need to add streaming media startup information , It is displayed in the background server information .

We analyzed this demand , You can record whether the streaming media is successfully started when the program starts , Get the version , And running time .

Add the following code , To call the interface of streaming media , Get version information from it , And running time , Then put it into the program service interface and return it together .

apiPort := mediaserver.GetHttpApiPort()
resp, err := client.Get(fmt.Sprintf("http://127.0.0.1:%s/api/stat/info", apiPort))
if err != nil {
       c.IndentedJSON(http.StatusOK, ack)
       return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
       c.IndentedJSON(http.StatusOK, ack)
       return
}
params, err := values.NewValuesFromJSON(body)
if err != nil {
       c.IndentedJSON(http.StatusOK, ack)
       return
}

stay EasyCVR Background interface test , You can see that the streaming media information can be successfully obtained , This function was added successfully .

Video fusion cloud platform EasyCVR Set video online sharing 、 Storage 、 Streaming media forwarding 、 Video transcoding 、 Video on cloud 、 Intelligent analysis, unification and other functions are integrated , It has been running stably in many projects , Besides , Video related solutions can be accessed TSINGSEE Qingxi video , You can contact us for a demo , Intuitive feeling , You can also download and test it yourself , Welcome to know .

原网站

版权声明
本文为[Tsingsee green rhino video]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/11/20211111095959868O.html