Skip to content

Instantly share code, notes, and snippets.

@anselmobattisti
Created September 22, 2019 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anselmobattisti/ba240422eac9dfeb1da447772adc4717 to your computer and use it in GitHub Desktop.
Save anselmobattisti/ba240422eac9dfeb1da447772adc4717 to your computer and use it in GitHub Desktop.
Send mp3 audio file via UDP gstreamer
Send audio data
gst-launch-1.0 multifilesrc location=sample.mp3 loop=true \
! mpegaudioparse \
! mpg123audiodec \
! audioconvert \
! audioresample \
! audio/x-raw, rate=16000, channels=1, format=S16LE \
! audiomixer blocksize=320 \
! udpsink host=localhost port=10000
VMS udp_to_udp
gst-launch-1.0 \
udpsrc port=10000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" \
! udpsink host=localhost port=10001
Consume audio data
gst-launch-1.0 -v udpsrc port=10001 \
! rawaudioparse use-sink-caps=false format=pcm pcm-format=s16le sample-rate=16000 num-channels=1 \
! queue \
! audioconvert \
! audioresample \
! autoaudiosink
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment