当前位置:网站首页>What is the reason why the list of channels on the left side of easycvr video Plaza displays garbled codes?

What is the reason why the list of channels on the left side of easycvr video Plaza displays garbled codes?

2022-06-24 05:44:00 Tsingsee green rhino video

TSINGSEE Green rhino video cloud edge architecture products are connected to multi-level channels , A column menu will be displayed in the sidebar of the video square , The purpose is to make the distinction between channels clearer . Recently, we are testing EasyCVR Project time , The video square list is found to be garbled .

Because we first encountered such a problem , Not much experience , Therefore, only the binary information of garbled code can be used for troubleshooting . First, output the binary information to the file , Analyze :

Sort out the binary information so that the code can be processed in batches , The following data are obtained :

Use code to read files in batches , has “\r\n” and “,” style , Converting a string into a number , And stored in cache .

At this point we have all the binary data , You can see that there are some garbled codes, because there are GBK、 There are plenty of them UTF8, If it is UTF8 There is no problem with direct feedback displayed on the page , however GBK There will be problems . This is because UTF8 It is three bytes and one Chinese character , and GBK Is a function of two bytes , This is the biggest difference .

There's another reason , namely go Currently only supported UTF8, So deal with GBK Need to install go Third party library “simplifiedchinese”, In the use of go Own method “utf8.Valid” To judge whether it is UTF8 still GBK.UTF8 It is three bytes and one Chinese character , Therefore, it is necessary to judge buffer Otherwise it would be GBK.

The above analysis is completed , Based on the analysis of buffer There are many more in the back 0x00.

hold 0x00 The disturbed data is cleared , Prevent misjudgment . Use code interception .

complete go Transcoding format :

At this point, you can solve the problem of garbled code in the sidebar channel .EasyCVR The video security cloud service supports traditional webcams 、NVR、 Encoder 、SDK Other equipment , The compatibility of hardware devices is improved to the greatest extent , And it can be directly connected to Alibaba cloud 、 Tencent cloud 、 Hua Wei Yun 、 Qiniuyun and so on , Support S3 and Swift Interface object storage service , Simple configuration , More efficient deployment . If there is a need , Welcome to .

原网站

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

随机推荐