视频智能分析平台EasyCVR接入视频对通道分组后通道仍显示为空如何修复?

2021-03-01 18:13:23 浏览数 (1)

作为TSINGSEE青犀视频开发的视频协议融合共享平台EasyCVR,我们一直在尽力拓宽更多的协议兼容,近期我们在原本的协议上又增加了RTMP,EasyCVR成为TSINGSEE青犀视频真正可以兼容市面常见协议的视频流媒体智能分析平台。

在测试EasyCVR分组功能期间,用户添加分组赋值通道过后,添加成功了,但是查看分组通道却显示为空。

此时sql语句为下图中内容:

通过检查sql语句发现是设备通道表名使用的是国标设备的表名,需要改为总的EasyCVR的表名,修改代码如下:

代码语言:javascript复制
       querysql := fmt.Sprintf(`label_id=%d`, labelid)
       selectstr := fmt.Sprintf(`%s.name as channel_name,%s.parent_device_id as parent_device_id,
       %s.online as channel_online,%s.channel_type as channel_type,
%s.snap_url as snap_url,%s.on_demand as on_demand,
%s.device_name as device_name,%s.channel_device_id as device_id,%s.channel_id as channel_id`, channelTableName, channelTableName, channelTableName,
              channelTableName, channelTableName, channelTableName, deviceTableName, labelChannelTableName, labelChannelTableName)
       joinstr := fmt.Sprintf(`left join %s on %s.channel_id=%s.channel_id 
       and %s.channel_device_id=%s.parent_device_id
       left join %s on %s.channel_device_id=%s.device_id`, channelTableName, labelChannelTableName,
              channelTableName, labelChannelTableName, channelTableName, deviceTableName, labelChannelTableName, deviceTableName)
 
       q := dbclient.Table(labelChannelTableName).
              Select(selectstr).
              Joins(joinstr).Where(querysql)
       session := sessions.Default(c)
 

再次查看分组显示正常:

此时sql语句如下:

代码语言:javascript复制
SELECT DBChannelInfo.name as channel_name,DBChannelInfo.parent_device_id as parent_device_id,
        DBChannelInfo.online as channel_online,DBChannelInfo.channel_type as channel_type,
DBChannelInfo.snap_url as snap_url,DBChannelInfo.on_demand as on_demand,
Device.device_name as device_name,t_label_channel.channel_device_id as device_id,t_label_channel.channel_id as channel_id FROM "t_label_channel" left join DBChannelInfo on t_label_channel.channel_id=DBChannelInfo.channel_id
        and t_label_channel.channel_device_id=DBChannelInfo.parent_device_id
        left join Device on t_label_channel.channel_device_id=Device.device_id WHERE (label_id=2)
 

EasyCVR按需灵活扩展、收缩资源,免去了插件安装、浏览器限定等条件,实现了无插件、多平台自由观看回放,并且支持阿里云、腾讯云、华为云、七牛云等,支持S3和Swift接口的对象存储服务。如果大家对EasyCVR视频平台感兴趣或者有测试需求,欢迎联系我们。

0 人点赞