é²ç»SDK
On-premise
æ¦è¦
agora.ioã«On-premise Recording SDKãå ¬éããã¦ãã¾ãã
On-premise Recording SDKã¯ãagora.ioã®VideoãVoiceSDKãªã©ã§ä½æããããµã¼ãã¹(1対1é¢è«ããã¤ã¹ãã£ãããä¼è°ãã»ããã¼ãªã©)ã®é話(æ åã»é³å£°)ãé²ç»ãããã¨ãã§ãã¾ãããªã³ãã¬ãã¹åã®ãããé²ç»ãµã¼ã(Linux)ãæ§ç¯ããããã§é²ç»å¦çãå®è¡ãã¾ãã
- ãã®è¨äºã§ã¯ãNodeJSã®ãµã³ãã«ãå©ç¨ãã¦ãé²ç»ãµã¼ãã®æ§ç¯ã¨é²ç»å®è¡ãæ ååçã¾ã§ã®æµããã説æãã¾ãã
ï¼é²ç»ãµã¼ãç°å¢æ§ç¯ã¯æ¤è¨¼ç°å¢ã®æ§ç¯ã¨ããã¬ãã«ã«ãªãã¾ããï¼
Cloud Recording SDKã¨ã®éã
Cloud Recording SDKã¨ã®ä¸çªã®éãã¯ããªã³ãã¬ãã¹åãã¯ã©ã¦ãåãã«ãªãã¾ããCloud Recordingã®å ´åã¯é²ç»ãã¡ã¤ã«ã®ä¿åå
ããµã¼ããã¼ãã£ã®ã¯ã©ã¦ãã¹ãã¬ã¼ã¸ã§ããã®ã«å¯¾ããOn-premise Recordingã¯æ§ç¯ããé²ç»ãµã¼ãä¸ã®ã¹ãã¬ã¼ã¸ã«ãªãã¾ãã
ï¼ãã®ä»ãæ©è½é¢ã«ããã¦ããã¤ãå·®ç°ãããã¾ãï¼
åè
Cloud Recording SDK
agora.io Cloud Recording SDK ã¯ã¤ãã¯ã¹ã¿ã¼ãã¬ã¤ã
On-premise Recordingã®åä½ã¤ã¡ã¼ã¸
- â»agoraå ¬å¼ãã¼ã¸ãã転ç¨
(å³ä¸)Linux Serverï¼é²ç»ãµã¼ãï¼æ§ç¯ãå¿
è¦ï¼
(ä¸å¤®)SD-RTNï¼Agoraã®ã¡ã¤ã³ãµã¼ã
(å·¦ä¸)ã¢ãã¤ã«ããã¤ã¹ï¼ã¯ã©ã¤ã¢ã³ã
1ï¼(å·¦ä¸ã®)åã¢ãã¤ã«ããã¤ã¹ãããããªé話ãéå§ããã¾ãã
2ï¼(å³ä¸ã®)Linux Server(é²ç»ãµã¼ã)ã¯å¯¾è±¡ãããªé話ã®é²ç»ãå®è¡ãã¾ãã
3ï¼(ä¸å¤®ã®)SD-RTNã¯æ å/é³å£°ãé²ç»ãµã¼ãã«éãã¾ãã
4ï¼(å³ä¸ã®)Linux Server(é²ç»ãµã¼ã)ã¯ãé²ç»ãã¡ã¤ã«ãä¿åãã¾ãã
é²ç»ãµã¼ãã®æ§ç¯æºå(å¿ è¦ãªãã®)
ãµã¼ãç°å¢
- ã»Ubuntu : 18.04.2
â»Docker for windowsãå©ç¨
Agora SDKã¨é²ç»ãµã³ãã«ã½ã¼ã¹
- ã»Agora On-premise Recording SDK
- ã»Agora Basic recording sample
â»NodeJSã®ãµã³ãã«ãå©ç¨
ãã®ä»ï¼å¿ è¦ãªãã®ï¼
ãUbuntuã«ã¤ã³ã¹ãã¼ã«ããããã±ã¼ã¸ã
ã»GCC
ã»nodejs
ã»npm
ã»ffmpeg
ã»ãã®ä»ï¼tarãtreeãunzipãvimï¼
- ãæ¤è¨¼ç¨ã¯ã©ã¤ã¢ã³ãã
ã»Agora-Web-Tutorial-1to1(æ¤è¨¼ç¨ã¯ã©ã¤ã¢ã³ã)
â»åä½ç¢ºèªæã«ã¯ã©ã¤ã¢ã³ãã¨ãã¦å©ç¨
é²ç»ãµã¼ãã®æ§ç¯
1. Linuxãµã¼ãã®æºåã¨èµ·å
(Dockerã³ã³ãããä½æãå®è¡ã)Linuxãµã¼ããèµ·åãã¾ãã
2. SDKã¨é²ç»ãµã³ãã«ã®ã¤ã³ã¹ãã¼ã«
1. Agora On-premise Recording SDKã解åãã¾ãã
2. Agora Basic recording sample(é²ç»ãµã³ãã«)ã解åãã¾ãã
â»ãã¡ã¤ã«ã¯/home以ä¸ã«ä¿åãã¾ããã
$tar -xvf /home/Agora_Recording_SDK_for_Linux_v2_3_4_FULL.tar
$unzip /home/Basic-Recording-master.zip
3. 解åããSDKãAgora Basic recording sample(é²ç»ãµã³ãã«)é ä¸ã«ç§»åãã¾ãã
移åå
ï¼/home/Agora_Recording_SDK_for_Linux_FULL
移åå
ï¼/home/Basic-Recording-master/On-Premise-Recording-Nodejs/record/src/sdk
/home/Basic-Recording-master.
|-- On-Premise-Recording-C++
|-- On-Premise-Recording-Nodejs
|-- record
| |-- output
| |-- package-lock.json
| |-- sdkdemo.js
| `-- src
| `-- sdk //âãã
`-- server
移åæã®ã³ãã³ã
$cp -r /home/Agora_Recording_SDK_for_Linux_FULL /home/Basic-Recording-master/On-Premise-Recording-Nodejs/record/src
$mv /home/Basic-Recording-master/On-Premise-Recording-Nodejs/record/src/Agora_Recording_SDK_for_Linux_FULL
/home/Basic-Recording-master/On-Premise-Recording-Nodejs/record/src/sdk
3. npmããã±ã¼ã¸ä½æ
1. ãã£ã¬ã¯ããªã移å
/sdké ä¸ã¸ç§»åãã¾ãã
$cd /home/Basic-Recording-master/On-Premise-Recording-Nodejs/record/src/sdk
2. npmããã±ã¼ã¸ã®ä½æ
$npm install -g node-gyp
4. é²ç»å®è¡ã½ã¼ã¹ãã«ã
1. ãã£ã¬ã¯ããªã移å
/recordé ä¸ã¸ç§»åãã¾ãã
$cd /home/Basic-Recording-master/On-Premise-Recording-Nodejs/record
2. ãã«ãå®è¡
$source build.sh
3. ãã«ãå®è¡å¾ç¢ºèª
ãã«ããæåããã¨./recordé ä¸ã«"agorasdk.node"ãä½æããã¾ãã
$ls /home/Basic-Recording-master/On-Premise-Recording-Nodejs/record
AgoraRecordSdk.js agorasdk.node build.sh build_debug.sh output package-lock.json sdkdemo.js src
é²ç»ãµã¼ãã®æ§ç¯ãå®äºãã¾ããã
åä½ã®ç¢ºèª
ããã§ã¯é²ç»ãå®è¡ãã¦ã¿ã¾ãã
1ï¼ åä½åæºå1ï¼APPIDã®è¨å®ï¼
å®è¡ãã¡ã¤ã«(sdkdemo.js)ã«APPIDãã»ãããã¾ãã
1. å®è¡ãã¡ã¤ã«(sdkdemo.js)ãç·¨éã¢ã¼ãã§éãã¾ãã
$vi /home/Basic-Recording-master/On-Premise-Recording-Nodejs/record/sdkdemo.js
2. "rec.joinChannel()"ã®ç¬¬4å¼æ°("YOUR APP ID")ã«APPIDãã»ãããã¾ãã
(çç¥)
//create output folder
fs.mkdir(storageDir, {recursive: true}, err => {
//join channel
rec.joinChannel(null, "agoratest", 0, "<YOUR APP ID>", storageDir); âãã
})
return rec;
(çç¥)
3. ç·¨éãä¿å(:wq)ãã¾ãã
2ï¼ åä½åæºå2ï¼ã¯ã©ã¤ã¢ã³ãï¼
Agora-Web-Tutorial-1to1(é²ç»å®è¡æã®æ¤è¨¼ç¨ã¯ã©ã¤ã¢ã³ã)ãPCã«ä¿åãã
èµ·åã§ããããã«ãã¦ããã¾ãã
3ï¼ é²ç»ã®éå§
é²ç»ãéå§ãã¾ã("node sdkdemo.js")ã
å®è¡å¾ãSDKããã¬ã¹ãã³ã¹ãããã¾ãã
(以ä¸ä¾ã§ã¯Channel:"agoratest"ã«é²ç»ç¨UID:"1202710079"ãJoinãã¦ãã¾ãã)
$ node sdkdemo.js
setting mix layout...
joinChannel...
appliteDir /home/Basic-Recording-master/On-Premise-Recording-Nodejs/record/src/sdk/bin/
pRecording->m_agorasdk->createChannel return result:1
join channel Id: agoratest, with uid: 1202710079
channel joined agoratest 1202710079
4ï¼ ã¯ã©ã¤ã¢ã³ãã®å ¥å®¤
ç¨æãã¦ãããã¯ã©ã¤ã¢ã³ãã§å
¥å®¤ãã¾ãã(ã§ããã°2æ ç¹ä»¥ä¸)
â»å
¥å®¤æã®APPIDã¨Channelã¯é²ç»ã®éå§æã¨åããã®ãã»ãããã¾ãã
å ¥å®¤ããã¨ã以ä¸ã®ãããªã¬ã¹ãã³ã¹ãããã¾ãã
User 361415303 joined, RecordingDir:/home/Basic-Recording-master/On-Premise-Recording-Nodejs/record/output/
userjoin 361415303
setting mix layout...
color: #00ff00
5ï¼ é²ç»ã®åæ¢
åã¯ã©ã¤ã¢ã³ããé室ããã¾ãã
é室ããã¨ä»¥ä¸ã®ãããªã¬ã¹ãã³ã¹ãããã¾ãã
leaveChannel...
â»ãã®ãã¢ã§ã¯ãã¿ã¤ã ã¢ã¦ãã«ããé²ç»UIDã(ã¿ã¤ã ã¢ã¦ãå¾)èªåã§é室ããé²ç»ãåæ¢ãã¾ãã
setTimeout(() => {
recorder.leaveChannel();
}, 1000 * 50)
6ï¼ åºåãã©ã«ãã®ç¢ºèª
outputãã©ã«ãã«é²ç»ãããã¡ã¤ã«ãä¿åããã¦ãã¾ãã
â»ã¹ãã¼ã¹ã§åºåã£ã¦è¡¨ç¤ºãã¦ãã¾ã
$cd /home/Basic-Recording-master/On-Premise-Recording-Nodejs/record
$ls ./output
0_20200316055159530.aac agorasdk.dat metadata.txt recording_sys.log
0_20200316055200353.mp4 agorasdk.log recording2-done.txt uid_0_20200316055159535.txt
agorareport.dat cfg.json recording_0.log
7ï¼ ãã©ã³ã¹ã³ã¼ã
â»Individualã¢ã¼ãã®å ´åã®ã¿
åºåããããã¡ã¤ã«ããã©ã³ã¹ã³ã¼ããã¼ã«(video_convert.pyã¨ffmeg)ã§å¤æãã¾ãã
ï¼ãã®ä¾ã§ã¯fps:30ã640x480ã§å¤æãã¦ãã¾ãï¼
$python /home/Basic-Recording-master/On-Premise-Recording-Nodejs/record/src/sdk/tools/video_convert.py
-f /home/Basic-Recording-master/On-Premise-Recording-Nodejs/record/output
-p 30 -r 640 480
8ï¼ åç
1. Linuxãµã¼ãå ã®outputãã©ã«ããPCã«è»¢éãã¾ãã
2. ãã©ã³ã¹ã³ã¼ãæ¸ã¿ã®ãã¡ã¤ã«(0_20200316055159535_av.mp4)ãã¯ãªãã¯ãåçãéå§ãã¾ãã
ã»1æ ç¹ç®å
¥å®¤æã®æ åï¼èæ¯ï¼"#00ff00"(ããã©ã«ã)ï¼
â»å®éã®æ åã¯é ãã¦è¡¨ç¤ºãã¦ãã¾ãã
ã»2æ ç¹ç®å ¥å®¤æã®æ å
é²ç»ãµã¼ãã®æ§ç¯ãé²ç»ã®å®è¡ãæ åã®åçã¾ã§å®æ½ã§ãã¾ããã
è£è¶³
- NodeJSã®ãµã³ãã«ã¯ãããã©ã«ãã§mixã¢ã¼ãã§ã®å©ç¨ã«ãªã£ã¦ãã¾ãã
Individualã¢ã¼ãã§å©ç¨ãããå ´åã¯ã以ä¸ã³ã¼ããç·¨éãã¾ãã
/*individualã¢ã¼ãã®æ*/
config.isMixingEnabled = false;
config.mixedVideoAudio = agora::linuxsdk::MIXED_AV_DEFAULT;
(mixã¢ã¼ãã®æã¯trueãMIXED_AV_CODEC_V2)
â»ä¿®æ£å¾ã¯å度ãã«ããå¿ è¦ã§ãã
é¢é£ãªã³ã¯
On-premise Recordingã¨Cloud Recordingã®éãã¯ä½ã§ããï¼
é²ç»ã¢ã¼ãã®éãã«ã¤ãã¦æãã¦ãã ããã
On-premise Recordingã§é²ç»ä¸ã«ã¬ã¤ã¢ã¦ããå¤æ´ãããã®ã§ãããæ¹æ³ã¯ããã¾ããï¼