avcC_(streamInfo) {
    const NALU_TYPE_SPS = 7;
    const NALU_TYPE_PPS = 8;

    // length = 7 by default (0 SPS and 0 PPS)
    let avcCLength = 7;

    // First get all SPS and PPS from nalus
    const sps = [];
    const pps = [];
    let AVCProfileIndication = 0;
    let AVCLevelIndication = 0;
    let profileCompatibility = 0;
    for (let i = 0; i < streamInfo.videoNalus.length; i++) {
      const naluBytes = this.hexStringToBuffer_(streamInfo.videoNalus[i]);
      const naluType = naluBytes[0] & 0x1F;
      switch (naluType) {
        case NALU_TYPE_SPS:
          sps.push(naluBytes);
          // 2 = sequenceParameterSetLength field length
          avcCLength += naluBytes.length + 2;
          break;
        case NALU_TYPE_PPS:
          pps.push(naluBytes);
          // 2 = pictureParameterSetLength field length
          avcCLength += naluBytes.length + 2;
          break;
        default:
          break;
      }
    }
    // Get profile and level from SPS
    if (sps.length > 0) {
      AVCProfileIndication = sps[0][1];
      profileCompatibility = sps[0][2];
      AVCLevelIndication = sps[0][3];
    }

    // Generate avcC buffer
    const avcCBytes = new Uint8Array(avcCLength);
    let i = 0;
    // configurationVersion = 1
    avcCBytes[i++] = 1;
    avcCBytes[i++] = AVCProfileIndication;
    avcCBytes[i++] = profileCompatibility;
    avcCBytes[i++] = AVCLevelIndication;
    // '11111' + lengthSizeMinusOne = 3
    avcCBytes[i++] = 0xFF;
    // '111' + numOfSequenceParameterSets
    avcCBytes[i++] = 0xE0 | sps.length;
    for (let n = 0; n < sps.length; n++) {
      avcCBytes[i++] = (sps[n].length & 0xFF00) >> 8;
      avcCBytes[i++] = (sps[n].length & 0x00FF);
      avcCBytes.set(sps[n], i);
      i += sps[n].length;
    }
    // numOfPictureParameterSets
    avcCBytes[i++] = pps.length;
    for (let n = 0; n < pps.length; n++) {
      avcCBytes[i++] = (pps[n].length & 0xFF00) >> 8;
      avcCBytes[i++] = (pps[n].length & 0x00FF);
      avcCBytes.set(pps[n], i);
      i += pps[n].length;
    }
    return avcCBytes;
  }
Generate a AVCC box

@param {shaka.util.Mp4Generator.StreamInfo} streamInfo
@return {!Uint8Array}
@private