savonet / liquidsoap

Liquidsoap is a statically typed scripting general-purpose language with dedicated operators and backend for all thing media, streaming, file generation, automation, HTTP backend and more.
http://liquidsoap.info
GNU General Public License v2.0
1.4k stars 130 forks source link

DJ Port liquidsoap connection #555

Closed lucianozanita closed 6 years ago

lucianozanita commented 6 years ago

Hello, I'm trying to use the webcaster.js system in my streaming that already uses liquidsoap. Currently I use cast percentva where I use liquidsoap as autoDJ, in it there is the function that connects overwriting autoDJ when connected to it. Only I am not able to make another liquidsoap connect to this liquidsoap connecting port as DJ to override the programming that is currently playing. Could you help me with how to do this?

I currently mounted this script but without success.

My desire is to be able to connect via wss:// or ws:// to make the transmission.


#!/usr/bin/liquidsoap

#Configurações
output_host  = "IP"
output_port  = PORT
output_pass  = "password DJ user:pass"
set("log.file",false)
set("log.stdout",true)
set("server.telnet", false)
set("harbor.bind_addr", "0.0.0.0")
set("harbor.verbose",true)
set("harbor.timeout", 30.0)
set("harbor.reverse_dns", false)
#Configuração do Ponto para Studio
studio = input.harbor(
       "mount",
       port=3500,
       password="hackme"
)
#Montagem do Ponto
audiostudio = fallback(track_sensitive = false, [studio])
#Entrada para Streaming
output.shoutcast(
    %mp3(bitrate=64),
  host=output_host,
  port=output_port,
  password=output_pass,
  fallible=true,
  url="http://output_host:output_port",
  audiostudio)

console return:

2018/05/21 14:34:11 >>> LOG START
2018/05/21 14:34:11 [protocols.external:3] Found "/usr/bin/wget".
2018/05/21 14:34:11 [main:3] Liquidsoap 1.1.1
2018/05/21 14:34:11 [main:3] Using: pcre=6.2.5 dtools=0.3.1 duppy=0.5.1 cry=0.2.2 mm=0.2.1 ogg=0.4.5 vorbis=0.6.1 opus=0.1.0 speex=0.2.0 mad=0.4.4 dynlink=[distributed with Ocaml] lame=0.3.2 fdkaac=0.1.0 samplerate=0.1.2 taglib=0.3.1 magic=0.7.3 camomile=0.8.5 faad=0.3.2 ladspa=0.1.4 yojson=1.1.5
2018/05/21 14:34:11 [dynamic.loader:3] Could not find dynamic module for aacplus encoder.
2018/05/21 14:34:11 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master.
2018/05/21 14:34:11 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2018/05/21 14:34:11 [frame:3] Targetting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2018/05/21 14:34:11 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
2018/05/21 14:34:11 [threads:3] Created thread "generic queue #1".
2018/05/21 14:34:11 [threads:3] Created thread "generic queue #2".
2018/05/21 14:34:11 [harbor:3] Adding mountpoint '/mount' on port 3500
2018/05/21 14:34:11 [output(dot)shoutcast:3] Connecting mount / for source@170.81.43.130...
2018/05/21 14:34:11 [output(dot)shoutcast:3] Connection setup was successful.
2018/05/21 14:34:11 [threads:3] Created thread "wallclock_main" (1 total).
2018/05/21 14:34:11 [clock.wallclock_main:3] Streaming loop starts, synchronized with wallclock.
2018/05/21 14:34:11 [output(dot)shoutcast:3] Source failed (no more tracks) stopping output...
strange error flushing buffer ... 
strange error flushing buffer ... 
2018/05/21 14:34:11 [output(dot)shoutcast:3] Closing connection...

Just a note, I am mounting a port other than liquidsoap which will connect to the port of the liquidsoap in use as AutoDJ, logging in as DJ port.

toots commented 6 years ago

Hi,

I don't think that liquidsoap supports connecting as websocket client, only as server. However, the input.harbor should be able to also receive streams created by output.icecast from another liquidsoap client. The port shouldn't matter either as long as you set it to the correct value in output.icecast.

I'm closing the issue here since it isn't related to the code development. Feel free to continue the conversation at savonet-users@lists.sourceforge.net and all the best with your projects!