Le 2 avril 2012 09:40,  <[email protected]> a écrit :
> Good day everyone

  Hi Alexander!

> Apologies in advance for my maybe dumb question, but I am still a LS newbie.

No need to apologize, welcome aboard :-)

> I’d like to insert an overlay ad (on top of the stream) to a source, not at
> one time of the hour, but on all nn minutes.
>
>
>
> That’s probably possible, but I haven’t yet found a solution. Can anyone
> help?
>
>
>
> Right now, the code below works fine, but, as as said, only once an hour (at
> :35). I have tried to just replace the {35m0s} with a integer of, say, 60
> (without the {} brackets), but of course liquidsoap didn’t like me for that.


Hmm.. I'm not sure exactly what is your problem? Are you trying to
change the default time? Anyway, I think I can still explain some
things :-)

The {} syntax first.. In fact, a switch does not only accept temporal
stuff to the condition, but any function of the type () -> boolean,
that is a function that is called with no arguments and returns a
boolean (indicating if the source should be played..).

A simple function can be:
def f() =
  true
end
Which always returns true.. In case of "simple" functions for that,
David has introduced the {} syntax. Basically, f = { true } defines
the same function has above..

Now temporal predicates.. Those animals were introduced in order to
make it easier to use temporal conditions.. Essentially, 35m00s is a
boolean value (true or false), that is only true at the specificed
time..

Therefore, { 35m00s } in fact defines a _function_ that takes no
arguments and returns true only at the given time.

We also have time intervals that you can use for predicates. For
instance, 35m00s-42m00s, which will be true between the 35th and the
42nd minutes of any hour. Maybe that is something like that that you
may need.

Finally, you should also have in mind that switch operators, like
fallback and all "track-based" operators all try to be nice to
tracks.. This mean two things. Imagine that you use: switch( [ {
35m00s }, s ) ] )

1) If at 35m00s, the source was not playing and s does not have a
track ready then the source will not be played
2) If at 35m00s  the source was not playing and s has a track ready,
then the source will be played during all that track. no matter what
the predicate returns during that track.
3) When the track ends, if the predicate is still true and another
track is ready then it will continue to the next track.

This behaviour can be changed by setting:
switch(track_sensitive=false, ..., ). In this case, 1) is still true
but not 2) and 3): if the souce is playing, it will stop immediatly
when the predicates become false.

This remark is important if you wish to use switch or fallback
operators with source whose data comes from a stream.. For instance,
input.http or input.harbor may not have track markers, therefore will
play forever if you do not use track_sensitive=false. Likewise,
sources resulting from a crossfade/smart_crossfade do not have track
marks (after all, the purpose of a crossfade is precisely to merge
tracks :-).

Not sure it answers exactly to your problem but I hope that it helps!
Romain

> --
>
> set("log.file",false)
>
> set("log.stdout",true)
>
> set("log.level",4)
>
>
>
> # A playlist source with a smart crossfade
>
> s1=playlist(reload=80000, "Y:\content\m3u\jazz_smooth_sax.m3u")
>
> s2=playlist(reload=80000, "Y:\content\m3u\jazz_smooth_guitar.m3u")
>
> s3=playlist(reload=80000, "Y:\content\m3u\jazz_smooth_keypianoorgan.m3u")
>
> s4=playlist(reload=80000, "Y:\content\m3u\jazz_smooth_other.m3u")
>
> s5=playlist(reload=80000, "Y:\content\m3u\jazz_smooth_new.m3u")
>
> s6=playlist(reload=80000, "Y:\content\m3u\jazz_smooth_powerplay.m3u")
>
> overlay=playlist("Y:\98_various_channels\IDs\OL")
>
>
>
> s = rotate (weights=[1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1], [s3, s4, s1,
> s2, s3, s5, s4, s2, s1, s3, s5, s4, s2, s6])
>
>
>
> s = add([s, switch([({35m0s},overlay)])])
>
>
>
> s = smart_crossfade(fade_out=0.8,fade_in=0.0,s)
>
>
>
> s = nrj(s)
>
>
>
> monosource = mean (s)
>
>
>
> # An icecast output, in mp3
>
> output.icecast(%mp3(mono=true,
> bitrate=64),fallible=true,mount="jazz_smooth",host="live-four
> ",port=8080,password="as34lasdf",monosource)
>
>
>
> --
>
>
>
> Any help is greatly appreciated.
>
>
>
> Alex
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Savonet-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/savonet-users
>

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to