Skip to content

Instantly share code, notes, and snippets.

@ast
Last active November 12, 2019 19:12
Show Gist options
  • Save ast/60f1e0293f5a45f1c905f401724ec17e to your computer and use it in GitHub Desktop.
Save ast/60f1e0293f5a45f1c905f401724ec17e to your computer and use it in GitHub Desktop.
Experiments with full duplex audio streaming in gstreamer

Experiments with full duplex audio streaming in gstreamer

  • Expected behaviour: full duplex stream
  • Observed behaviour: does not start sending until data is received.
AUDIO_CAPS="audio/x-raw,format=S16LE,rate=24000"
RTP_CAPS="application/x-rtp,media=(string)audio,clock-rate=(int)48000,encoding-name=(string)OPUS,payload=(int)96"

REMOTE=192.168.1.10

gst-launch-1.0 -v rtpbin name=rtpbin latency=100 \
	audiotestsrc is-live=true ! $AUDIO_CAPS ! opusenc ! rtpopuspay ! rtpbin.send_rtp_sink_0  \
	rtpbin.send_rtp_src_0 ! udpsink host=$REMOTE port=5000 \
	rtpbin.send_rtcp_src_0 ! udpsink sync=false async=false host=$REMOTE port=5001 \
	udpsrc port=5000 caps=$RTP_CAPS ! rtpbin.recv_rtp_sink_0 rtpbin. ! rtpopusdepay ! opusdec ! autoaudiosink \
	udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment