icecastliquidsoap

Mixing two icecast stream with liquidsoap and stream it to icecast server


I trying to mix two stream with liquidsoap one on the left another on the right side how to mix it and stream it to icecast server. I'm already stream those two stream with darkice

Here is my pseudo-code

stream1 = 'localhost/stream1' " streamed with darkice on my localmachine 
stream2 = 'localhost/stream2' " streamed with darkice on my localmachine

stream3 = mix(stream1[on the left], stream2[on the right])

output.icecast(stream3)

Anyone have any idea? i'm new to this kind of problems.


Solution

  • You could use input.harbor to get the streams into liquidsoap, then mix them together.

    source_1 = input.harbor('source1',port=9000)
    source_2 = input.harbor('source2',port=9001)
    
    mixed = add([source_1,source_2])
    
    output.icecast(%vorbis,id="icecast",                                                                                                                                     
                   mount="mystream.ogg",                                                                                                                                   
                   host="localhost", password="hackme",                                                                                                                 
                   icy_metadata="true",description="",                                                                                                          
                   url="",                                                                                                                               
                   mixed)                                                                                                                                                   
    

    If the streams are already left/right panned, this should work. Otherwise liquidsoap does have a stereo.pan function.