Automate external stream with variable end

You have a question or need an advice about how to do something? Ask it here!
polp6880
Posts: 23
Joined: 19 Apr 2020 19:04

Automate external stream with variable end

Post by polp6880 » 19 Apr 2020 19:23

Hi,

I'm trying to set up PFP to be able to handle the below use case.

We have 3 separate streams that need to be played on 3 separate times every day. We know the start time but we can never calculate the end time as this varies. It usually is around 20 minutes on weekdays and around 45 minutes on weekends. To solve this when working with previous solutions, we used to automatically start the stream on the time we want it to start and then, someone manually stops the stream. Technically, we always set a longer than required time for the stream so in the case when who is in charge to manually switch the stream off forgets or is unavailable, at some point, it always switches back.

Initially, I tried achieving this by setting an Overlay but the stream cut off after a few seconds of playout. I then created a program with the modstream start command but at this point, I didn't know what I should put in the script associated with that program. The script has 2 lines with a fixed 5-minute track followed by a LoadTrack item with the internet stream URL. When using the modstream start command, do I really need to associate a script at all or there's no need? But if I don't have the script, how can I load the 5-minute track before the internet stream starts playing?

In my test, as soon as the program start time came through, the MODStream player was shown and after a few seconds, the stream started playing. As it happened when I set it up as an Overlay, the stream played for a few seconds and it disconnected. In other words, setting this as an Overlay or with MODStream, I ended up having the same effect.

Can you please suggest a way I can set this up so the stream starts playing automatically after a fixed 5 minute track on a particular time? I'd want this to the FIXED and not SOFT so we always get the correct timing. It would also be great if there is a way to manually trigger the stream to stop so automatically, PFP flips back to the previously active program playlist.

Many thanks!

Paul

Inzane8305
Posts: 32
Joined: 06 Jun 2018 08:06

Re: Automate external stream with variable end

Post by Inzane8305 » 19 Apr 2020 21:41

That is almost as we have done things here:
Program starts at 10:45, a stream is running for 20 min., then normal music is running.

In a script we use "Loadtrack" press CTRL and click on "..."
cut1.PNG
then you can select a URL-stream. Set the time for play.
cut2.PNG
and do the rest of the script.

polp6880
Posts: 23
Joined: 19 Apr 2020 19:04

Re: Automate external stream with variable end

Post by polp6880 » 19 Apr 2020 22:49

Hi,

Thanks a lot for your reply.

That is exactly how I had set it up originally. The issue I am having though is that when the stream starts, it stops just after a few seconds of playout. Whenever I play the stream manually though, via drag and drop from the media library, it plays no problem for hours.

Could you please tell me what options you have enabled for the LoadTrack line, please?

User avatar
radio42
Site Admin
Posts: 6373
Joined: 05 Apr 2012 16:26

Re: Automate external stream with variable end

Post by radio42 » 19 Apr 2020 22:59

This is ONE option - and make sure to set the options SuppressHistoryCheck, SuppressAddHistory, KeepStreamLoading and KeepStremAliveOrSuppressRestrictions for script-line 2 (the LoadTrack URL one).
When you specify a Duration for the stream (in the above example 20min.), but you want to end it earlier you can simply press 'Play Next' to do so manually.
In the above example you need at least 3 sript-lines:
1. LoadTrack, YourIntro-File
2. the URL to play
3. Random, AnyMediaLib
Set the Loop Line parameter to 3 to not repeat lines 1&2! So that after the stream played it is not played again.

Another way is to use the MODStream Watcher:
https://www.proppfrexx.radio42.com/foru ... p?f=9&t=57

I assume, that the issue with the Overlay-Player is, that it creates the bundled streams upfront for all tracks to be played (note, that the Overlay-Player was designed to play advert/news tracks in an automated fashion). Thus the server might disconnect the ‘paused’ URL stream, as it is not active after some time.
The MODStream-Player is in contrast working differently, as it played the URL Stream right away, but just mutes it, in order prevent those disconnects – this is something the Overlay-Player cannot do, as it prepares the stream and then pauses them.
Thus, give the MODStream-Player a chance, as it was exactly designed for your use-case.

