Discussion:
[Savonet-users] Liquidsoap input.harbor connections
Mark E
2017-04-11 00:44:18 UTC
Permalink
Hi, is it possible to accept multiple connects from different clients on
the input.harbor endpoint (for sending audio streams) and have those
connections sent out to different output.icecast endpoints? Or do I have
to set up unique input.harbor endpoints for each potential client? If I
can do that with one endpoint what's the best approach to setting that up?

Mark
Romain Beauxis
2017-04-11 14:14:05 UTC
Permalink
Hi Mark,

input.harbor connections are unique and scoped by: mountpoint, port

If you need multiple connections, you can thus use multiple endpoints
and/or ports, for instance:

s1 = input.harbor("source1",port=8000)
s2 = input.harbor("source2",port=8000)
other_s1 = input.harbor("source1",port=8005)

Makes sense?
Romain
Post by Mark E
Hi, is it possible to accept multiple connects from different clients on
the input.harbor endpoint (for sending audio streams) and have those
connections sent out to different output.icecast endpoints? Or do I have
to set up unique input.harbor endpoints for each potential client? If I
can do that with one endpoint what's the best approach to setting that up?
Mark
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Savonet-users mailing list
https://lists.sourceforge.net/lists/listinfo/savonet-users
Mark E
2017-04-11 16:56:35 UTC
Permalink
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Romain Beauxis
2017-04-12 20:03:35 UTC
Permalink
You could try to to use the on_connect parameter from input.harbor and pass
your parameters as headers.
Yes, that's what I thought. So to be clear I can mutiple endpoints on the
same port and those are unique connections and each connection can use a
different output, right?
It'd be really nice if we could pass parms in the URL and parse those to
create dynamic outputs based on the parms. What I've done is to create
commands that are issue over telnet to dynamically creating inputs and
outputs before a streaming client connects, that works. But it'd be so much
easier not having to use Telnet (point of failure, processing overhead,
resource overhead).
My use case is that there are an unknown (but reasonably low) number of
potential streaming clients that might connect and be connected at the same
time for anywhere from an hour to maybe 3 hours (each client may be a
different duration). Since I don't know the number streamer clients in
advance at any given moment in a day I need to dynamically build the inputs
and outputs as a client starts to connect (all this is driven by a Web site
interface sending a few commands to liquidsoap over a Telnet connect).
Or is there already a way to parse parms in the endpoint URL and take
http://theserver:9000/live?abc=123&xyz=456
<http://h5ks.mjt.lu/lnk/ADsAAHKI7CgAAAAAAAAAAGgH3uUAASJ-8QAAAAAAAAgArwBY7QrGeRODKGx2Rr6NqTadH_U5jAAHnU0/1/vK4yhTlDpK0GE2xg2WWjkw/aHR0cDovL3RoZXNlcnZlcjo5MDAwL2xpdmU_YWJjPTEyMyZ4eXo9NDU2>
Mark
Hi Mark,
input.harbor connections are unique and scoped by: mountpoint, port
If you need multiple connections, you can thus use multiple endpoints
s1 = input.harbor("source1",port=8000)
s2 = input.harbor("source2",port=8000)
other_s1 = input.harbor("source1",port=8005)
Makes sense?
Romain
Post by Mark E
Hi, is it possible to accept multiple connects from different clients on
the input.harbor endpoint (for sending audio streams) and have those
connections sent out to different output.icecast endpoints? Or do I have
to set up unique input.harbor endpoints for each potential client? If I
can do that with one endpoint what's the best approach to setting that up?
Mark
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
<http://h5ks.mjt.lu/lnk/ADsAAHKI7CgAAAAAAAAAAGgH3uUAASJ-8QAAAAAAAAgArwBY7QrGeRODKGx2Rr6NqTadH_U5jAAHnU0/2/rDL1zksw13JnGFpuVp9SGQ/aHR0cDovL3NkbS5saW5rL3NsYXNoZG90>
_______________________________________________
Savonet-users mailing list
https://lists.sourceforge.net/lists/listinfo/savonet-users
<http://h5ks.mjt.lu/lnk/ADsAAHKI7CgAAAAAAAAAAGgH3uUAASJ-8QAAAAAAAAgArwBY7QrGeRODKGx2Rr6NqTadH_U5jAAHnU0/3/XQW-AiOM-OnSTvq92lc8jQ/aHR0cHM6Ly9saXN0cy5zb3VyY2Vmb3JnZS5uZXQvbGlzdHMvbGlzdGluZm8vc2F2b25ldC11c2Vycw>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot <http://h5ks.mjt.lu/lnk/ADsAAHKI7CgAAAAAAAAAAGgH3uUAASJ-8QAAAAAAAAgArwBY7QrGeRODKGx2Rr6NqTadH_U5jAAHnU0/4/q_0os7yG4y8YZNMk886igA/aHR0cDovL3NkbS5saW5rL3NsYXNoZG90>
_______________________________________________
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Savonet-users mailing list
https://lists.sourceforge.net/lists/listinfo/savonet-users
Christo Grozev
2017-04-24 13:36:31 UTC
Permalink
This post might be inappropriate. Click to display it.
Romain Beauxis
2017-05-22 17:22:40 UTC
Permalink
Hi Christo,

I think I understand what you are describing but feel free to add more
code/example.

If you are using mp3 as an input format, metadata updates are nothing more
than a HTTP call. In theory, it should be possible to implement your own
handler for them, though you might have to fight with the harbor's
automatic registration of such handers. But. let's start with the idea:

In this tutorial: http://liquidsoap.fm/doc-1.3.0/harbor_http.html you can
see how to receive JSON metadata and insert them into the source. In
theory, you should be able to implement your own endpoint in a similar way
but adapted to the ICY metadata update protocol.

