Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Android】-【7.7】【自采集音视频推流异常】 #111

Open
zxzx74147 opened this issue Sep 9, 2020 · 1 comment
Open

【Android】-【7.7】【自采集音视频推流异常】 #111

zxzx74147 opened this issue Sep 9, 2020 · 1 comment

Comments

@zxzx74147
Copy link

zxzx74147 commented Sep 9, 2020

【当前现象】
播放卡顿,延迟严重(10s以上);
只推送视频没有问题

【集成包】
基础版Smart

【问题时间段】
2020-09-09

【机型】
小米10、 华为P20

【之前版本有无此问题】
未验证

【复现概率】
必现

【复现途径】
1、配置push实例
TXLivePushConfig mLivePushConfig = new TXLivePushConfig();
mLivePushConfig.setAudioSampleRate(44100);
mLivePushConfig.setAudioChannels(1);
mLivePushConfig.setConnectRetryCount(10);
mLivePushConfig.setCustomModeType(TXLiveConstants.CUSTOM_MODE_VIDEO_CAPTURE | TXLiveConstants.CUSTOM_MODE_AUDIO_CAPTURE);
mLivePushConfig.setAutoAdjustBitrate(true);
mTXPusher = new TXInnerPusher(mContext);
mTXPusher.setConfig(mLivePushConfig);

2、推送视频和音频
音频:
统计每秒发送数据长度为88200(44100*2),符合要求
LENGTH=2048
var mPcm = ByteArray(LENGTH)

while (frame.buf.remaining() > 0) {
val remianing = frame.buf.remaining()
val len = Math.min(remianing, LENGTH - mPosition)
frame.buf.get(mPcm, mPosition, len)
mPosition += len
if (mPosition == LENGTH) {
pusher.sendCustomPCMData(mPcm)
mPosition = 0
}
}
视频:
pusher.sendCustomVideoTexture(frame.textureId, mTexFmt.width, mTexFmt.height)

【相关附件】
有如下日志
AudioEngine:LocalAudioStream receive_capture_data_cnt_in_10s_:430 do_process_cnt_in_10s_:431 time_delta:10000
VLC 播放会有如下信息
main error: Could not convert timestamp 91608999659 for faad
avcodec error: more than 5 seconds of late video -> dropping frame (computer too slow ?)
avcodec error: more than 5 seconds of late video -> dropping frame (computer too slow ?)
ffmpeg播放会有如下信息
[flv @ 0x7f8230000bc0] DTS 0 < 2424 out of orderB sq= 0B f=0/0
-0.06 A-V: -4.497 fd= 0 aq= 12KB vq= 746KB sq= 0B f=0/0
应该是音视频同步时间戳的问题,请问如何解决

@zxzx74147 zxzx74147 changed the title 【Android】-【7.7】【自采集音视频退流异常】 【Android】-【7.7】【自采集音视频推流异常】 Sep 9, 2020
@zxzx74147
Copy link
Author

将:
pusher.sendCustomPCMData(mPcm)
改为:
TXCAudioEngineJNI.nativeSendCustomPCMData(mPcm, LENGTH,TXCTimeUtil.generatePtsMS(), 44100,1)
可以解决这个问题,应该是音频时间戳出问题了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant