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! :) -- <>< Greg Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/opus/attachments/20130807/5e6e57bd/attachment.htm
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
On 13-08-13 2:07 AM, Greg Bernard wrote:> Hey Ralph, I tried using icecast for streaming, but I couldn't get the > latency below five or six seconds. I need to get it down to at least > under one second, even much less than that if possible. I need it for a > live audio situation where it would be connecting to several dozen > mobile devices. Do you know the best application or method of streaming > for this? I've been working on finding a solution all day and it'd be > great if you could help me out. Thanks! :)You can get the latency down to a second or two by adjusting the buffer sizes in the icecast config. HTTP streaming with sub-second latency isn't really possible on the WAN. If you need that you'll have to switch to an RTP-based solution. There's no great opus-supporting server solution for that. The code at webrtc.org can do this, but afaik there's only glue code for browsers as clients. People are working on reflectors and stand-alone source clients, but I don't know of anything I can recommend at this point. You'll probably have to write some code if you want this to work. -r