gemercheung 3 jaren geleden
bovenliggende
commit
8e7effb8d3
2 gewijzigde bestanden met toevoegingen van 3 en 4 verwijderingen
  1. 1 1
      src/scene/scene.service.ts
  2. 2 3
      src/scene/stream/stream.service.ts

+ 1 - 1
src/scene/scene.service.ts

@@ -277,6 +277,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
           if (src.length > 0) {
             this.lastRenderMedia = src;
             const clipPath = this.configService.get('app.prefix') + src;
+            delete redisMeta.mediaSrc;
             const stream: StreamFrameType = {
               frame: -1,
               clipPath: clipPath,
@@ -351,7 +352,6 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
       IDRflag,
       new Date().getTime(),
     );
-    await this.sleep(2);
     const res = await this.streamService.pushFrameToSteam(stream);
     if (res.done) {
       this.frameCnt.next(res.frame);

+ 2 - 3
src/scene/stream/stream.service.ts

@@ -182,9 +182,6 @@ export class StreamService {
 
           const currentSlice = allData.slice(startSlot, sliceLength);
 
-          // console.log('startSlot', startSlot);
-          // console.log('sliceLength', sliceLength);
-
           const blockBuffStart = Buffer.alloc(this.block);
           const packBuffer = Buffer.concat([blockBuffStart, currentSlice]);
           const framePack = new DataView(
@@ -219,6 +216,8 @@ export class StreamService {
           let isPush: boolean;
           // this.logger.log('statusPack', statusPack);
           if (this.channel && this.channel.isOpen()) {
+            console.log('bufferedAmount', this.channel.bufferedAmount());
+            console.log('maxMessageSize', this.channel.maxMessageSize());
             isPush = this.channel.sendMessageBinary(
               Buffer.from(framePack.buffer),
             );