How to Build Your Own Quadruple Play Service

By Don. A. Moskaluk

May 5, 2009

Many people around the world have setup their own Wireless Mesh to extend internet to their “last mile” giving thousand of people network services.  In the past, I have written about services such as VoIP (telephone) to wireless mesh using Asterisk.  I would like to introduce IPTV network.  Now this is not YouTube, or a flash site streaming but an actual video and audio distribution system.

Setting up an IPTV network using Wireless Mesh is actually incredibly easy. In fact, almost anyone can do it and if you already have built your own wireless mesh this becomes another service that you can provide. IPTV networks are intranets; only the web browser is not only on a PC, it is also on a set-top box that gives your TV the ability to view and manage programming. You will need many servers, and the ability to make specialized set-top boxes. With the right hardware and software, it should take you less than a few weeks.

To buy or build, that is in the economics; however, nobody provides a kit to make this or if they do, it is called proprietary and it will cost a large fortune.  With a bunch of used Servers and Open Source software, existing Wireless Mesh Network and few new networking components you can make this yourself.  There are many things you can do with IPTV network:

Create an internal cable TV system for demoing products and services, training, advertising or information display;
Create a Video showcase for your clients so they can visualize opportunities;
Evaluate and simulate current IPTV network technology to test applications and ideas without a massive expense;
Convert your existing splash page and applications to IPTV versions;
Cross-train your technician and developers so they have IPTV skills;
Build a great new idea or application that would work well on IPTV;
Consolidate your current service offering systems into an IPTV environment (e.g. VoIP, A2Billing, etc.)



Server (LinuxMCE, includes Asterisk, A2Billing)
NAS (Freenas)
LAMP Server (VLC streaming)
100/1000 BT Switch
MeshAP with Multiple Ethernet connections
Sample video material, music and data files


Locustworld Mesh Network  


Internet Connection  


Home LAN “Last Mile”

An IP set-top box
FreeNAS server
A multicast-capable router or Switch
2 x home plug Adaptors
Sample video material

Open Source


LinuxMCE with Asterisk  



Locustworld WIANA

Locustworld OS

Unbuntu OS


In this article, we're going to be thrifty and frugal, using used servers, networking switches and free open source software (FOSS) where we can. We will also be adhering to open standards wherever possible. For our client use, we will use XBMC for both browser and set top box. We'll stream out our video locally using UPNP and VLC for centralized streaming.

1. The Source “Head”

I will be using terms from the cable TV providers, a cable head or “Head” will be used to capture information and distribute services. As illustrated from the diagram above you will need very little space for the servers; however, you will need is a space for demonstrating it on a TV. That could be on a desk, in reception or in a corner of the office with a couch – ok, a throw rug.

The “Head” consist of multiple servers including LinuxMCE with Asterisk, A2Billing FreeNAS, and capture devices such HD Homerun.  Capture devices with the internet are used to store video, audio, and data.  UPNP is used to stream files to either PC’s or the set top box.  UPNP is part of FreeNAS services. However if you are thinking about multiple locations you may want to investigate the RSYNC and UNISON services as a means to keep service replicated. This will give you the ability to replicate using wireless mesh to various locations.  Use the Head and create a URL for this location and each location would replicate to the Head.  This means you don’t have to push your service out.  The client gets the service. 


VideoLAN solution overview

VideoLAN Streaming Solution provides a simple solution to capture the stream and redistributes it on a specific IP address with your mesh. Streaming service as illustrated is designed for a centralized approach while UPNP can only work on a same subnet as per its service.  When required you can utilize streaming services to provide live events.

2. Media Player UPNP and SAP Streaming

The most critical decision in setting up your system is what IP media player you will be using, as all of them run different software and have different capabilities. Dedicated set top boxes connect to the TV using a standard HDMI cable or RCA sockets, and displays PAL/NTSC video at standard resolution. PC’s having DVI connections and audio outputs can also be good devices to connect to TV’s.   It’s preferable to use a system such XBMC that can work on both.



XBMC is an award winning media center application for Linux, Mac OS X, Windows and XBox. The ultimate hub for all your media, XBMC is easy to use, looks slick, and has a large helpful community.


Media Management

