IPTV Server - Build Your own

Mick

Administrator
Staff member
Administrator
Joined
Jan 19, 1999
Messages
32,154
Reaction score
9,223
Build your own IPTV Server

I guess it might be asked sooner or later but apparently it is not difficult to build your own IPTV Server.

I have found this information on how to do it, hope it is useful ;)

----------------------------------

You don't need massive and expensive servers, specialized set-top boxes or overly large development teams working with complex software. With the right DVB hardware and software, it should take you less than a few hours.

Why to build your own IPTV
There are kind of people who might have interest in building IPTV.

  • Create an internal TV system for training, advertising or information display;
  • Create an IPTV showcase for your clients so they can visualise opportunities;
  • Evaluate current IPTV technology without massive expense;
  • Convert your existing client websites and applications to IPTV versions;
  • Cross-train your web developers so they have IPTV skills;
  • Build a great new idea or application that would work well on IPTV;
  • Integrate your current web-based systems into an IPTV environment (e.g. VoIP)



What you’ll need

  • A TV
  • An IP set-top box
  • A multicast-capable router
  • A web server
  • A video server
  • 2 x PLC Adaptors
  • Sample video material


In this guide, we're going to use free open source software (FOSS) where we can. We'll also be adhering to open standards wherever possible. Our HTML screens and menus will be housed on an Apache web server running PHP, Perl, Python & MySQL, and our video will be encoded in MPEG-4 H.264 AVC, packaged in a simple MPEG-2 transport stream. We'll stream out our video with VLC and Helix Server.

1. Finding a new home for the kit
Luckily, your brand new shiny IPTV system won't need much space at all. The 2 PCs (web server and video server) can be hidden away under a desk, kept in a server room or tucked away under the stairs somewhere. Using PLC adaptors means you don't need cabling dangling around. What 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.

2. Choosing the right set-top box
The most critical decision in setting up your system is what IP set-top box you will be using, as all of them run different software and have different capabilities. All of them connect to the TV using a standard scart cable or RCA sockets, and display PAL/NTSC video at standard resolution. It’s preferable if they have a web-based control panel, but many have proprietary configuration screens or use simple telnet.

The most popular choice of software is an embedded web browser, which for all intents and purposes does the same thing as a PC web browser like IE, Firefox, Opera or Safari. The developer interface tends to be a markup language, usually HTML/Javascript. The main embedded client software programs in use on IP set-top boxes today are Fresco/Galio (from Ant Plc), Opera, Escape/Evo (from Espial) and Myrio (based on Espial). You can think of them of little web browser units.

In this guide, we will be using the CMS 1080 (from Complete Media Systems), running Ant Galio 2.0. The box itself supports video delivered in H.264 AVC or Windows Media. We will be using the former.

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.

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 does not 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 PLC (powerline 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, and cost £100-200 from the high street, your ISP or online retailers. 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 normal cat5 cable into.

4. IPTV Streaming live broadcast video
The first thing to simulate on your IPTV system is live TV ,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 is too inefficient. We will be IPTV 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, or the industry standard WinSend, created by Pixstream. 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.

The more advanced way to provide live broadcast TV (such as Freeview) over an IP network is to convert MPEG-2 video received from a DVB receiver (a TV tuner card, for example those made by TBS) into multicast format, which is known as IP encapsulation. Something I have to mention is that TBS 6984 quad tuner card is incredible amazing for IPTV providers. It allows you receive four different transponders at the same time.

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, and secondly, setting them up to stream from a video server. The bad news is that there isn'ta free or open source VoD server that you can use to exactly simulate what would happen in a commercial service.

Your video material will need to be pre-encoded in the same way the live multicast video is. Software encoders from vendors like Elecard, MainConcept Cyberlink and Nero will easily compress video from most formats (MPG, AVI, MOV etc) into MPEG 4 H.264 AVC, but they will additionally need to be encapsulated in an MPEG-2 transport stream for delivery over the network. The free open-source Media Coder program produces excellent results.

The main choices for serving video on-demand over our IPTV network are the open-source Helix Server and Darwin Streaming Server, both of which come in Windows flavour, but can also run on Linux. We also have a trial of the Elecard RTSP server that can also be run on either OS. 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.

Once the video files have been pre-encoded, they need to be placed in the directory on the video server that has been allocated as the storage folder, as well as mirrored in the Apache web directory allocated on the web server. Almost all the RTSP servers have a web-based configuration panel and will need to index/identify each file for streaming. Once these are in place, test the RTSP capacity of the server by opening a network stream to them in VLC, and once any problems are corrected, your IP set-top box will play them using its in-built API.

6. Creating screens and menus
Menus for the TV screen are created in HTML, CSS and Javascript, just as normal web pages are, using the same standard tools (Dreamweaver, Photoshop etc). The software on the device is an ordinary web browser like IE, Firefox, Opera or Safari, and overlays the web pages you create on the screen through the scart cable (OSD). Most have full support for open standards and current technologies such as RSS and AJAX. Some also include the Macromedia Flash 6 player. It’s a case of write, and then refresh the browser screen, just like normal web development.

Each set-top box’s hardware is different, so there is a different Javascript API for each device model that must be obtained from the manufacturer. Video can be displayed and scaled as any kind of image on the page, and manipulated by normal Javascript functions. The set-IP will not come with any software applications pre-installed (or even commands on the remote to go back or refresh the screen), so the very first application you need to create is an electronic programmed guide (EPG) to navigate around your service and watch video streams.

Using HTML 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.

7. Showtime!
Once you have your network set up, its up to you to get creating menus and screens, and adding video content onto your video server that can be played back through the TV. The production procedure is exactly the same as it is for a website, 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 to, just as when you have your own website that you can do anything with.
 
just what i'm looking for, is there any tutorials instructions on building from scratch, thanks nice one Mick.
 
has anyone tried this from a dm800 openpli, just a thought. or maybe through VLC.
 
would think the 800 would struggle

but a good topic
 
would think the 800 would struggle

but a good topic

i was thinking of jsc sub between mates, if it could work like CS, Ive got a sub and works ok on dm800 no need for these expensive iptv boxes when you can turn your own e2 image into both, i thought maybe VLC or xbmc or even plex can act as a server. Any thoughts on the idea.
 
Are there other hardware recommendations besides CMS 1080 (from Complete Media Systems), running Ant Galio 2.0?
 
i was thinking of jsc sub between mates, if it could work like CS, Ive got a sub and works ok on dm800 no need for these expensive iptv boxes when you can turn your own e2 image into both, i thought maybe VLC or xbmc or even plex can act as a server. Any thoughts on the idea.

Seen someone selling iptv for sly uk like cs already

Sent from my GT-I9300 using Tapatalk 2
 
@ cocotcocot

Are there other hardware recommendations besides CMS 1080 (from Complete Media Systems), running Ant Galio 2.0?

Have a look HERE:

Code:
You don't have permission to view the code content. Log in or register now.
 
Last edited by a moderator:
Nice info, finally getting to the need of the DIY (for this year) at home.. Need a new challenge ;)
 
