[opus] live streaming

Ralph Giles giles at thaumas.net
Wed Aug 7 14:31:15 PDT 2013


On 13-08-07 2:09 PM, Greg Bernard wrote:
> I just had two quick questions about opus. When using the encoder, how
> do I use a live microphone as the source, and how do I stream the output
> to a server? (Would it work with rtp, http, etc.?) Thanks! :)

That depends on the platform. There are platform-specific APIs you can
use to capture audio and feed it to the encoder, or to build a pipeline
to do the same.

For example on linux:

arecord -c 2 -r 48000 -twav - | opusenc - - | \
   oggfwd icecast.example.com 8000 password /stream.opus

Would record from the default input and stream it over http to an
icecast server, which would replicate it to any clients who connected.

Or of course you can write your own code to do something similar. See
the opusenc source and the Ogg encapsulation draft for details of how to
do http streaming.

  http://tools.ietf.org/html/draft-ietf-codec-oggopus
  https://git.xiph.org/?p=opus-tools.git

You can also send opus over rtp. There's less ready code for that, but
the webrtc.org project supports it, and there's a similar patch for
Asterisk. I wrote a quick debugging tool for RTP encapsulation, but it's
not ready for general applications. It's in the opus-tools git
repository, alongside opusenc.

  http://code.google.com/p/webrtc/source/checkout
  https://github.com/meetecho/asterisk-opus
  http://tools.ietf.org/html/draft-spittka-payload-rtp-opus

Hope that helps, and let me know if you have more specific questions!

 -r


More information about the opus mailing list