I have an Icecast server and an Asterisk dialplan containing a call to ICES(/my/ices.xml). So Asterisk launches "ices /my/ices.xml" where /my/ices.xml contains: <input> <module>stdinpcm</module> <param name="rate">8000</param> <param name="channels">1</param> </input> and <encode> <samplerate>8000</samplerate> <channels>1</channels> </encode> If I place a call through Asterisk so that ICES is spawned, I can talk on the phone and here myself clearly on a shout client like VideoLan's VLC connected to my Icecast URL. However, if Icecast is configured to use another stream (or the Asterisk stream) as a "fallback-mount" and the sample rates are not identical, audio on the client is crippled. However, if I stop the VLC client and reconnect to the Icecast URL, audio is OK, whether listening to one or the other stream source with different rates. So is it just a client bug or an expected behavior? I guess the client can't tell if there's a sample rate change unless it reconnects so it may not be a client bug. I suppose I must make sure the sampe rates are identical in the fallback stream. Does anyone know how I can achieve this? Changing /my/ices.xml's <encode> samplerate to 44100 doesn't seem to work or is unsupported. Can reencoding be done externally by another command-line program before sending it to Icecast? Thanks, Vieri
On Mon, 14 Feb 2011, Vieri wrote:> So is it just a client bug or an expected behavior? I guess the client > can't tell if there's a sample rate change unless it reconnects so it > may not be a client bug.Since this is Ices2 and it's outputting Ogg Vorbis, I'dve thought this should work. So maybe it is a client bug. Certainly, if you were sending MP3, it would have to be the same sample/channels, but IMHO Ogg Vorbis players *should* deal with it.> I suppose I must make sure the sampe rates are identical in the fallback > stream.> Does anyone know how I can achieve this? Changing /my/ices.xml's > <encode> samplerate to 44100 doesn't seem to work or is unsupported.You can get Ices to reencode for you. Put this somewhere in your stream instance (not sure if placement matters): <resample> <in-rate>8000</in-rate> <out-rate>44100</out-rate> </resample> And use 44100 in your encode section. Note that there's the downmix parameter to convert stereo to mono, but I don't see any way to go the other way. Maybe you can just specify two channels to the encoder and it'll get it right. I've also not tried up-sampling like this but it should work in theory. Good luck! Geoff.
Hi! Le lundi 14 f?vrier 2011 08:01:20, Vieri a ?crit :> Can reencoding be done externally by another command-line program before > sending it to Icecast?Since nobody else mentioned it, I will do our self-promotion.. You should be able to use Liquidsoap for that. One the one hand, you have an input.external operator which can take PCM input from an external program. On the other hand, there are switch operators which can be used to switch smoothly from one source to another.. Romain
--- On Tue, 2/15/11, Romain Beauxis <toots at rastageeks.org> wrote:> You should be able to use Liquidsoap for that.Looks interesting. I'm using Gentoo and the official portage tree doesn't have a liquidsoap ebuild. I noticed that Savonet actually prepared its own ebuilds but they are a bit outdated (2007). I could build directly from source but I'd prefer to do it via ebuilds. Scripting a custom ebuild seems long because of the large amount of dependencies that incidentally are also missing from the official Gentoo portage tree. Anyone at Savonet willing to update their ebuild overlay? Thanks