The protocol is described at least partially here for shoutcast:
https://www.radiotoolbox.com/community/forums/viewtopic.php?t=74 in section
Title streaming from source to server

The Icecast case may be slightly different, essentially in the endpoint
name and perhaps some parameters/authentication mechanism. I don't remember
all the details but you can have a look at the cry source code here:
https://github.com/savonet/ocaml-cry/blob/master/src/cry.ml#L712

Hope this helps,
Romain
Post by Christo Grozev
Dear Romain,
Further to Mark’s question/use case, I am trying to parse metadata from a
third-party streaming encoder that connects to my input.harbor. The
unexpected behavior is that there seems to be a delay of a few seconds
between the moment harbor reports (logs) receiving the meta data update
request from the encoder, and the time liquidsoap “processes” the metadata,
such as in an on_metadata event.
I need to eliminate this delay. Is there a way to capture the GET request
header when it arrives so I can act on it immediately? I tried doing this
via harbor.http.register but then it hijacks completely the request and the
metadata does not get updated in the stream.
Maybe there is an easy way to capture the logged events and parse them? (a
round-about hack would be to go via file.watch and the logfile, but I am
sure there is a more sane solution J)
Thanks for any feedback!
Christo
*Sent:* Wednesday, April 12, 2017 10:04 PM
*Subject:* Re: [Savonet-users] Liquidsoap input.harbor connections
You could try to to use the on_connect parameter from input.harbor and
pass your parameters as headers.
Yes, that's what I thought. So to be clear I can mutiple endpoints on the
same port and those are unique connections and each connection can use a
different output, right?
It'd be really nice if we could pass parms in the URL and parse those to
create dynamic outputs based on the parms. What I've done is to create
commands that are issue over telnet to dynamically creating inputs and
outputs before a streaming client connects, that works. But it'd be so much
easier not having to use Telnet (point of failure, processing overhead,
resource overhead).
My use case is that there are an unknown (but reasonably low) number of
potential streaming clients that might connect and be connected at the same
time for anywhere from an hour to maybe 3 hours (each client may be a
different duration). Since I don't know the number streamer clients in
advance at any given moment in a day I need to dynamically build the inputs
and outputs as a client starts to connect (all this is driven by a Web site
interface sending a few commands to liquidsoap over a Telnet connect).
Or is there already a way to parse parms in the endpoint URL and take
http://theserver:9000/live?abc=123&xyz=456
<http://h5ks.mjt.lu/lnk/ADsAAHKI7CgAAAAAAAAAAGgH3uUAASJ-8QAAAAAAAAgArwBY7QrGeRODKGx2Rr6NqTadH_U5jAAHnU0/1/vK4yhTlDpK0GE2xg2WWjkw/aHR0cDovL3RoZXNlcnZlcjo5MDAwL2xpdmU_YWJjPTEyMyZ4eXo9NDU2>
Mark
Hi Mark,
input.harbor connections are unique and scoped by: mountpoint, port
If you need multiple connections, you can thus use multiple endpoints
s1 = input.harbor("source1",port=8000)
s2 = input.harbor("source2",port=8000)
other_s1 = input.harbor("source1",port=8005)
Makes sense?
Romain
Hi, is it possible to accept multiple connects from different clients on
the input.harbor endpoint (for sending audio streams) and have those
connections sent out to different output.icecast endpoints? Or do I have
to set up unique input.harbor endpoints for each potential client? If I
can do that with one endpoint what's the best approach to setting that up?
Mark
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
<http://h5ks.mjt.lu/lnk/ADsAAHKI7CgAAAAAAAAAAGgH3uUAASJ-8QAAAAAAAAgArwBY7QrGeRODKGx2Rr6NqTadH_U5jAAHnU0/2/rDL1zksw13JnGFpuVp9SGQ/aHR0cDovL3NkbS5saW5rL3NsYXNoZG90>
_______________________________________________
Savonet-users mailing list
https://lists.sourceforge.net/lists/listinfo/savonet-users
<http://h5ks.mjt.lu/lnk/ADsAAHKI7CgAAAAAAAAAAGgH3uUAASJ-8QAAAAAAAAgArwBY7QrGeRODKGx2Rr6NqTadH_U5jAAHnU0/3/XQW-AiOM-OnSTvq92lc8jQ/aHR0cHM6Ly9saXN0cy5zb3VyY2Vmb3JnZS5uZXQvbGlzdHMvbGlzdGluZm8vc2F2b25ldC11c2Vycw>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot <http://h5ks.mjt.lu/lnk/ADsAAHKI7CgAAAAAAAAAAGgH3uUAASJ-8QAAAAAAAAgArwBY7QrGeRODKGx2Rr6NqTadH_U5jAAHnU0/4/q_0os7yG4y8YZNMk886igA/aHR0cDovL3NkbS5saW5rL3NsYXNoZG90>
_______________________________________________
Savonet-users mailing list
https://lists.sourceforge.net/lists/listinfo/savonet-users <http://h5ks.mjt.lu/lnk/ADsAAHKI7CgAAAAAAAAAAGgH3uUAASJ-8QAAAAAAAAgArwBY7QrGeRODKGx2Rr6NqTadH_U5jAAHnU0/5/wwjkmQWgFi7WktDTCEnkqA/aHR0cHM6Ly9saXN0cy5zb3VyY2Vmb3JnZS5uZXQvbGlzdHMvbGlzdGluZm8vc2F2b25ldC11c2Vycw>
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Savonet-users mailing list
https://lists.sourceforge.net/lists/listinfo/savonet-users
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Savonet-users mailing list
https://lists.sourceforge.net/lists/listinfo/savonet-users
Loading...