A Fake TV Station for the Home

FakeTV, complete with test pattern when ‘off-air’

So, if you’re reading this you have either heard me talk about FakeTV before, or somehow you found this and this interests you. To fill in on the background, what I refer to as my fake TV station, or FakeTV for short, is a conflagration of devices which simulates many of the aspects of a broadcast television station. There are a few important differences, of course, but the base idea is having an input on my television that I can tune to as if it were a broadcast station and just watch what’s on without having to navigate menus or be relegated to binge watching because it’s easier than choosing something else to watch.

The Concept

Source: imgur

The original idea that lead me on the search to set this thing up came from long ago, when I played around with XBMC. There was a plugin for XBMC (and still is for Kodi, the successor the XBMC) called PseudoTV. What PsuedoTV does is take your video library, divide it up into “channels” based on content type and creates a schedule. Any time you tune to a channel, it starts the content at whatever point it would have been at, had it been broadcast. Unfortunately, there was no option to create a custom channel, and many channels just ended up as one show on perpetual marathon.

Some people have asked me why I would want to recreate the broadcast TV experience when we live in an age of on-demand programming. For me, binge watching is not my preferred method of watching comedy shows. Additionally, I commonly want something on in the background that I can either ignore or watch, depending on my mood. Anything I choose to watch, I feel I’ve committed to paying attention to. While if it’s just ‘on’ I don’t feel as committed. Also, navigating menus every 20–45 minutes is time consuming and takes me away from any task I might have engaged myself in. Sure this method of viewing isn’t for everybody, but I find I prefer it for reruns, instead of binge-watching things I’ve already seen. And finally, actual broadcast TV doesn’t have any single channel full of content I or my wife actually want to watch.

Finding the Right Thing

One very important feature was that whatever operated as my fake TV station had to be on a Raspberry Pi, because I didn’t want any more loud, dusty computers in my living room. When I first went to Kodi to see if PseudoTV had seen any improvement, I quickly realized it would not work. The Pi 2 (I started this project before the Pi 3 was released) could not run Kodi and PseudoTV without performance issues. Additionally, it didn’t look like PseudoTV had been updated with any features I needed.

So, I started googling around, and I found this thread which appeared to ask about doing exactly what I was looking to do. One of the replies was from a guy who wrote a script to do pretty much exactly what I wanted out of FakeTV, and I was off.

Setting up FakeTV

One of my Raspberry Pi units tucked away with the modem and backup power system

The setup is a little convoluted. Attached to the back of the TV is a raspberry pi 2 running RasPlex, the raspberry pi optimized Plex client. Located down near my router, switch and modem is another pi which runs my ZNC connection to IRC. I install the TBN-Plex script to this device. Finally, my desktop hosts the Plex server itself. All devices are connected via hard line to the network, because streaming HD video over WiFi will only result in a Bad Time.

Installation of the script is pretty straightforward, but you have to install all of the dependencies yourself. This is very much a DIY project, and not out of the box one bit. After all, it is an open source script running on Linux.

How to Fake Broadcast

What it looks like to create a new block of programming

After running into some issues, I start reporting bugs to the github and as the developer fixes a number of them. Once I get past the initial issues, it starts working pretty well. I also make a few feature requests, some of which also receive some attention.

The way the script works is that it allows you to create a programming block. First, you can add specific movies to the block. I never use this feature because it goes against what I’m looking for.

Second, you can add a TV show to the block. This is the option that gets most of my attention. Whenever a TV show comes up in a block, the script looks to its database, determines the next episode based on the last that it played, and fires it up. The important bit here is its database. The script does not directly read and write to the Plex database. What it does is scrape the Plex database and build its own, to avoid corrupting the Plex database. However, this does mean that the script database needs to be updated after any changes to the Plex database.

The final option for block programming is to add a random item, based on genre. Selecting this option then allows a choice between TV or movie, and then a genre prompt. I use the random movie feature to close out programming every night. Since the movie lengths aren’t consistent, random movies in the programming day have the potential to throw off the scheduling. Also, if I fall asleep on the couch, the random unexpected movie is more likely to wake me up than having nothing playing at all.

The scheduling is setup through crontab, which excutes scripts to start each block

I chose to set my blocks up in 3-hour chunks. The reason for this is because, even though I’m using this to schedule broadcasts, the script itself doesn’t actually schedule anything. It just plays a series of shows and movies in the order instructed when that block is active. To put together a schedule, I need to use crontab. I chose 3 hour blocks because subtle changes in episode lengths wouldn’t push back the whole day’s schedule. If a 45-minute show has a double-length premiere or special episode, it will push back the start time of the next shows, but only until the next block is scheduled to start. Then it switches to the new block and one or two shows on the end of the previous block just get preempted. I created shell scripts to run a few commands, including one to restart the block before playing it. If a block ends in the middle, it will pick up with the next unplayed show in the block, so restarting it ensures the schedule is adhered to.

Finally, the schedule itself. I wanted something that actually felt like a broadcast TV schedule on one of those non-affiliated stations that primarily runs syndicated TV. Something I noticed when researching at some of these stations’ schedules is that they run a lot more infomercials today than they used to, probably because of the split into up to 3 stations on broadcast TV. But after a few attempts that didn’t quite feel right, I’ve settled on a schedule that feels good. Weekends share the same schedule up until 4pm. Weekday programming doesn’t start until 4pm, and the block until 7pm is the same all week. After 7pm, we get into more varied schedules for prime time, then settle back into a shared weeknight schedule for late night, and a slightly different, longer schedule that runs later for weekends.

Pitfalls and Possibilities

Once all this was set up, I just leave it alone and it does it’s thing right? Well, sort of. As it’s a work in progress, programmed by one guy, there are a number of kinks and bugs being worked out. I try and report bugs as I find them, which helps smooth things out. I’ve also made a few feature requests. I really wanted a feature to replace one show with another within a block, at the end of a show’s run instead of starting the show over again. The programmer was initially not interested in creating that feature, but as of today decided to start work on it.

He has also built a feature I’m not currently using for reasons I’ll get into below, but am very excited about. He created a commercial mode, which allows commercials to be played in between shows. The commercials are just a home movies-defined library on the plex server. I indicate to the script that this library contain commercials, and they are treated as such. Additionally, there’s a command that will interrupt whatever is playing, play 2 commercials, then resume playback of the show. I intend on using that feature during block changeovers. The reason I’m not currently using it is due to issues with special characters in the file names and how the script parses those. Some errors occur with certain characters, so until I have time to sanitize the file names, I have the feature turned off. Also I want to trim out some of the longer videos that were listed in the as commercials in the packs I downloaded, but actually run for several minutes. Eventually, I’ll make good use of the commercials feature, as it enriches the experience of running a fake TV station.

An old AOL commercial plays in between shows


So that’s FakeTV in a nutshell. There are definitely still some kinks to work out, and some features I’d like to have that don’t quite exist yet (and maybe never will). In the future, I’d like to move the Plex server to a NAS. I’ve heard some people express interest in being able to tune in from multiple devices. I believe there is a method making that happen. Either the RasPlex would need to be somehow configured send video output to RTMP instead of over HDMI, or the HDMI output run through a device that is then streaming to RTMP. From there, any client (like VLC) that supports streaming video over RTMP that’s on the network could pick up the broadcast. Those are both technical options beyond my expertise, and beyond my needs, as we only have the one television, but if you’d like to explore them be my guest.

In the end, this has been a great addition to my media consumption options. I hope if it interest you, that you’ll give it a try and maybe contribute some bug reporting to the project. After all, the more people testing the script, the more bugs can be found, reproduced and eliminated.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.