mediasoup-demo icon indicating copy to clipboard operation
mediasoup-demo copied to clipboard

Experimental WHIP support

Open vpalmisano opened this issue 4 years ago • 5 comments

This PR implements a basic WebRTC-HTTP ingestion protocol (WHIP) support for mediasoup demo. Tested using https://github.com/lminiero/simple-whip-client:

  1. Visit https://127.0.0.1:3000/?info=true&roomId=test&produce=false
  2. Start the whip client:
./whip-client -u https://127.0.0.1:4443/whip/test/broadcasterId \
    -V "videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! vp8enc deadline=1 ! rtpvp8pay pt=96 ssrc=2 picture-id-mode=2 ! queue ! application/x-rtp,media=video,encoding-name=VP8,payload=96" \
    -A "audiotestsrc is-live=true wave=red-noise ! audioconvert ! audioresample ! queue ! opusenc ! rtpopuspay pt=100 ssrc=1 ! queue ! application/x-rtp,media=audio,encoding-name=OPUS,payload=100"
  1. Stop the broadcaster:
curl -k -X DELETE https://127.0.0.1:4443/whip/test/broadcasterId

vpalmisano avatar Nov 07 '21 13:11 vpalmisano

Thanks. I'll review this in a few days.

ibc avatar Nov 10 '21 12:11 ibc

is this going to be added?

mpisat avatar Feb 05 '23 03:02 mpisat

bump

namnm avatar Mar 06 '23 17:03 namnm

I guess we can try https://github.com/vpalmisano/mediasoup-demo/tree/feat/server/Experimental-WHIP-support instead?

mpisat avatar Mar 07 '23 12:03 mpisat

Just a note, WHIP spec requires a Location header, which should point to the endpoint the client could use for PATCH and DELETE requests, and it's mandatory in OBS 30+ for WHIP integration to work. Otherwise, it will fail to start the stream.

Something like this

    res.setHeader(
      'Location',
      `https://${config.domain}:${config.https.listenPort}/whip/${req.params.roomId}/${req.params.broadcasterId}`,
    )

ArmorDarks avatar Nov 12 '23 15:11 ArmorDarks