[Icecast] targeted ads

Karl Heyes karl at xiph.org
Fri May 8 15:16:18 UTC 2009

Michał Jaszczyk wrote:
> Hi there,
> I work at an internet radio station. My management thought it might be
> a good idea to enhance our radio with targeted ads. Do you know of any
> streaming server that is capable of inserting targeted ads into the
> stream? So far I have only found Ando Media's Targeted Ad Injector
> (http://andomedia.com/) which claims to be open source but I can't
> find the source anywhere.

I have some work implemented for this as an extension to my 10pre code. 
The interfaces are not documented yet as I wanted to try different use 
cases.  If you are interested then you are welcome to try it out and 
send feedback


with this, each listener is allocated a group id (default 0) which the 
server will use to lookup a file to play. The number of groups is 
determined by the <mount> setting <jingle-groups>.  At the moment the 
group is only set in auth url by the Jingle-group; header, although I do 
have a hardcoded switch to allocate the next id to the next new listener 
for testing.

You essentially set the group to file mapping via admin eg


files are in webroot.  You then just trigger when the inserts are to be 
run. This is where things differ slightly.

With vorbis streams, the trigger is a simple vorbis file from the source 
client that lasts however long you want (can be silence as the content 
won't be sent to listeners) but has a Jingle: in the headers.

With non-ogg streams things get more awkward as you don't have the same 
sort of information in stream and metadata inserts are not good enough. 
The mechanism currently uses the /admin/jingle interface again but you 
have an option of


informs the server that this stream will be in jingle mode for 10 
seconds. Any jingle files lasting longer than that will complete then 
return listeners to the stream.


same sort of thing but a toggle

I suspect the latter will be better so that people can interface with 
their source clients better. eg

get next file
    if file is insert marker then
    if insert marker finished then


More information about the Icecast mailing list