shane-mason / FieldStation42

Broadcast TV simulator
Mozilla Public License 2.0
74 stars 6 forks source link

weekly_schedule error? #11

Open Devineavenger opened 2 days ago

Devineavenger commented 2 days ago

Hello, thank you for the work. I've wanted something like this, but never had the time to look into it.

I'm trying to build a small test channel. It only has 40-20 min episode in one "test" folder and I've added it to the: "clip_shows" : ["test"] but I keep getting this error message when trying to build channel:

DEBUG:kids:Making schedule for monday DEBUG:kids:Making Slot: 6 DEBUG:kids:Making Slot: 7 DEBUG:kids:Slot tag: test Traceback (most recent call last): File "/home/user/tv-station/station_42.py", line 259, in schedule = station.make_weekly_schedule() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/tv-station/station_42.py", line 202, in make_weekly_schedule schedule[day_name] = self.make_daily_schedule(day_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/tv-station/station_42.py", line 228, in make_daily_schedule schedule[slot] = self.make_clip_hour(tag) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/tv-station/station_42.py", line 143, in make_clip_hour candidate=self.catalog.find_candidate(tag, remaining_time) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/tv-station/fs42/catalog.py", line 142, in find_candidate raise(Exception(err)) Exception: Could not find candidate video for tag=test under 860.7400000000005 in len - maybe add some shorter content?

I've read the wiki. What am I missing?

Thank you!

shane-mason commented 2 days ago

I can help here - happy to. It found enough shows to get it up to over 45 minutes, but couldn't find anything short enough to fill that last 14 minutes. If the content is 20 to 40 minutes, it doesn't have to be a clip show - 20 minutes is interpreted as the main content for a 30 minute block (so it will put two of them together to make an hour) and 40 minutes as the main content for a 60 minute block. Try it as a regular show, or follow the suggestion in the error message to add some shorter content

You will also need some content in your commercial and bump folders - it will try to hit the 60 minute mark pretty closely, so you want a combination of lengths for 15 to 90 seconds in your commercials (can be all 15-30 seconds) and then some in your bumps running from 5 to 90 seconds - this will let if find content to get the padding right.

Let me know if this works.

Devineavenger commented 1 day ago

Thank you for the answer, but I have another question then. Let's say I want it to play 4h or 8h a random number of tv shows but with no commercials or bumps (something like a marathon?) Can I make that happen only with json configuration? (That's what I was trying to achieve initially )

shane-mason commented 22 hours ago

Not easily - it will try to fill the space with commercials and bumps to even out at half hour and hour marks - just like a real broadcast TV station would. One way to do it would be to have all content that is exactly an hour or half hour, then there is no space to be filled. This seems like a simple feature, on the surface, but would become more complex because I built the scheduler around the concept of 'day parting' - and it looks at the world through one-hour increments. In your scenario, when a show ended and a new show begins would be completely dependent on the length of each content video. Can you tell me more about the use case? Marathons have commercials - even HBO generally has things start on the hour or half hour with bump content in between.

Devineavenger commented 21 hours ago

My kids are small, like really small, and there are no commercials I would like to expose them to. They have a 60 to 90 min daily allowance for tv. I don't mind the rest of the day, as I will be the only one who will look/listen to it while I work. But for those let's say 2h, it would be nice to run cartoons without commercials. I've actually got a lot of commercials that I want to integrate on the channel, but more than half of them are 80's/90's 14+ commercials, not for 5yo... And even if I would split the content into 2 channels, 1 for me and a 2nd for them, i still wouldn't want commercials for that channel.

shane-mason commented 17 hours ago

I would have to think about this for a bit - the best way to implement. Right now, you could do the following: replace the commercials with public service kinds of things. Like 'The more you know..." kind of clips that kids like. That keeps the 'commercials' out. I can pretty easily make it so you can specify no commercials or bumps, but what do we do with the remaining time in the slot? At some point, its just a random video playlist - which feels outside the scope of this particular project. We can do marathons right now, just by only having one show in your folder. We do need to be able to support 'no commercials' in a block, but we need time fillers. Think of how PBS does it: they have shows that range from 50 to 59 minutes or so and then fill the last part with previews and donation requests. HBO and movie channels are the same way.

Devineavenger commented 4 hours ago

Could work. Last question. Can you make it so that you can specify 2-3 time slots that act as 1? Then you wouldn't need to fill up everything only the last remains of that 3h timeslot... that way, you can choose on which "hour" you like the filler (it's sort of a compromise to the whole "no commercials" thing) (food for thought)