Twitch

Open Twitch, sign in with a valid account, go to Settings, Stream. Search for the Primary Stream Key, copy it somewhere. Then search for Recommended Ingest Endpoints, that should be in this page. Copy one of the URLs. Insert the URL and the stream key in MediaMTX in this way:

paths:
  mypath:
    forward:
      # Use an hashtag to separate the URL from the stream key.
      # "rtmp://ingest.global-contribute.live-video.net/app" was the URL Twitch was reporting last time this documentation was updated. Check that it is still correct.
      # Also replace rtmp:// with rtmps:// in order to enable encryption in-transit.
      - dest: rtmps://ingest.global-contribute.live-video.net/app#streamKey