|
//建立通话后调用 void initRecord(){
// 设置录像格式参数为:int型, 0 MP4[默认], 1 WMV, 2 FLV, 3 MP3
AnyChatCoreSDK.SetSDKOptionInt(AnyChatDefine.BRAC_SO_RECORD_FILETYPE, 3);
//< 设置软件音量模式控制(参数为int型,1打开,0关闭[默认]),使用软件音量模式,将不会改变系统的音量设置
AnyChatCoreSDK.SetSDKOptionInt(AnyChatDefine.BRAC_SO_AUDIO_SOFTVOLMODE, 1);
//// 设置外部输入音频格式
AnyChatCoreSDK.SetInputAudioFormat(1, 1600, 16, 0);
//录制文件不按日期分目录保存,全部生成在指定文件夹中(参数为:int型, 0禁止[默认] 1 开
anyChatSDK.SetSDKOptionInt(AnyChatDefine.BRAC_SO_RECORD_DISABLEDATEDIR, 1);
// 设置录像存储路径
anyChatSDK.SetSDKOptionString(AnyChatDefine.BRAC_SO_RECORD_TMPDIR, Environment.getExternalStorageDirectory() + mStrBasePath + "/");
// anyChatSDK.SetSDKOptionString(AnyChatDefine.BRAC_SO_RECORD_TMPDIR, Environment.getExternalStorageDirectory() + mStrBasePath + "/Recording/");
// anyChatSDK.SetSDKOptionString(AnyChatDefine.BRAC_SO_RECORD_TMPDIR, Environment.getExternalStorageDirectory().toString());
//用户音频控制
anyChatSDK.UserSpeakControl(userID, 1);
anyChatSDK.UserSpeakControl(-1, 1);// -1表示对本地音频进行控制,打开本地音频
}
//初始化相关录制配置后
void startRecord() {
anyChatSDK.StreamRecordCtrlEx(-1, 1, mdwFlags, 0, szUserStr);
}
//断开连接调用
void closeRecord() {
handler.removeCallbacks(runnable);
anyChatSDK.UserSpeakControl(userID, 0);
anyChatSDK.UserSpeakControl(-1, 0);
anyChatSDK.mSensorHelper.DestroySensor();
anyChatSDK.StreamRecordCtrlEx(-1, 0, mdwFlags, 0, szUserStr);
}
MP4 WMV FLV可以正常录制 MP3无法录制附Log
[size=15.0667px][2018-04-19 11:41:01(900)][I] ---------------------------AnyChat Platform Core SDK Client Log---------------------------[2018-04-19 11:41:01(900)][I] Load libanychatcore.so success!(V7.0 Build Time:Mar 17 2018 04:29:18)[2018-04-19 11:41:01(900)][I] Android OS SDK Version:26, Support ARMv7:0, Support Neon:0[2018-04-19 11:41:01(913)][I] Load libmediautil_v8.so success!(V7.0 Build Time:Mar 17 2018 04:30:44)[2018-04-19 11:41:01(918)][I] Load libmediashow.so success!(V7.0 Build Time:Mar 17 2018 04:30:01)[2018-04-19 11:41:01(923)][I] Load libmediacore.so success!(V7.0 Build Time:Mar 17 2018 04:30:06)[2018-04-19 11:41:01(924)][I] server net link reset...[2018-04-19 11:41:01(924)][I] Invoke SetSDKOption(BRAC_SO_LOCALVIDEO_AUTOROTATION=1)[2018-04-19 11:41:04(173)][I] Start network engine(IPv4 mode)...[2018-04-19 11:41:04(175)][I] Invoke Connect(demo.anychat.cn,8906)=0[2018-04-19 11:41:04(177)][I] Invoke Login(username:AA)=0[2018-04-19 11:41:04(190)][I] Create anychatdnsserver connect:121.199.51.198(8906)[2018-04-19 11:41:04(364)][I] On pre-connection result, errorcode:0, anychatcoreserver, 121.199.51.198(8906, tcp:1)[2018-04-19 11:41:04(481)][I] Start anychat server(121.199.51.198:8906) connect...[2018-04-19 11:41:04(593)][I] On connect anychat server return, errorcode: 0, appflags:0x460080, svrflags:0x10[2018-04-19 11:41:04(649)][I] m_ProtocolPipeLine, userid:0, local session:-472555490, peer session:0[2018-04-19 11:41:04(649)][I] Send login request...[2018-04-19 11:41:04(650)][I] Message OnConnect(errorcode=0), session74120A3-C661-6245-8085-C4EAF04B7F61[2018-04-19 11:41:04(731)][I] On tcp connect app reg result, errorcode:0[2018-04-19 11:41:04(813)][I] Message OnLoginSystem(userid=-13533, errorcode=0, username=AA)[2018-04-19 11:41:04(814)][I] Apply server config: mtu:1500, stream trans mode:0[2018-04-19 11:41:04(814)][I] Server running time: 2 days, 1 hours, 30 minutes, license mode:1, certlo:0x9feffff, hi:0xf7f)[2018-04-19 11:41:04(815)][I] Server supports the session hold feature for up to 30000 ms[2018-04-19 11:41:04(882)][I] On udp connect app reg result, errorcode:0[2018-04-19 11:41:04(882)][I] Connection to streaming media server(121.199.51.198:9907) successfully!(udp delay:33ms)[2018-04-19 11:41:05(000)][I] Apply video parameter:1280x720, bitrate:150kbps, quality:3, gop:40, fps:10, preset:3, codec:1[2018-04-19 11:41:05(000)][I] Invoke SetSDKOption(BRAC_SO_NETWORK_P2PPOLITIC=1)[2018-04-19 11:41:05(000)][I] Invoke SetSDKOption(BRAC_SO_AUDIO_ECHOCTRL,1)[2018-04-19 11:41:05(000)][I] Invoke SetSDKOption(BRAC_SO_CORESDK_USEHWCODEC=0)[2018-04-19 11:41:05(000)][I] Invoke SetSDKOption(BRAC_SO_LOCALVIDEO_AUTOROTATION=1)[2018-04-19 11:41:13(141)][I] Invoke EnterRoom(roomid=1)[2018-04-19 11:41:13(255)][I] Message OnEnterRoom(roomid=1,errorcode=0,siteindex=1)[2018-04-19 11:41:13(256)][I] Audio Playback Device Init(0, 1, 16000, 16), Default Playback Driver[2018-04-19 11:41:13(256)][I] Message OnReceiveOnlineUser(count=2,roomid=1)[2018-04-19 11:41:15(523)][I] Message OnUserEnterRoom(userid=-13534,nickname=Android,siteindex=2)[2018-04-19 11:41:18(406)][I] On Remote UserSpeakControl(dwUserId:-13534, bOpen:1, streamindex:0)[2018-04-19 11:41:18(407)][I] On Remote UserCameraControl(dwUserId:-13534, bOpen:1, streamindex:0)[2018-04-19 11:41:20(821)][I] Invoke SetInputAudioFormat(1, 1600, 16, flags:0)[2018-04-19 11:41:20(821)][I] Audio Init, error:0, device:-1, 1, 1600, 16, capmode:0[2018-04-19 11:41:20(821)][I] Audio capture resample: 1, 16000, 16[2018-04-19 11:41:20(824)][I] Invoke UserSpeakControl(userid=-13534, bOpen=1) = 0[2018-04-19 11:41:20(824)][I] Invoke UserSpeakControl(userid=-1, bOpen=1) = 0[2018-04-19 11:41:20(825)][I] Invoke UserCameraControl(userid=-13534, bOpen=1) = 0[2018-04-19 11:41:20(826)][I] Invoke UserSpeakControl(userid=-13534, bOpen=1) = 0[2018-04-19 11:41:20(829)][I] Invoke UserCameraControl(userid=-1, bOpen=1) = 0[2018-04-19 11:41:20(830)][I] Invoke UserSpeakControl(userid=-1, bOpen=1) = 0[2018-04-19 11:41:20(830)][I] Record parameter video:0x0, 0kbps, audio:0kbps, filetype:3[2018-04-19 11:41:20(830)][I] Invoke StreamRecordCtrlEx(-1, 1, 0x12, 0, )=0[2018-04-19 11:41:21(038)][I] APPLOG Camera FrameRate: 30000 , 30000[2018-04-19 11:41:21(058)][I] Invoke SetSDKOption(BRAC_SO_CORESDK_EXTVIDEOINPUT=1)[2018-04-19 11:41:21(059)][I] Invoke SetInputVideoFormat(pixfmt:8, 1280x720, 30fps, flags:0)[2018-04-19 11:41:21(070)][I] video(stream:0) init finish:1280x720, NV21, fps:30, codecid:1[2018-04-19 11:41:21(136)][I] Invoke SetInputAudioFormat(1, 16000, 16, flags:0)[2018-04-19 11:41:21(136)][I] Audio Init, error:0, device:-1, 1, 16000, 16, capmode:0[2018-04-19 11:41:21(252)][I] Invoke SetSDKOption(BRAC_SO_CORESDK_EXTVIDEOINPUT=1)[2018-04-19 11:41:21(252)][I] Invoke SetInputVideoFormat(pixfmt:8, 1280x720, 30fps, flags:0)[2018-04-19 11:41:21(260)][I] user(-13533) record audio stream parameter: codec:11, 1 channel, 16000Hz[2018-04-19 11:41:21(262)][I] userid(-13534) audio decode, codec:11, 1 channel, 16000Hz[2018-04-19 11:41:21(270)][I] Prepare create record file:/storage/emulated/0/AnyChat/2018-04-19_11-41-21-263_AA_82.mp3, dwFlags:0xc[2018-04-19 11:41:21(270)][I] Could not find encoder for 'mp3'[2018-04-19 11:41:21(273)][I] video(stream:0) init finish:1280x720, NV21, fps:30, codecid:1[2018-04-19 11:41:21(274)][I] Error occurred when opening output file: Invalid argument[2018-04-19 11:41:21(274)][I] Record audio parameters: mp3(86017), 2 channel, 16.0kHz, 64kbps[2018-04-19 11:41:21(274)][I] Record video parameters: none(0), 320x240, 25fps, 400kbps[2018-04-19 11:41:21(274)][I] Record status, input video count:0(0 ms), record video count:0(0 ms), 25 fps, audio frame count:0(0 ms), audio_eof:0, video_eof:0[2018-04-19 11:41:21(274)][I] Record filename: /storage/emulated/0/AnyChat/2018-04-19_11-41-21-263_AA_82.mp3[2018-04-19 11:41:21(276)][I] User(-13533) record init failed! bAudioPrepare:1, bVideoPrepare:1, dwFlags:0x12, dwFileType:3[2018-04-19 11:41:21(276)][I] record audio parameter: codecid:11, 2 channel, 16.0kHz, 0kbps[2018-04-19 11:41:21(276)][I] Message OnAnyChatRecordSnapShotCallBack(userid:-13533, errorcode:721, filenamenull), elapse:0, flags:0x12)[2018-04-19 11:41:21(280)][I] Audio FX Status: VAD:1, NS:1, AGC:1, AEC:1[2018-04-19 11:41:21(281)][I] Audio codec init, handle:4, codec:11, format1, 16000, 16), bitrate:15kbps[2018-04-19 11:41:21(376)][I] video codec init:codec:1, 10fps, 1280x720, bitrate:150kbps, quality:3, preset:3, gop:40, handle:5[2018-04-19 11:41:26(343)][I] userid(-13534) video decode, codec:1, 320x240, delay:9ms[2018-04-19 11:41:46(941)][I] On Remote UserCameraControl(dwUserId:-13534, bOpen:0, streamindex:0)[2018-04-19 11:41:47(179)][I] On Remote UserSpeakControl(dwUserId:-13534, bOpen:0, streamindex:0)[2018-04-19 11:41:47(421)][I] Message OnUserLeaveRoom(userid=-13534,siteindex=2)[2018-04-19 11:41:47(446)][I] Invoke UserCameraControl(userid=-13534, bOpen=0) = 309[2018-04-19 11:41:47(446)][I] Invoke UserSpeakControl(userid=-13534, bOpen=0) = 309[2018-04-19 11:41:47(447)][I] Invoke UserSpeakControl(userid=0, bOpen=0) = 309[2018-04-19 11:41:47(455)][I] Invoke UserSpeakControl(userid=-1, bOpen=0) = 0[2018-04-19 11:41:47(459)][I] Invoke StreamRecordCtrlEx(-1, 0, 0x12, 0, )=0[2018-04-19 11:41:53(911)][I] Invoke UserCameraControl(userid=0, bOpen=0) = 309[2018-04-19 11:41:53(912)][I] Invoke UserSpeakControl(userid=0, bOpen=0) = 309[2018-04-19 11:41:53(912)][I] Invoke UserCameraControl(userid=-1, bOpen=0) = 0[2018-04-19 11:41:53(912)][I] Invoke UserSpeakControl(userid=-1, bOpen=0) = 0[2018-04-19 11:41:53(947)][I] Invoke SetSDKOption(BRAC_SO_CORESDK_EXTVIDEOINPUT=0)[2018-04-19 11:41:54(465)][I] Prepare leaveroom......[2018-04-19 11:41:54(566)][I] userid(-1) statist info, video fps:10, video count:256, audio count:6470[2018-04-19 11:41:54(566)][I] Invoke LeaveRoom(roomid=-1)=0 Elapse:101 ms[2018-04-19 11:41:54(676)][I] Prepare leaveroom......[2018-04-19 11:41:54(676)][I] Invoke LeaveRoom(roomid=-1)=0 Elapse:0 ms[2018-04-19 11:41:54(676)][I] Prepare logout......[2018-04-19 11:41:54(708)][I] Close network engine...[2018-04-19 11:41:54(711)][I] server net link reset...[2018-04-19 11:41:54(712)][I] Invoke Logout() Elapse:35 ms[2018-04-19 11:41:55(804)][I] Prepare leaveroom......[2018-04-19 11:41:55(805)][I] Invoke LeaveRoom(roomid=-1)=208 Elapse:0 ms[2018-04-19 11:41:55(805)][I] Prepare logout......[2018-04-19 11:41:55(805)][I] server net link reset...[2018-04-19 11:41:55(812)][I] Invoke Logout() Elapse:6 ms[2018-04-19 11:41:55(812)][I] Prepare release......[2018-04-19 11:41:56(075)][I] server net link reset...[2018-04-19 11:41:56(075)][I] Invoke BRAC_Release Elapse:263 ms
|
|