Skip to content

Instantly share code, notes, and snippets.

@recursivecodes
Last active February 9, 2024 13:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save recursivecodes/f6f3840025f9431f86bb07d588dd9c92 to your computer and use it in GitHub Desktop.
Save recursivecodes/f6f3840025f9431f86bb07d588dd9c92 to your computer and use it in GitHub Desktop.

Publish to Stage with WHIP

Test Video & Audio Src

gst-launch-1.0 \
  videotestsrc \
  ! videoconvert \
  ! openh264enc \
  ! rtph264pay \
  ! 'application/x-rtp,media=video,encoding-name=H264,payload=97,clock-rate=90000' \
  ! whip.sink_0 audiotestsrc wave=4 \
  ! audioconvert \
  ! opusenc \
  ! rtpopuspay \
  ! 'application/x-rtp,media=audio,encoding-name=OPUS,payload=96,clock-rate=48000,encoding-params=(string)2' \
  ! whip.sink_1 \
  whipsink \
  name=whip \
  auth-token=$IVS_STAGE_TOKEN \
  whip-endpoint=https://global.whip.live-video.net/

From Webcam & Mic (MacOS)

gst-launch-1.0 \
  avfvideosrc device-index=0 \
  ! videoconvert \
  ! x264enc tune=zerolatency bitrate=2500 speed-preset=ultrafast \
  ! rtph264pay \
  ! 'application/x-rtp,media=video,encoding-name=H264,payload=97,clock-rate=90000,width=1280,height=720,framerate=30/1' \
  ! whip.sink_0 autoaudiosrc wave=4 \
  ! audioconvert \
  ! opusenc \
  ! rtpopuspay \
  ! 'application/x-rtp,media=audio,encoding-name=OPUS,payload=96,clock-rate=48000,encoding-params=(string)2' \
  ! whip.sink_1 \
  whipsink \
  name=whip \
  auth-token=$IVS_STAGE_TOKEN \
  whip-endpoint=https://global.whip.live-video.net/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment