The RTSP protocol network camera video cloud service platform EasyNVR is cascaded to the EasyGBS channel through the national standard GB28181 protocol to play video, how to solve the problem?

Everyone knows that EasyGBS can be cascaded. In the recent test, EasyNVR was cascaded to EasyGBS, and the channel of the EasyNVR platform was accessed through EasyGBS. It was found that the video channel was very confusing, and the corresponding channel names were the same, but the playback content was Inconsistent.

Problem phenomenon

As you can see from the figure below, the channel name in EasyGBS is different from the channel name of EasyNVR, but the content is the same. However, in the EasyNVR channel with the same channel name as EasyGBS, the content of another camera is being played.

81.png

82.png

83.png

analyse problem

This phenomenon only exists when EasyNVR is cascaded with EasyGBS, so it can be locked into EasyNVR cascaded with EasyGBS first.

We observe that the channel name and other information corresponding to each channel on the page are correct, and then play channels 1-9 on EasyGBS are all corresponding to EasyNVR, after channel 10 is exceeded, it will be wrong, and channel 11 is playing channel 1. Channel 12 plays channel 2. So we suspected that EasyGBS may be reversed into EasyNVR channel number error.

/**
反解通道ID
*/
func ParseChannelId(code string) (channelId int, err error) {
   var index int
   channelIdStr := code[len(code)-5:]
   for i, v := range channelIdStr {
      if string(v) != "0" {
         index = i
      }
   }
   channelId, err = strconv.Atoi(channelIdStr[index:])
   return channelId, err
}

EasyGBS sends a playback command to EasyNVR, and reverses the channel ID of EasyGBS to the channel ID of EasyNVR corresponding to EasyNVR.

Solve the problem

/**
反解通道ID
*/
func ParseChannelId(code string) (channelId int, err error) {
   var index int
   channelIdStr := code[len(code)-5:]
   for i, v := range channelIdStr {
      if string(v) != "0" {
         index = i
         break
      }
   }
   channelId, err = strconv.Atoi(channelIdStr[index:])
   return channelId, err
}

The effect after synchronizing the channel IDs of the two platforms:

84.png

80.png

Regarding the cascading of EasyGBS and EasyNVR video platforms, we have written a few blog posts before to introduce you, you can review: " How to register and cancel EasyNVR to EasyGBS ", " How EasyGBS realizes access to EasyNVR video channels " .

If any friends still have questions about this, please contact us to discuss. All video-related solutions can visit TSINGSEE Qingxi Video , you can contact us to get a demo solution, intuitive experience, or you can download and test by yourself .

EasyDarwin open source streaming media server is an open source streaming media platform framework developed and maintained by the domestic open source streaming media team TSINGSEE Qingxi Video. Since its creation and development in December 2012, it has expanded from the original single-service streaming media server form to the current open source project of the cloud platform architecture.

Guess you like

Origin blog.csdn.net/EasyGBS/article/details/108734482