API-Examples-Web icon indicating copy to clipboard operation
API-Examples-Web copied to clipboard

Chrome crashes on h.264 dual stream

Open uctakeoff opened this issue 4 years ago • 0 comments
trafficstars

When I run the sample code basicVideoCall.js with some modifications, and repeat Join and Leave, Google Chrome often freezes.

OS: Windows 10 Pro Chrome Version: 92.0.4515.131(Official Build) (64 bit)

The modifications are as follows.

  • Create an RTC client with h.264, dualstream

    var client = AgoraRTC.createClient({ mode: "rtc", codec: "h264" });
    client.enableDualStream().then(() => {
      console.log("Enable Dual stream success!");
      client.setLowStreamParameter({
        bitrate: 256,
        framerate: 1,
        width: 160,
        height: 90,
      });
    }).catch(err => {
      console.err(err);
    });
    
  • Add parameters to AudioTrack and VideoTrack.

      [ options.uid, localTracks.audioTrack, localTracks.videoTrack ] = await Promise.all([
        // Join the channel.
        client.join(options.appid, options.channel, options.token || null, options.uid || null),
        // Create tracks to the local microphone and camera.
        AgoraRTC.createMicrophoneAudioTrack({
          AEC: true,
          AGC: true,
          ANS: true,
          encoderConfig: {
            bitrate: 128
          }
        }),
        AgoraRTC.createCameraVideoTrack({
          encoderConfig: {
            width: 1920,
            height: 1080,
            bitrateMin: 1000,
            bitrateMax: 2000,
            frameRate: 30,
          }
        })
      ]);
    

uctakeoff avatar Aug 11 '21 02:08 uctakeoff