OK well this is how you want iptv to work.

for the basis of this lets say you want to stream some satelite feeds for instance 28.2

you need a pc, nothing particularly fast but you need a linux compatible satelite card (the tbs ones are great)

you then need comething to read the sat , various different software for this, but i myself am using TVheadend at the moment. but you could use mumudvb etc etc (both support connection to a cs server)

this will list your services and give you a full quality mpeg stream.

from here you will need to transocde this down to a reasonable size for streaming over the internet. most residential bband setups wont really be able to handle this but regardless you will need it transcoding down , again theres various software to do this, red5 is free opensource and adobe media server is another one.


from here it will depend on how you deliver the system to the client

but if you plan on say using a mag250 box then you need to setup mags middleware software (stalker middleware) this will act as your portal and the mag box connects to it and this software is what actually lists your streams as channels on the menu of the box, this is very important, and also a tw@t to setup but it does work and this is what is being used when you see these boxes being used.


so basically


satelite feed (or any other feed) --> headend server --> transcode server --> middleware server --> client box.

in a sort of production enviroment you would be looking at

headend server doesnt need to be massivley powerful
transcode server will need to be very beefy, where talking possibly 1 to 2 channels per core so sys specs need to be very good
middleware server needs to be fairly beefy but depends on the amount of clients you have, the software is capable of handling 5k clients