Also note the special MODStream settings in the general settings under the Streaming section - esp. the Stream Timeout option in case silence is send over the URL stream! I.e. if you URL stream is currently silence for more than this Stream Timeout seconds it will execute the assinged action (by default it will stop the mod stream).

On way here is to create a program which e.g. runs for the given full hour. Let it start Soft and specify for its Control-Commands the following for the On Program Starting event:

Code: Select all

MODSTREAM_WATCHER_START http://lounge-office.rautemusik.fm|1800|true|true|MySongTitle|false|C:\Temp\test.mp3
In the On Program Stopping/Stopped event you might also stop the mod stream.
On Program Starting.jpg
Notes:
The test.mp3 denotes your Intro file.
The duration denotes your maximum duration in this case 30 min.

Another option is to use a reminder, which might also work to trigger the above control-command.
Add Reminder.jpg

polp6880
Posts: 23
Joined: 19 Apr 2020 19:04

Re: Automate external stream with variable end

Post by polp6880 » 20 Apr 2020 21:08

Thanks both for your assistance. I'm gonna try this and report back with the results.

polp6880
Posts: 23
Joined: 19 Apr 2020 19:04

Re: Automate external stream with variable end

Post by polp6880 » 21 Apr 2020 16:39

Hi,

I managed to set this up as a program thanks to both of your suggestions but I noticed that in 2 instances out of 4, the internet stream started playing automatically while the initial 5-minute track was still not fully completed. In the first instance, the stream started around 40 seconds in the initial track in the second instance, it started around the 4th minute. When this happens, as soon as the 5-minute track ends, the 3rd item in the program (3rd line in the script that loads a random item from media library), starts playing while the internet stream is still actively playing and showing that it will end in around 1 hour. In both cases, the internet stream was a different URL so this doesn't seem to be bound to just 1 particular internet stream.

Apart from these situations, in the other 2 instances tested this worked as expected, ie the track plays in full, on end, the internet stream starts playing and when done, I manually fade to the next track in line.

Could you please let me know what the issue might be?

Thanks!

User avatar
radio42
Site Admin
Posts: 6373
Joined: 05 Apr 2012 16:26

Re: Automate external stream with variable end

Post by radio42 » 21 Apr 2020 17:47

Please describe in detail how you did set things up. As if all is setup in one script this doesn't sound possible.
And of possible share your program settings as well as script...

polp6880
Posts: 23
Joined: 19 Apr 2020 19:04

Re: Automate external stream with variable end

Post by polp6880 » 22 Apr 2020 14:29

This happened again this morning. I have a screen recording to show exactly this behaviour here: https://share.getcloudapp.com/OAubrrYG

In the screen recording, you'll see that there is a particular program playing and at 08:55, the program having the 5 minute track, internet stream and the extra track starts playing automatically.

The 5 minute track is playing fine but around 2:05 in the screen recording, you can see that the internet stream track sort of refreshes and it starts playing at the same time. What I do then, in this case, is pause the internet stream, turn off Autoplay (as if I don't do this, the C track starts playing) and turn the internet stream back on manually.

These are the program settings I have: https://share.getcloudapp.com/JrubWDJY

And this is the script: https://share.getcloudapp.com/RBuvdlG2

Thanks!

User avatar
radio42
Site Admin
Posts: 6373
Joined: 05 Apr 2012 16:26

Re: Automate external stream with variable end

Post by radio42 » 22 Apr 2020 19:01

I need to look at this, as it indeed looks strange to me! Give me Moment to try to reproduce.
However, it looks like an issue with the url stream. Sill, it should not playback 2 items at once.

User avatar
radio42
Site Admin
Posts: 6373
Joined: 05 Apr 2012 16:26

Re: Automate external stream with variable end

Post by radio42 » 23 Apr 2020 08:05

There was indeed an issue in the latest version which might have resulted in a double play out of two DJ Players in case a URL stream disconnects while being cued. An v4.1.5.13-update is available.

Note however, that your internet stream seems to disconnect every so often - meaning it terminates and is either closed from the server side or because of a very short temp network issue. It looks though, as if it is possible to reconnect right after.
E.g. when this happens while the URL stream already plays back, it will be stopped and the next track will be played.

Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests