UnsupportedError: cannot consume this Producer

Hi I am trying to create a consumer in the client-side, but getting an Unsupported Error which says that it cannot consume this Producer.

i checked the related thread and still can’t understand the issue.

here is my params:

routerRtpCapabilities:

{
  "codecs": [
    {
      "kind": "video",
      "mimeType": "video/H264",
      "clockRate": 90000,
      "parameters": {
        "packetization-mode": 1,
        "level-asymmetry-allowed": 1,
        "profile-level-id": "42001f"
      },
      "rtcpFeedback": [
        {
          "type": "nack",
          "parameter": ""
        },
        {
          "type": "nack",
          "parameter": "pli"
        },
        {
          "type": "ccm",
          "parameter": "fir"
        },
        {
          "type": "goog-remb",
          "parameter": ""
        },
        {
          "type": "transport-cc",
          "parameter": ""
        }
      ],
      "preferredPayloadType": 105
    },
    {
      "kind": "video",
      "mimeType": "video/H264",
      "clockRate": 90000,
      "parameters": {
        "packetization-mode": 1,
        "level-asymmetry-allowed": 1,
        "profile-level-id": "420032"
      },
      "rtcpFeedback": [
        {
          "type": "nack",
          "parameter": ""
        },
        {
          "type": "nack",
          "parameter": "pli"
        },
        {
          "type": "ccm",
          "parameter": "fir"
        },
        {
          "type": "goog-remb",
          "parameter": ""
        },
        {
          "type": "transport-cc",
          "parameter": ""
        }
      ],
      "preferredPayloadType": 107
    },
    {
      "kind": "video",
      "mimeType": "video/H264",
      "clockRate": 90000,
      "parameters": {
        "packetization-mode": 1,
        "level-asymmetry-allowed": 1,
        "profile-level-id": "4d0032"
      },
      "rtcpFeedback": [
        {
          "type": "nack",
          "parameter": ""
        },
        {
          "type": "nack",
          "parameter": "pli"
        },
        {
          "type": "ccm",
          "parameter": "fir"
        },
        {
          "type": "goog-remb",
          "parameter": ""
        },
        {
          "type": "transport-cc",
          "parameter": ""
        }
      ],
      "preferredPayloadType": 109
    },
    {
      "kind": "video",
      "mimeType": "video/H264",
      "clockRate": 90000,
      "parameters": {
        "packetization-mode": 1,
        "level-asymmetry-allowed": 1,
        "profile-level-id": "4d0032"
      },
      "rtcpFeedback": [
        {
          "type": "nack",
          "parameter": ""
        },
        {
          "type": "nack",
          "parameter": "pli"
        },
        {
          "type": "ccm",
          "parameter": "fir"
        },
        {
          "type": "goog-remb",
          "parameter": ""
        },
        {
          "type": "transport-cc",
          "parameter": ""
        }
      ],
      "preferredPayloadType": 111
    },
    {
      "kind": "video",
      "mimeType": "video/H264",
      "clockRate": 90000,
      "parameters": {
        "packetization-mode": 1,
        "level-asymmetry-allowed": 1,
        "profile-level-id": "640032"
      },
      "rtcpFeedback": [
        {
          "type": "nack",
          "parameter": ""
        },
        {
          "type": "nack",
          "parameter": "pli"
        },
        {
          "type": "ccm",
          "parameter": "fir"
        },
        {
          "type": "goog-remb",
          "parameter": ""
        },
        {
          "type": "transport-cc",
          "parameter": ""
        }
      ],
      "preferredPayloadType": 113
    },
    {
      "kind": "video",
      "mimeType": "video/H264",
      "clockRate": 90000,
      "parameters": {
        "packetization-mode": 1,
        "level-asymmetry-allowed": 1,
        "profile-level-id": "640c32"
      },
      "rtcpFeedback": [
        {
          "type": "nack",
          "parameter": ""
        },
        {
          "type": "nack",
          "parameter": "pli"
        },
        {
          "type": "ccm",
          "parameter": "fir"
        },
        {
          "type": "goog-remb",
          "parameter": ""
        },
        {
          "type": "transport-cc",
          "parameter": ""
        }
      ],
      "preferredPayloadType": 115
    },
    {
      "kind": "video",
      "mimeType": "video/H264",
      "clockRate": 90000,
      "parameters": {
        "packetization-mode": 1,
        "level-asymmetry-allowed": 1,
        "profile-level-id": "640c1f"
      },
      "rtcpFeedback": [
        {
          "type": "nack",
          "parameter": ""
        },
        {
          "type": "nack",
          "parameter": "pli"
        },
        {
          "type": "ccm",
          "parameter": "fir"
        },
        {
          "type": "goog-remb",
          "parameter": ""
        },
        {
          "type": "transport-cc",
          "parameter": ""
        }
      ],
      "preferredPayloadType": 117
    },
    {
      "kind": "video",
      "mimeType": "video/H264",
      "clockRate": 90000,
      "parameters": {
        "packetization-mode": 1,
        "level-asymmetry-allowed": 1,
        "profile-level-id": "42e01f"
      },
      "rtcpFeedback": [
        {
          "type": "nack",
          "parameter": ""
        },
        {
          "type": "nack",
          "parameter": "pli"
        },
        {
          "type": "ccm",
          "parameter": "fir"
        },
        {
          "type": "goog-remb",
          "parameter": ""
        },
        {
          "type": "transport-cc",
          "parameter": ""
        }
      ],
      "preferredPayloadType": 119
    },
    {
      "kind": "video",
      "mimeType": "video/VP8",
      "clockRate": 90000,
      "rtcpFeedback": [
        {
          "type": "nack",
          "parameter": ""
        },
        {
          "type": "nack",
          "parameter": "pli"
        },
        {
          "type": "ccm",
          "parameter": "fir"
        },
        {
          "type": "goog-remb",
          "parameter": ""
        },
        {
          "type": "transport-cc",
          "parameter": ""
        }
      ],
      "parameters": {
        "x-google-start-bitrate": 1000
      },
      "preferredPayloadType": 101
    },
    {
      "kind": "video",
      "mimeType": "video/rtx",
      "preferredPayloadType": 102,
      "clockRate": 90000,
      "parameters": {
        "apt": 101
      },
      "rtcpFeedback": []
    },
    {
      "kind": "video",
      "mimeType": "video/VP9",
      "clockRate": 90000,
      "rtcpFeedback": [
        {
          "type": "nack",
          "parameter": ""
        },
        {
          "type": "nack",
          "parameter": "pli"
        },
        {
          "type": "ccm",
          "parameter": "fir"
        },
        {
          "type": "goog-remb",
          "parameter": ""
        },
        {
          "type": "transport-cc",
          "parameter": ""
        }
      ],
      "parameters": {
        "profile-id": 2,
        "x-google-start-bitrate": 1000
      },
      "preferredPayloadType": 103
    },
    {
      "kind": "video",
      "mimeType": "video/rtx",
      "preferredPayloadType": 104,
      "clockRate": 90000,
      "parameters": {
        "apt": 103
      },
      "rtcpFeedback": []
    },
    {
      "kind": "video",
      "mimeType": "video/rtx",
      "preferredPayloadType": 106,
      "clockRate": 90000,
      "parameters": {
        "apt": 105
      },
      "rtcpFeedback": []
    },
    {
      "kind": "video",
      "mimeType": "video/rtx",
      "preferredPayloadType": 108,
      "clockRate": 90000,
      "parameters": {
        "apt": 107
      },
      "rtcpFeedback": []
    },
    {
      "kind": "video",
      "mimeType": "video/rtx",
      "preferredPayloadType": 110,
      "clockRate": 90000,
      "parameters": {
        "apt": 109
      },
      "rtcpFeedback": []
    },
    {
      "kind": "video",
      "mimeType": "video/rtx",
      "preferredPayloadType": 112,
      "clockRate": 90000,
      "parameters": {
        "apt": 111
      },
      "rtcpFeedback": []
    },
    {
      "kind": "video",
      "mimeType": "video/rtx",
      "preferredPayloadType": 114,
      "clockRate": 90000,
      "parameters": {
        "apt": 113
      },
      "rtcpFeedback": []
    },
    {
      "kind": "video",
      "mimeType": "video/rtx",
      "preferredPayloadType": 116,
      "clockRate": 90000,
      "parameters": {
        "apt": 115
      },
      "rtcpFeedback": []
    },
    {
      "kind": "video",
      "mimeType": "video/rtx",
      "preferredPayloadType": 118,
      "clockRate": 90000,
      "parameters": {
        "apt": 117
      },
      "rtcpFeedback": []
    },
    {
      "kind": "video",
      "mimeType": "video/rtx",
      "preferredPayloadType": 120,
      "clockRate": 90000,
      "parameters": {
        "apt": 119
      },
      "rtcpFeedback": []
    },
    {
      "kind": "audio",
      "mimeType": "audio/opus",
      "clockRate": 48000,
      "channels": 2,
      "rtcpFeedback": [
        {
          "type": "transport-cc",
          "parameter": ""
        }
      ],
      "parameters": {},
      "preferredPayloadType": 100
    }
  ],
  "headerExtensions": [
    {
      "kind": "audio",
      "uri": "urn:ietf:params:rtp-hdrext:sdes:mid",
      "preferredId": 1,
      "preferredEncrypt": false,
      "direction": "sendrecv"
    },
    {
      "kind": "video",
      "uri": "urn:ietf:params:rtp-hdrext:sdes:mid",
      "preferredId": 1,
      "preferredEncrypt": false,
      "direction": "sendrecv"
    },
    {
      "kind": "video",
      "uri": "urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id",
      "preferredId": 2,
      "preferredEncrypt": false,
      "direction": "recvonly"
    },
    {
      "kind": "video",
      "uri": "urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id",
      "preferredId": 3,
      "preferredEncrypt": false,
      "direction": "recvonly"
    },
    {
      "kind": "audio",
      "uri": "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time",
      "preferredId": 4,
      "preferredEncrypt": false,
      "direction": "sendrecv"
    },
    {
      "kind": "video",
      "uri": "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time",
      "preferredId": 4,
      "preferredEncrypt": false,
      "direction": "sendrecv"
    },
    {
      "kind": "audio",
      "uri": "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01",
      "preferredId": 5,
      "preferredEncrypt": false,
      "direction": "recvonly"
    },
    {
      "kind": "video",
      "uri": "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01",
      "preferredId": 5,
      "preferredEncrypt": false,
      "direction": "sendrecv"
    },
    {
      "kind": "video",
      "uri": "http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07",
      "preferredId": 6,
      "preferredEncrypt": false,
      "direction": "sendrecv"
    },
    {
      "kind": "video",
      "uri": "urn:ietf:params:rtp-hdrext:framemarking",
      "preferredId": 7,
      "preferredEncrypt": false,
      "direction": "sendrecv"
    },
    {
      "kind": "audio",
      "uri": "urn:ietf:params:rtp-hdrext:ssrc-audio-level",
      "preferredId": 10,
      "preferredEncrypt": false,
      "direction": "sendrecv"
    },
    {
      "kind": "video",
      "uri": "urn:3gpp:video-orientation",
      "preferredId": 11,
      "preferredEncrypt": false,
      "direction": "sendrecv"
    },
    {
      "kind": "video",
      "uri": "urn:ietf:params:rtp-hdrext:toffset",
      "preferredId": 12,
      "preferredEncrypt": false,
      "direction": "sendrecv"
    }
  ]
}

consume rtpParameters:

{
  "codecs": [
    {
      "mimeType": "video/H264",
      "payloadType": 105,
      "clockRate": 90000,
      "parameters": {
        "level-asymmetry-allowed": 1,
        "packetization-mode": 1,
        "profile-level-id": "42001f"
      },
      "rtcpFeedback": [
        {
          "type": "transport-cc",
          "parameter": ""
        },
        {
          "type": "ccm",
          "parameter": "fir"
        },
        {
          "type": "nack",
          "parameter": ""
        },
        {
          "type": "nack",
          "parameter": "pli"
        }
      ]
    },
    {
      "mimeType": "video/rtx",
      "payloadType": 106,
      "clockRate": 90000,
      "parameters": {
        "apt": 105
      },
      "rtcpFeedback": []
    }
  ],
  "headerExtensions": [
    {
      "uri": "urn:ietf:params:rtp-hdrext:sdes:mid",
      "id": 1,
      "encrypt": false,
      "parameters": {}
    },
    {
      "uri": "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time",
      "id": 4,
      "encrypt": false,
      "parameters": {}
    },
    {
      "uri": "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01",
      "id": 5,
      "encrypt": false,
      "parameters": {}
    },
    {
      "uri": "http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07",
      "id": 6,
      "encrypt": false,
      "parameters": {}
    },
    {
      "uri": "urn:3gpp:video-orientation",
      "id": 11,
      "encrypt": false,
      "parameters": {}
    },
    {
      "uri": "urn:ietf:params:rtp-hdrext:toffset",
      "id": 12,
      "encrypt": false,
      "parameters": {}
    }
  ],
  "encodings": [
    {
      "ssrc": 987827563,
      "rtx": {
        "ssrc": 586626929
      }
    }
  ],
  "rtcp": {
    "cname": "R7MQL9AP2gBUVMWq",
    "reducedSize": true,
    "mux": true
  },
  "mid": "2"
}

consume extendedRtpCapabilities:

{
  "codecs": [
    {
      "mimeType": "video/H264",
      "kind": "video",
      "clockRate": 90000,
      "localPayloadType": 96,
      "localRtxPayloadType": 97,
      "remotePayloadType": 115,
      "remoteRtxPayloadType": 116,
      "localParameters": {
        "level-asymmetry-allowed": 1,
        "packetization-mode": 1,
        "profile-level-id": "640c1f"
      },
      "remoteParameters": {
        "packetization-mode": 1,
        "level-asymmetry-allowed": 1,
        "profile-level-id": "640c32"
      },
      "rtcpFeedback": [
        {
          "type": "goog-remb",
          "parameter": ""
        },
        {
          "type": "transport-cc",
          "parameter": ""
        },
        {
          "type": "ccm",
          "parameter": "fir"
        },
        {
          "type": "nack",
          "parameter": ""
        },
        {
          "type": "nack",
          "parameter": "pli"
        }
      ]
    },
    {
      "mimeType": "video/H264",
      "kind": "video",
      "clockRate": 90000,
      "localPayloadType": 96,
      "localRtxPayloadType": 97,
      "remotePayloadType": 117,
      "remoteRtxPayloadType": 118,
      "localParameters": {
        "level-asymmetry-allowed": 1,
        "packetization-mode": 1,
        "profile-level-id": "640c1f"
      },
      "remoteParameters": {
        "packetization-mode": 1,
        "level-asymmetry-allowed": 1,
        "profile-level-id": "640c1f"
      },
      "rtcpFeedback": [
        {
          "type": "goog-remb",
          "parameter": ""
        },
        {
          "type": "transport-cc",
          "parameter": ""
        },
        {
          "type": "ccm",
          "parameter": "fir"
        },
        {
          "type": "nack",
          "parameter": ""
        },
        {
          "type": "nack",
          "parameter": "pli"
        }
      ]
    },
    {
      "mimeType": "video/H264",
      "kind": "video",
      "clockRate": 90000,
      "localPayloadType": 98,
      "localRtxPayloadType": 99,
      "remotePayloadType": 119,
      "remoteRtxPayloadType": 120,
      "localParameters": {
        "level-asymmetry-allowed": 1,
        "packetization-mode": 1,
        "profile-level-id": "42e01f"
      },
      "remoteParameters": {
        "packetization-mode": 1,
        "level-asymmetry-allowed": 1,
        "profile-level-id": "42e01f"
      },
      "rtcpFeedback": [
        {
          "type": "goog-remb",
          "parameter": ""
        },
        {
          "type": "transport-cc",
          "parameter": ""
        },
        {
          "type": "ccm",
          "parameter": "fir"
        },
        {
          "type": "nack",
          "parameter": ""
        },
        {
          "type": "nack",
          "parameter": "pli"
        }
      ]
    },
    {
      "mimeType": "video/VP8",
      "kind": "video",
      "clockRate": 90000,
      "localPayloadType": 100,
      "localRtxPayloadType": 101,
      "remotePayloadType": 101,
      "remoteRtxPayloadType": 102,
      "localParameters": {},
      "remoteParameters": {
        "x-google-start-bitrate": 1000
      },
      "rtcpFeedback": [
        {
          "type": "goog-remb",
          "parameter": ""
        },
        {
          "type": "transport-cc",
          "parameter": ""
        },
        {
          "type": "ccm",
          "parameter": "fir"
        },
        {
          "type": "nack",
          "parameter": ""
        },
        {
          "type": "nack",
          "parameter": "pli"
        }
      ]
    },
    {
      "mimeType": "audio/opus",
      "kind": "audio",
      "clockRate": 48000,
      "channels": 2,
      "localPayloadType": 111,
      "remotePayloadType": 100,
      "localParameters": {
        "minptime": 10,
        "useinbandfec": 1
      },
      "remoteParameters": {},
      "rtcpFeedback": [
        {
          "type": "transport-cc",
          "parameter": ""
        }
      ]
    }
  ],
  "headerExtensions": [
    {
      "kind": "video",
      "uri": "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time",
      "sendId": 13,
      "recvId": 4,
      "encrypt": false,
      "direction": "sendrecv"
    },
    {
      "kind": "audio",
      "uri": "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01",
      "sendId": 2,
      "recvId": 5,
      "encrypt": false,
      "direction": "sendonly"
    },
    {
      "kind": "video",
      "uri": "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01",
      "sendId": 2,
      "recvId": 5,
      "encrypt": false,
      "direction": "sendrecv"
    },
    {
      "kind": "video",
      "uri": "http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07",
      "sendId": 8,
      "recvId": 6,
      "encrypt": false,
      "direction": "sendrecv"
    },
    {
      "kind": "audio",
      "uri": "urn:ietf:params:rtp-hdrext:ssrc-audio-level",
      "sendId": 1,
      "recvId": 10,
      "encrypt": false,
      "direction": "sendrecv"
    },
    {
      "kind": "video",
      "uri": "urn:3gpp:video-orientation",
      "sendId": 3,
      "recvId": 11,
      "encrypt": false,
      "direction": "sendrecv"
    },
    {
      "kind": "video",
      "uri": "urn:ietf:params:rtp-hdrext:toffset",
      "sendId": 14,
      "recvId": 12,
      "encrypt": false,
      "direction": "sendrecv"
    }
  ]
}

routerOptions:

"routerOptions": {
        "mediaCodecs": [
          {
            "kind": "audio",
            "mimeType": "audio/opus",
            "clockRate": 48000,
            "channels": 2
          },
          {
            "kind": "video",
            "mimeType": "video/VP8",
            "clockRate": 90000,
            "parameters": {
              "x-google-start-bitrate": 1000
            }
          },
          {
            "kind": "video",
            "mimeType": "video/VP9",
            "clockRate": 90000,
            "parameters": {
              "profile-id": 2,
              "x-google-start-bitrate": 1000
            }
          },
          {
            "kind": "video",
            "mimeType": "video/h264",
            "clockRate": 90000,
            "parameters": {
              "packetization-mode": 1,
              "profile-level-id": "42001f",
              "level-asymmetry-allowed": 1
            }
          },
          {
            "kind": "video",
            "mimeType": "video/h264",
            "clockRate": 90000,
            "parameters": {
              "packetization-mode": 1,
              "profile-level-id": "420032",
              "level-asymmetry-allowed": 1
            }
          },
          {
            "kind": "video",
            "mimeType": "video/h264",
            "clockRate": 90000,
            "parameters": {
              "packetization-mode": 1,
              "profile-level-id": "4d0032",
              "level-asymmetry-allowed": 1
            }
          },
          {
            "kind": "video",
            "mimeType": "video/h264",
            "clockRate": 90000,
            "parameters": {
              "packetization-mode": 1,
              "profile-level-id": "4d0032",
              "level-asymmetry-allowed": 1
            }
          },
          {
            "kind": "video",
            "mimeType": "video/h264",
            "clockRate": 90000,
            "parameters": {
              "packetization-mode": 1,
              "profile-level-id": "640032",
              "level-asymmetry-allowed": 1
            }
          },
          {
            "kind": "video",
            "mimeType": "video/h264",
            "clockRate": 90000,
            "parameters": {
              "packetization-mode": 1,
              "profile-level-id": "640c32",
              "level-asymmetry-allowed": 1
            }
          },
          {
            "kind": "video",
            "mimeType": "video/h264",
            "clockRate": 90000,
            "parameters": {
              "packetization-mode": 1,
              "profile-level-id": "640c1f",
              "level-asymmetry-allowed": 1
            }
          },
          {
            "kind": "video",
            "mimeType": "video/h264",
            "clockRate": 90000,
            "parameters": {
              "packetization-mode": 1,
              "profile-level-id": "42e01f",
              "level-asymmetry-allowed": 1
            }
          }
        ]
      },

Your client does not support H264 with "profile-level-id": "42001f". That’s all. We cannot do magic. Tell the mediasoup Router to just allow a more constrained set of H264 configurations so producers will be forced to use them.

Thanks