i am playing with this myself at the moment, have got it working (all on one machine for the purposes of testing / playing , but need more time / patience to properly play around with it.

1 thing i will say , setups like these even for a few channels will certainly take it out of the small time setup domain, your talking dishes on the sides of datacenters in foreign countrys to set this up, although you could "buy" streams and just place them on your middleware server and feed them to client boxes.


obviously there is a hell of lot more to it than just this much more than im prepared to go into detail on here (time mainly) but theres very little info out there that is detailed on setting anything up like this ive had to experiment / search / beg / borrow and steal for a while.........................

most information is very vague and just doesnt apply to what you basically want to do which is setup your own proper iptv system.


hope this helps


for the purposes of streaming full 28.2 you would need say 500 channels, divided by 16 (the amount of channels on a transponder that one tuner can descramble so say 32 tuners or 8 quad tuner cards (at £200 a pop) and then think of the upload you would need, not to mention the transcode server needed, most of these systems will be used to stream a select few channels such as sports, i cant see anyone doing full 28.2 but who knows
 
Last edited:
OK well this is how you want iptv to work.

for the basis of this lets say you want to stream some satelite feeds for instance 28.2

you need a pc, nothing particularly fast but you need a linux compatible satelite card (the tbs ones are great)

you then need comething to read the sat , various different software for this, but i myself am using TVheadend at the moment. but you could use mumudvb etc etc (both support connection to a cs server)

this will list your services and give you a full quality mpeg stream.

from here you will need to transocde this down to a reasonable size for streaming over the internet. most residential bband setups wont really be able to handle this but regardless you will need it transcoding down , again theres various software to do this, red5 is free opensource and adobe media server is another one.


from here it will depend on how you deliver the system to the client

but if you plan on say using a mag250 box then you need to setup mags middleware software (stalker middleware) this will act as your portal and the mag box connects to it and this software is what actually lists your streams as channels on the menu of the box, this is very important, and also a tw@t to setup but it does work and this is what is being used when you see these boxes being used.


so basically


satelite feed (or any other feed) --> headend server --> transcode server --> middleware server --> client box.

in a sort of production enviroment you would be looking at

headend server doesnt need to be massivley powerful
transcode server will need to be very beefy, where talking possibly 1 to 2 channels per core so sys specs need to be very good
middleware server needs to be fairly beefy but depends on the amount of clients you have, the software is capable of handling 5k clients

i am playing with this myself at the moment, have got it working (all on one machine for the purposes of testing / playing , but need more time / patience to properly play around with it.

1 thing i will say , setups like these even for a few channels will certainly take it out of the small time setup domain, your talking dishes on the sides of datacenters in foreign countrys to set this up, although you could "buy" streams and just place them on your middleware server and feed them to client boxes.


obviously there is a hell of lot more to it than just this much more than im prepared to go into detail on here (time mainly) but theres very little info out there that is detailed on setting anything up like this ive had to experiment / search / beg / borrow and steal for a while.........................

most information is very vague and just doesnt apply to what you basically want to do which is setup your own proper iptv system.


hope this helps


for the purposes of streaming full 28.2 you would need say 500 channels, divided by 16 (the amount of channels on a transponder that one tuner can descramble so say 32 tuners or 8 quad tuner cards (at £200 a pop) and then think of the upload you would need, not to mention the transcode server needed, most of these systems will be used to stream a select few channels such as sports, i cant see anyone doing full 28.2 but who knows

Very nice tutorial :)

Could you not use the cloud once all the transcoding / server side work is done ?

Kinda like a relay taking the feed and magnifying it via the cloud, I actually have no idea lol, but it fascinates me and would love to learn more about it

Regards
Mick



Sent on the go!
 
course you could, im no expert myself, but im a cantankerous tinkerer lol.

Basically you need a machine be it remote or local that is capable of processing the full quality stream down to a more reasonable size (bitrate/quality) for the purposes of uploading over the net and delivery to the clients boxes.

however the problem you have with doing anything like that remotley is, you would need to transmit the full quality stream to the remote transcode server, so this kind of counts it out already.


they dont all have to be on different machines, you could just have a nice fast single machine to do the lot but you wouldnt be able to do 500 channels on one system. it would have to be spread i think. but this is all hearsay at the moment mate,, my particular experiment has gotten as far as delivering 1 channel to a mag 250 in nice quality . from this point it is a case of getting to grips with all the pieces of software, getting it optimized, then move to a few channels, seperate machines, data center, etc etc.

or find a resonable supplier of streams already done ready for delivery.

but the middleare software although it looks shit (it is russian after all, no offense but they like practical not polished) its brilliant, the scope of things that can be done , such as messaging / channel changing / remote reboot / remote upgrade etc etc is brilliant, and as basically the middleware software acts as a "webpage" if you will that the box connects to, nothing is dependant on the actualy client box other than a simple connection and access rights to your portal (middleware server) so if you change something on the middleware server, i.e. channel line up, its instant across every box on the network, no manual updating or configuring........really good, but like i say im on the beginning of the journey, although i have come along way in a short time, im far from having anything setup production wise, im just getting in there early,


another thing people could look at is beenius lite (beesmart) google it, this isnt for mag boxes but supports a lot of other boxes and is on live cd so takes alot of the setup pain out of it, i havent used it, just that this is some of the stuff i have learned over the last few weeks....
 
Streams aside, what about the iptv movie side if things. Ie netflix and the likes...

How much different is the process to steaming say and live feed to stored movies ???

Cheers
Mick



Sent on the go!
 
not much really, as you would basically have adobe media server (or equivlenant) with enough storage to house whatever VoD (video on demand) you need and then set it up in middleware as VoD . obviously you could pre transocde these are set them up in AMS . but the process is the same but without the headend part and possibly not the transcode part.
 
Streams aside, what about the iptv movie side if things. Ie netflix and the likes...

How much different is the process to steaming say and live feed to stored movies ???

Cheers
Mick



Sent on the go!
With specific exceptions (Android, Roku); Netflix, LoveFilm, Now TV etc, don't currently work on Linux as there's no Silverlight plug-in available. (WINE can get Silverlight working, but is apparently a hassle.)

Eventually they'll all switch to HTML5+EME, which should see subscription IPTV services on Linux.

For LAN recasting, the Plex team seem to have removed Netflix for the time being - not sure if a switch from Sliverlight will see it return. With regards to WAN recasting, most of the IPTV subscription services have mobile apps - although NowTV's 2 active devices rule is a PITA for a lot of people.
 
very helpfull infos
but the problem is bandwidth
and also how do you prevent the streamserver from ddos attacks
also i need to ask you if there is a spiecial encoding cards like mpeg4 from the server side to the middle ware side
and if so what do you preffer
many thank
 
Back
Top