|
@@ -216,15 +216,21 @@ export class StreamService {
|
|
framePack.setUint32(this.block - 4, steamByteLength);
|
|
framePack.setUint32(this.block - 4, steamByteLength);
|
|
steamByteLength += currentSlice.byteLength;
|
|
steamByteLength += currentSlice.byteLength;
|
|
// const isLastFrame = framePack.byteLength - this.chunk_size < 0;
|
|
// const isLastFrame = framePack.byteLength - this.chunk_size < 0;
|
|
-
|
|
|
|
|
|
+ let isPush: boolean;
|
|
// this.logger.log('statusPack', statusPack);
|
|
// this.logger.log('statusPack', statusPack);
|
|
if (this.channel && this.channel.isOpen()) {
|
|
if (this.channel && this.channel.isOpen()) {
|
|
- const isPush = await this.channel.sendMessageBinary(
|
|
|
|
|
|
+ isPush = this.channel.sendMessageBinary(
|
|
Buffer.from(framePack.buffer),
|
|
Buffer.from(framePack.buffer),
|
|
);
|
|
);
|
|
if (!isPush) {
|
|
if (!isPush) {
|
|
await this.sleep(5);
|
|
await this.sleep(5);
|
|
- console.error('流测试推不成功-再试', isPush);
|
|
|
|
|
|
+ console.error('流测试推不成功-1试', isPush);
|
|
|
|
+ isPush = this.channel.sendMessageBinary(
|
|
|
|
+ Buffer.from(framePack.buffer),
|
|
|
|
+ );
|
|
|
|
+ if (!isPush) {
|
|
|
|
+ console.error('流测试推不成功-2试', isPush);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
if (i === slices) {
|
|
if (i === slices) {
|
|
@@ -259,7 +265,7 @@ export class StreamService {
|
|
console.log(
|
|
console.log(
|
|
'stream-size %s : frame: %s, IDR: %s',
|
|
'stream-size %s : frame: %s, IDR: %s',
|
|
((coordBuff.byteLength + clipBuffer.byteLength) / 1024).toFixed(2) +
|
|
((coordBuff.byteLength + clipBuffer.byteLength) / 1024).toFixed(2) +
|
|
- ' KB',
|
|
|
|
|
|
+ ' KB',
|
|
frame,
|
|
frame,
|
|
dir,
|
|
dir,
|
|
);
|
|
);
|
|
@@ -334,7 +340,7 @@ export class StreamService {
|
|
console.log(
|
|
console.log(
|
|
'stream-size %s : frame: %s, IDR: %s',
|
|
'stream-size %s : frame: %s, IDR: %s',
|
|
((coordBuff.byteLength + clipBuffer.byteLength) / 1024).toFixed(2) +
|
|
((coordBuff.byteLength + clipBuffer.byteLength) / 1024).toFixed(2) +
|
|
- ' KB',
|
|
|
|
|
|
+ ' KB',
|
|
frame,
|
|
frame,
|
|
dir,
|
|
dir,
|
|
);
|
|
);
|