Stream WebM vorbis audio using GStreamer over TCP


Vorbis audio stream has no metadata regarding the audio itself or any other timing information. It needs to be streamed within a container such as WebM or OGG, or using a protocol such as RTP. In this post we’ll see the GStreamer commands to stream Vorbis audio within the WebM container, over TCP.

Receiving End

Execute the following pipeline:

gst-launch tcpserversrc port=9001 ! matroskademux ! vorbisdec ! audioconvert ! alsasink sync=false

Sending End

Execute the following pipeline:

gst-launch filesrc location=big_buck_bunny_480p_stereo.ogg ! oggdemux ! vorbisparse ! webmmux streamable=true ! tcpclientsink port=9001

At the sending end, I extract a vorbis audio stream from an ogg file and feed it to the receiving end.

Relay

Audio can be relayed by using GStreamer like this:

gst-launch tcpserversrc port=9001 ! matroskademux ! vorbisdec ! audiorate tolerance=20000000 ! vorbisenc ! webmmux streamable=true ! tcpclientsink port=9002

The audiorate element is crucial to remove any jitter/choppiness in the audio.

3 thoughts on “Stream WebM vorbis audio using GStreamer over TCP

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s