XBMC supports viewing and playing a vast library of audio, video and image formats. XBMC has a sophisticated library management system that allows you to organize all your media to give you quick and immediate access.


Fluid Interface

XBMC provides a user friendly interface that's intuitive, very flexible, and easy to use. The interface is completely customizable through user-created or downloadable skins.


Plug-ins and Extensibility

XBMC has a built-in Python interpreter that allows users and developers to write their own scripts and plug-ins that run inside XBMC using it's own widgets and controls. It also has a built-in web server that allows it to be controlled remotely.



XBMC's audio player supports much visualization including ProjectM and Goom. In addition, it allows easy development of visualizations using a simple API.

There are many OEM vendors of IP set-top boxes to choose from all across the world. Some examples include Microsoft Xbox 360, Apple TV, Dlink media center, Netgear extenders, Complete Media Systems, Amino, Kreatel (now Motorola), and Netgem just to name a few.   The devices have mostly proprietary interfaces and many do not provide all services such as SAP streaming; however, most work well using UPNP standard.

Using XMBC software provides the ability to utilize a standard approach to presenting this new service.  Being Open Source, you can reskin the software to present your own solution.  For now, download the latest stable solution and try it out on an existing PC, or make your own embedded solution.  You can even use it on Apple TV or old Xbox.  An alternative to XMBC is to use LinuxMCE client or MythTV frontend. 

3. Setting up the network

IPTV runs over an IP network, which means it will work over your existing home or office Ethernet network. You'll probably already have a router or switch that your desktop PCs are plugged into, although it will be best to create a new, separate network for your TV as the traffic load is much higher than a normal data network designed for internet and/or LAN connectivity.

You can use any router or switch at all, as long as it supports multicast. Check the side of the packaging or the manufacturer's documentation to see if the product you choose supports multicast natively (IGMP etc). Normal 100Mbit Ethernet is fine, although use Gigabit Ethernet if at all possible.

If you're running all the screens and video from one server (FreeNAS), you can just use a simple crossover cable. Don't try and run video over a wireless connection, no matter how good the reception is. This may work fine initially, but processor-hungry compressed video is another story. Avoid watching streaming video on the mesh. XBMC has the ability to run UPNP locally but it will not transverse the MeshAP even if Multicasting switch is on in WIANA; however, you may want to mount the share drives in FreeNAS.  You will have similar performance. 

An IP set-top box is just another network client device. When it is connected to the IP network, it is assigned an IP address by DHCP just as a desktop PC would be (this can also be static). If your router doesn't act as a DHCP server, you don't have a network gateway or are experiencing problems with a crossover cable, simply download and install a free DHCP server from the internet onto your web server PC.

Your Homeplug (Ethernet over Power (EoP) power line communication) adaptors create an Ethernet network over existing electricity cabling, which avoids the need to have wiring everywhere when you can't use wireless. They generally come in pairs. The first should be plugged into an AC plug near the router, and the second should be plugged in next to the set-top box.  Both then have Ethernet sockets, which you plug into a normal cat-5 cable.

4. Streaming live broadcast video

Capturing content to play on these devices becomes a question of legality.  Copyright laws in various countries prohibit this operation.  It is very important to ensure that a Mesh provider have the rights to capture and distribute this content.

The first thing to simulate on your IPTV system is live TV that can be tuned into, and this can be done in two ways. The first is easy, the second is either painful or expensive. Live broadcast IPTV needs to be multicasted 24-7 over the IP network, as unicast it is too inefficient. We will be streaming live TV from our video server.

For each channel, we need to broadcast a 5 minute looping pre-captured video clip to a multicast IP address. For this, we can use the free VLC player. The clip itself ideally needs to be previously encoded in MPEG-4 H.264 AVC, and formatted into an MPEG-2 transport stream. However, VLC being the Swiss army knife, means we can convert open virtually any video file and encode it on the fly as we are broadcasting. Open your video file, and use the advanced options in VLC to stream the output onto the network as UDP, using a multicast address such as to a random port (such as 10201).

You can test if the stream is being correctly outputted by opening the same network stream with another copy of VLC on another computer on the network. Do this for as many channels as you require. Once they are broadcasting, the set-top box will be able to tune into the multicast stream just as VLC does.

VLC can be used to do the following applications:

·        Play back CD, DVD or audio/ video file from the network, hard disk and other storage media.

·        Recording of audio and video materials into DVD or other storage media using different file formats like WMV, AVI, MPEG-2, MP4, MOV, DivX, VOB and others.

·        Transcoding audio/ video material from one file format into another. (ex. Converting DVD VOB file from DVD to AVI file).

·        Streaming audio and video materials into a network for point-to-point application using UDP unicast transport protocol. (ex. Videoconferencing between two sites).

·        Streaming audio and video materials into a network for point-to-multipoint application using UDP multicast transport protocol. (ex. IPTV system)

·        Video-on-Demand (VOD) application across a network using the HTTP transfer protocol.

Sample IPTV System

As seen from the diagram, each signal source has a corresponding video server. To receive satellite signal, we used a DVB-S PCI card installed in a video server. For the terrestrial broadcast signal, we connected the audio/video output of a TV tuner to the A/V inputs of a video graphics PCI card installed in another video server. The same was done for the CCTV camera whose video signal was fed to the video input of a video graphics card in the third video server. All the ethernet ports of the video servers are connected to the same network where the client workstations are also connected.

5. Preparing VoD content

Making DVD quality video across your network is split into two separate parts – getting the video files into the right format using LinuxMCE, and secondly, setting them up to stream from a video server like FreeNAS.

The main choices for serving video on-demand over our IPTV network are the open-source UPNP services and SAP Streaming run on Windows, and Linux.. If your own network is set up to use Windows Media, you can happily and easily unicast and/or multicast video from a Windows Server PC running the free Windows Media Server.

FreeNAS uses Fuppes to service UPNP.  Once the media is on FreeNAS you need to publish it to the web so that XBMC and other UPNP devices can read the services.  This can be automated however; a simple cron job can handle this for you. 

6. Creating screens and menus  

Menus for the TV screen are created XBMC.  When using a set top box or PC you should have XBMC automatically loaded. The IP set-top box starts up and gains an IP address via DHCP.  Each set-top box's hardware is different; however, there should not be a different look and feel to the menu system.  Video can be displayed and scaled as any kind of image on the page, and manipulated. The set-IP will not come with any software applications pre-installed, so the very first application you need to create is an assignment of Video, Audio, Pictures to your electronic programmed guide (EPG) to navigate around your service and watch video streams.

Using XBMC for menu and screen displays means content can be dynamically generated using a server-side process just like any web page. The TV screen displays whatever you send it, meaning you can integrate any type of web-based system into your new IPTV network, such as the Asterisk VoIP PBX, the Jabber IM server, multiplayer game servers, your own web application or an external XML API. Please se XBMC add-on, plug-ins and scripts for details.

XBMC is easy to install and setup, and its many beautiful custom user interfaces offers simple and very intuitive navigation which is very convenient and flexible, adding to a great price verses performance ratio when installed on cheap hardware to this best in class software. With this and experience it surpasses all retail media center systems.

XBMC supports a very complete spectrum of audio and video multimedia file formats and codec’s right out-of-the-box, and includes features such as playlist playback, audio visualizations, picture viewing, slideshows, and weather forecast functions, RSS feed scroller on your home screen, together with a ever expanding array of community driven third-party add-ons and plug-ins.

XBMC can play most audio and video file formats as well as display images at resolutions up to 1080p FullHD and over with no software limitation from virtually any source, including your local hard drive, CD/DVDs, USB flash drives, the Internet, and network shares, up scaling any lower resolutions videos to the maximum of your displays capability. XBMC can also playback DVD-Video movies with menus from ISO/IMG-images on the fly, even when they are in a RAR or ZIP archive. For music playback, XBMC offers Replay Gain, gapless, cross fading, cue sheet, and pre-amplification playback options, as well as advanced smart playlists, and chapter support.

XBMC can download or stream Internet video and audio streams, and play Internet radio stations (such as Podcasts and SHOUTcast), and you can listen to your favorites and discover new music with free, streaming music from, among others.

XBMC of course handles all common digital picture formats with the options of panning/zooming, and slideshow with “Ken Burns Effect“. XBMC also handles CBZ and CBR comic book archive files, this feature lets you view/read, browse and zoom the pictures of comics pages without uncompressing them first.

XBMC has a database driven video and music library, which help, organize and filter all of your media straight out-of-the-box. The video library allows you to easily browse your video content by things like; genre, title, year, actors, and directors, as well as carry our extensive searches on casts and related information. Similarly, XBMC’s music library allows the organization of your music collection by information stored in your music file ID meta tags, like title, artist, album, genre and popularity, as well as having access to powerful search and Smart Playlists features, helping you find exactly what you want in a fast and simple way.

XBMC takes full advantage of broadband Internet connections if available; Artwork is automatically fetched for posters; artwork, fan art, synopsis and reviews on movies; plot, cast and episode information for TV shows and also album covers and artist information for music.

XBMC features a Python Scripts Engine and WindowXML application framework (a XML-based widget toolkit for creating a GUI for widgets) in a similar fashion to Apple Mac OS X Dashboard Widgets and Microsoft Gadgets in Windows Sidebar. Python widget scripts allow normal users to add-on ‘extensions’ with new functionality to XBMC themselves, using the easy to learn Python scripting language, without the need for knowledge of any complex programming languages or the inner workings of XBMC. Current plug-ins and scripts include a multitude of added functions like Internet TV and radio streams, podcasts, movie-trailer browsers, and cinema guides, e-mail clients, instant messaging, train-timetables, peer-to-peer file-sharing downloader’s, IRC, also casual games (sometimes also referred to as mini-games or party-games) such as Tetris, Snake, Space Invaders, Sudoku, and much more.

XBMC is noted and highly regarded as having a very flexible GUI toolkit and robust framework for its GUI,. Users can create their own skins, or choose one of the many already available skins. XBMC uses a standard XML base, making theme-skinning and personal customization very accessible to everyone. Users themselves can create their own skin (or simply modify an existing skin) and share it with others via public websites dedicated for XBMC skins trading. Colors, controls, navigation, positioning of elements, animation, even adding additional functionality can be achieved with a skin. “Project Mayhem” is the official skin from Team-XBMC; which is now in its third version, commonly know as “PM3″. Many third-party skins exist while many are of original and unique designs, a few skins are almost exact replicas of other multimedia software, with skins clones of Apple TV and Front Row, Microsoft Windows Media Center Edition (MCE), Media Portal, Meedio/MeediOS, HDeeTV, Kaleidescape, Xbox 360, PlayStation 3, and others. Each skin provides a totally different and unique user experience, all showing just how flexible XBMC’s skinning engine really is.

7. Quadruple Play Service

A quadruple play service combines the service of broadband Internet access, television and telephone with wireless service provisions. This marketing term does leave some complication for Access control and billing.  For example, WIANA is used to control User for Wireless Mesh and has a community base billing system; A2Billing is used to provide access and billing for Asterisk, FreeNAS has group access control using Samba but does not have a billing system.  At this time there is not a known Open Source billing system that can control a quadruple play.  The only one that has a very close solution is A2Billings; however, you may also need a Radius server.

8. Dynamic Name Service (DNS) & Quality of Service (QoS)

When you are building your servers you want to ensure that anyone from the wireless mesh can have access to your servers.  The assumption is that the Servers would have there own URL and can be accessed by the outside world; however, you can also keep it as intranet using “hosts” file in /etc/hosts and assign a name in each MeshAP.  This would give you access only in the Wireless Mesh.  Since you are distributing video and audio from FreeNAS to other FreeNAS servers the QoS is not required; however if you are making a centralized approach to viewing you may want to ensure that QoS goes directly to the server.  Adding a second Ethernet card to FreeNAS and having MeshAP hook directly to this device achieve the QoS. 

9. Show ME

Once you have your network set up, it’s up to you to create menus and screens, and adding video content onto your video server that can be played back through the TV. The production procedure is the same as it is for a XBMC, only with TV-specific functionality and usability issues. Over a few days or weeks, you suddenly have an entire TV network to yourself that you can do anything – well almost anything.



Send mail to with questions or comments about this web site.
Copyright ©   2012  Moskaluk Inc.
Last modified: May 08, 2009