设为首页收藏本站

AnyChat技术支持论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 23213|回复: 23
打印 上一主题 下一主题

AnyChat使用攻略之独立部署Linux中心录像服务器

[复制链接]

2

主题

79

帖子

612

积分

高级会员

Rank: 4

积分
612
跳转到指定楼层
楼主
发表于 2014-8-22 15:11:22 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
Windows平台中心录像服务器部署请参考http://bbs.anychat.cn/forum.php? ... d=20&extra=page%3D1

AnyChat for Linux SDK自V5.0的r4172版本开始支持Linux中心服务器录像(打开下载页,位于SDK包bin\recordserver目录下),支持服务器单独录像和服务器合成录像,集中保存,录像任务可由客户端发起,也可由业务服务器发起,录像完成之后,将录像文件名反馈给业务服务器,业务服务器可保存到数据库中便于集中维护。录像保存路径可设置。

下面一步一步介绍如何部署中心录像服务器,以及让中心录像服务器正常工作的注意事项:

一、下载AnyChat for Linux SDK包(要求V5.0的4172及以上版本),解压缩,部署核心服务器和业务服务器(参考:AnyChat使用攻略之独立部署Linux视频服务器),让客户端能与核心服务器,以及核心服务器与业务服务器之间能正常的工作。
启动核心服务器之后,查看核心服务器的日志文件(AnyChatCoreServer.log),显示内容如下:


二、进入SDK包的bin\recordserver目录,里面包含如下图所示的文件:


三、中心录像服务器参数配置。打开AnyChatRecordServer.ini配置文件,内容如下:
  1. [Base Settings]
  2. DebugMode=1
  3. ServerIpAddr=127.0.0.1
  4. ServerUdpPort=8907
  5. RecordRootDir=record
  6. RecordRootURL=
  7. ServerCallBackPathType=1
  8. ClientCallBackPathType=2
复制代码
配置项详细说明如下:
    DebugMode=[0,1] , 配置为0时,不在日志中输出相关的调试信息;为1时,可输出更多的调试信息,如录像开始,录像结束,录像文件名等,便于分析故障原因;      
    ServerIpAddr=127.0.0.1    ,配置核心服务器的IP地址,录像服务器与核心服务在同一台计算机时,默认为127.0.0.1
    ServerUdpPort=8907         , 配置核心服务器的UDP通信端口,默认为8907
    RecordRootDir=record       ,表示录像文件保存的本地根目录,可以为相对地址,如:RecordRootDir=record,表示当前录像服务器目录下的record子目录,也可以为绝对路径,如:RecordRootDir=/home/recordRecordRootURL= ,表示录像文件保存本地根目录的互联网访问地址,是一个URL地址,通过该URL地址,可以访问到中心录像服务器目录下的指定文件,通常需要在Web服务器(如Apache)中设置一个虚拟路径指向【RecordRootDir】,而【RecordRootURL】就是该虚拟路径;
    ServerCallBackPathType=[0,1,2] ,表示中心录像服务器完成录像之后,触发业务服务器回调事件中的路径类型:0 相对路径、1 绝对路径、2 URL路径;
    ClientCallBackPathType=[0,1,2] ,表示中心录像服务器完成录像之后,触发客户端回调事件中的路径类型:0 相对路径、1 绝对路径、2 URL路径;


四、启动中心录像服务器。运行runanychatrecordserver.sh,出现如下图所示的界面

若在日志中显示“Successfully connect to the anychatcoreserver!”则表示中心录像服务器与核心服务器连接成功,工作正常;否则请检查相关参数配置是否匹配,如AnyChatRecordServer.ini中的UDP端口和AnyChatCoreServer.ini中的UDP端口是否一致,另请检查程序的版本是否符合要求。

五、启动中心录像。客户端调用API:BRAC_StreamRecordCtrl(...),或是业务服务器调用API:BRAS_StreamRecordCtrl(...)可启动或停止对目标用户的录像任务,停止录像之后,若录像成功,则会在业务服务器上触发相应的回调函数调用。


六、注意事项:
    1、由于早期的授权证书不支持中心录像服务器,若希望使用该功能(为可选模块),请与我们的商务人员联系升级授权证书;
    2、在中心服务器录像过程中,客户端网络异常掉线将会中断录像,并触发业务服务器的录像回调函数;
    3、停止录像、用户注销等操作与业务服务器触发录像回调函数的时机是异步的过程,在业务服务器编程时需要考虑这种时间差的因素,可能存在先触发用户注销的回调,然后再触发录像完成的回调;


关于回调事件路径类型:
0    相对路径,形如:2014-08-31/12-08-31-074_AnyChat4_53.mp4
1    绝对路径,形如:d:\record\2014-08-31\12-08-31-074_AnyChat4_53.mp4
2    URL路径,形如:http://www.anychat.cn/record/2014-08-31/12-08-31-074_AnyChat4_53.mp4

默认配置中:
【ServerCallBackPathType=1】表示业务服务器回调事件中返回绝对路径
【ClientCallBackPathType=2】表示客户端回调事件中返回URL地址,便于客户端可以直接通过该URL地址访问中心录像服务器上面的文件;

参考:
1、AnyChat音视频录制整体解决方案
2、有关中心录像服务器配置项【RecordRootURL】的说明


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

9

主题

43

帖子

135

积分

注册会员

Rank: 2

积分
135
24#
发表于 2016-12-12 11:09:01 | 只看该作者
佰锐科技-邵光清 发表于 2016-12-12 10:53
你好,把录像、核心都升级到最新的版本可以解决这个问题;

真的,已搞定
回复 支持 反对

使用道具 举报

23#
发表于 2016-12-12 10:53:12 | 只看该作者
LCL5555555 发表于 2016-12-12 10:44
[2016-12-12 09:05:47(296)]      Lost the connection to the server(errorcode:100, param:10), ready  ...

你好,把录像、核心都升级到最新的版本可以解决这个问题;
回复 支持 反对

使用道具 举报

9

主题

43

帖子

135

积分

注册会员

Rank: 2

积分
135
22#
发表于 2016-12-12 10:44:38 | 只看该作者
佰锐科技-邵光清 发表于 2016-12-12 10:38
请将bin/recordserver/log目录下的anychatrecorddetail_20161212.log发上来一下,谢谢

[2016-12-12 09:05:47(296)]      Lost the connection to the server(errorcode:100, param:10), ready to reconnect...
[2016-12-12 09:05:47(306)]      Try connect to anychatcoreserver(127.0.0.1:8907)...
[2016-12-12 09:06:31(612)]      Successfully connect to the anychatcoreserver(127.0.0.1:8907)!
[2016-12-12 09:09:02(146)]      AnyChat Record Server Init,V6.1, Build Time:Jun 30 2016 15:26:46
[2016-12-12 09:09:02(146)]      Record Root Directory: /home/dave/anychat/anychatcoresdk_linux_x64_r5596/bin/recordserver/record/
[2016-12-12 09:09:02(146)]      Record Stream Buffer Time: 10000 ms
[2016-12-12 09:09:02(146)]      DebugLevel:3, DebugFlags:0x0
[2016-12-12 09:09:02(146)]      Ready to connect anychatcoreserver  127.0.0.1(8907)....
[2016-12-12 09:09:02(146)]      Load libmediautil.so success!(V6.1 Build Time:Jun 30 2016 15:25:03)
[2016-12-12 09:09:02(146)]      Start cluster bus connect: 127.0.0.1:8910
[2016-12-12 09:09:03(148)]      Try connect to anychatcoreserver(127.0.0.1:8907)...
[2016-12-12 09:09:03(150)]      Successfully connect to the anychatcoreserver(127.0.0.1:8907)!
[2016-12-12 09:57:54(752)]      AnyChat Record Server Init,V6.1, Build Time:Jun 30 2016 15:26:46
[2016-12-12 09:57:54(752)]      Record Root Directory: /home/dave/anychat/anychatcoresdk_linux_x64_r5596/bin/recordserver/record/
[2016-12-12 09:57:54(752)]      Record Stream Buffer Time: 10000 ms
[2016-12-12 09:57:54(752)]      DebugLevel:4, DebugFlags:0x1
[2016-12-12 09:57:54(752)]      Ready to connect anychatcoreserver  127.0.0.1(8907)....
[2016-12-12 09:57:54(752)]      Load libmediautil.so success!(V6.1 Build Time:Jun 30 2016 15:25:03)
[2016-12-12 09:57:55(753)]      Try connect to anychatcoreserver(127.0.0.1:8907)...
[2016-12-12 09:57:55(762)]      Successfully connect to the anychatcoreserver(127.0.0.1:8907)!
回复 支持 反对

使用道具 举报

21#
发表于 2016-12-12 10:38:28 | 只看该作者
LCL5555555 发表于 2016-12-12 10:19
[2016-12-09 19:18:09(165)]        AnyChat Record Server Init,V6.1, Build Time:Jun 30 2016 15:26:46
[2016 ...

请将bin/recordserver/log目录下的anychatrecorddetail_20161212.log发上来一下,谢谢
回复 支持 反对

使用道具 举报

249

主题

2967

帖子

9078

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
9078
20#
发表于 2016-12-12 10:37:50 | 只看该作者
AnyChat Record Server Init,V6.1, Build Time:Jun 30 2016 15:26:46

亲,把录像、核心都升级到最新的版本,看问题是否依然存在?新版本针对录像服务器做了大量的优化工作。
回复 支持 反对

使用道具 举报

9

主题

43

帖子

135

积分

注册会员

Rank: 2

积分
135
19#
发表于 2016-12-12 10:19:36 | 只看该作者
佰锐科技-邵光清 发表于 2016-12-12 10:15
请将anychatrecordserver的日志发来分析,谢谢

[2016-12-09 19:18:09(165)]        AnyChat Record Server Init,V6.1, Build Time:Jun 30 2016 15:26:46
[2016-12-09 19:18:09(165)]        Record Root Directory: /home/dave/anychat/anychatcoresdk_linux_x64_r5596/bin/recordserver/record/
[2016-12-09 19:18:09(165)]        Record Stream Buffer Time: 10000 ms
[2016-12-09 19:18:09(165)]        DebugLevel:3, DebugFlags:0x0
[2016-12-09 19:18:09(165)]        Ready to connect anychatcoreserver  127.0.0.1(8907)....
[2016-12-09 19:18:09(166)]        Load libmediautil.so success!(V6.1 Build Time:Jun 30 2016 15:25:03)
[2016-12-09 19:18:09(166)]        Start cluster bus connect: 127.0.0.1:8910
[2016-12-09 19:18:10(170)]        Try connect to anychatcoreserver(127.0.0.1:8907)...
[2016-12-09 19:18:10(170)]        Successfully connect to the anychatcoreserver(127.0.0.1:8907)!
[2016-12-12 09:05:47(296)]        Lost the connection to the server(errorcode:100, param:10), ready to reconnect...
[2016-12-12 09:05:47(306)]        Try connect to anychatcoreserver(127.0.0.1:8907)...
[2016-12-12 09:06:31(612)]        Successfully connect to the anychatcoreserver(127.0.0.1:8907)!
[2016-12-12 09:09:02(146)]        AnyChat Record Server Init,V6.1, Build Time:Jun 30 2016 15:26:46
[2016-12-12 09:09:02(146)]        Record Root Directory: /home/dave/anychat/anychatcoresdk_linux_x64_r5596/bin/recordserver/record/
[2016-12-12 09:09:02(146)]        Record Stream Buffer Time: 10000 ms
[2016-12-12 09:09:02(146)]        DebugLevel:3, DebugFlags:0x0
[2016-12-12 09:09:02(146)]        Ready to connect anychatcoreserver  127.0.0.1(8907)....
[2016-12-12 09:09:02(146)]        Load libmediautil.so success!(V6.1 Build Time:Jun 30 2016 15:25:03)
[2016-12-12 09:09:02(146)]        Start cluster bus connect: 127.0.0.1:8910
[2016-12-12 09:09:03(148)]        Try connect to anychatcoreserver(127.0.0.1:8907)...
[2016-12-12 09:09:03(150)]        Successfully connect to the anychatcoreserver(127.0.0.1:8907)!
[2016-12-12 09:57:54(752)]        AnyChat Record Server Init,V6.1, Build Time:Jun 30 2016 15:26:46
[2016-12-12 09:57:54(752)]        Record Root Directory: /home/dave/anychat/anychatcoresdk_linux_x64_r5596/bin/recordserver/record/
[2016-12-12 09:57:54(752)]        Record Stream Buffer Time: 10000 ms
[2016-12-12 09:57:54(752)]        DebugLevel:4, DebugFlags:0x1
[2016-12-12 09:57:54(752)]        Ready to connect anychatcoreserver  127.0.0.1(8907)....
[2016-12-12 09:57:54(752)]        Load libmediautil.so success!(V6.1 Build Time:Jun 30 2016 15:25:03)
[2016-12-12 09:57:55(753)]        Try connect to anychatcoreserver(127.0.0.1:8907)...
[2016-12-12 09:57:55(762)]        Successfully connect to the anychatcoreserver(127.0.0.1:8907)!
回复 支持 反对

使用道具 举报

18#
发表于 2016-12-12 10:15:25 | 只看该作者
LCL5555555 发表于 2016-12-12 10:02
你有QQ之类的即时聊天吗?这个问题困扰我好久了,想跟你仔细聊聊

请将anychatrecordserver的日志发来分析,谢谢
回复 支持 反对

使用道具 举报

9

主题

43

帖子

135

积分

注册会员

Rank: 2

积分
135
17#
发表于 2016-12-12 10:02:44 | 只看该作者
LCL5555555 发表于 2016-12-12 10:00
[2016-12-12 09:59:02(048)]        Received start server record command, userid:-10, flags:0x1837
[2016-1 ...

你有QQ之类的即时聊天吗?这个问题困扰我好久了,想跟你仔细聊聊
回复 支持 反对

使用道具 举报

9

主题

43

帖子

135

积分

注册会员

Rank: 2

积分
135
16#
发表于 2016-12-12 10:00:39 | 只看该作者
佰锐科技-邵光清 发表于 2016-12-12 09:49
应该是录像服务器启动有不对的地方,这是正常的ini文件,请下载并放到bin/recordserver目录替换旧的,再 ...

[2016-12-12 09:59:02(048)]        Received start server record command, userid:-10, flags:0x1837
[2016-12-12 09:59:25(842)]        Received stop server record command, userid:-10
[2016-12-12 09:59:25(898)]        Error, OnServerRecordFinish, RelativePathName is NULL, user(-10) record task info!(elapse:0, flags:0x1837)

还是错误,这是日志
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|AnyChat ( 粤ICP备13022410号-1 )  

GMT+8, 2024-5-3 16:41 , Processed in 0.141172 second(s), 25 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表