Add records to referenced sources #4067
Replies: 2 comments
-
Hi @JonathanThorpe, def create_input(params)
id = string.id.default(params.id, default="my_source")
log("Add stream #{id} / #{params.url}")
input.ffmpeg(params.url, id=id, start=false)
end
config_data = load_config()
streams = list.map(create_input, config_data.inputs) But I don't understand this thing def ready_sources() =
list.find(default=fail, source.is_ready, streams())
end
radio = mksafe(source.dynamic(ready_sources)) Are you trying to find the first non-failed source? You may want to use |
Beta Was this translation helpful? Give feedback.
-
Hi @vitoyucepi, Regarding The problem I'm trying to solve is that I have a list of streams (ordered) and the highest priority stream is played unless a higher one becomes available at which time, switch to that. This is normal fallback behaviour but I don't want to run inactive streams which in some cases is running from a mobile connection. The streams are a combination of SRT (input.srt) and HTTP (input.ffmpeg). I was thinking of tackling this by iterating through each stream and:
The above function would be initiated from a thread which runs every 5 minutes or triggered when the currently playing stream fails (perhaps To set the availability flag against the stream, I was looking to:
Perhaps my approach is over-complicating this? |
Beta Was this translation helpful? Give feedback.
-
Hi All,
I'm attempting to write a script that dynamically manages sources.
I've got this working:
In addition to this, I want to add some monitoring of the individual streams so that I can
source.start()
andsource.stop()
as required based on specific parameters that I manage through a separate thread.I was hoping to add a record to the following:
And then dynamically set foo and bar later on, however I don't seem to be able to set these record attributes.
Is there a better approach?
Beta Was this translation helpful? Give feedback.
All reactions