Skip to content

Instantly share code, notes, and snippets.

@smx-smx
Last active November 27, 2021 16:16
Show Gist options
  • Save smx-smx/cbb1290edff7d8e2ddbae48f1b0e1745 to your computer and use it in GitHub Desktop.
Save smx-smx/cbb1290edff7d8e2ddbae48f1b0e1745 to your computer and use it in GitHub Desktop.
vbaudio cable + gstreamer + gstreamer-rtsp-server desktop audio streaming
#!/bin/sh
cleanup(){
if [ ! -z $rtpsrv ]; then kill $rtpsrv; fi
}
trap cleanup INT TERM
gst-launch-1.0 -v \
wasapisrc device="\{0.0.1.00000000\}.\{3b0ac205-7d2e-4c39-82b6-fde906d514bb\}" \
! audioconvert \
! rtpL16pay \
! udpsink host=192.168.0.6 port=9091 &
rtpsrv=$!
echo "rtp server started: ${rtpsrv}"
pipeline(){
echo udpsrc uri="udp://192.168.0.6:9091" \
! "application/x-rtp, media=(string)audio, payload=(int)96, clock-rate=(int)48000, encoding-name=(string)L16, encoding-params=(string)2" \
! queue max-size-buffers=0 name=pay0
}
./rtsp-server.exe "$(pipeline)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment