Spludlow Web Header

Case study – Media Portal


Introduction. 1

Some Digital Broadcasting Terms. 1

MUX (Multiplexer). 1

TP (Transponder). 1

DVB-?? (Digital Video Broadcasting). 1

Setting up the DVB-T Hardware. 1

Antenna. 1

Tuner Card. 1

Installing VLC (Only working with older version 2.2.8). 1

Installing and configuring Media Portal 1

Installing the SQLite Spludlow DAL. 1

Setting up the Personal Video Recorder. 1

Storage Directory. 1

Spludlow Configuration. 1

Un-Hide the DVB page in the Intranet. 1

MediaPortal EPG Data Export. 1

View the EPG and watch a programme. 1

Schedule the Media Portal EPG export. 1

Enable the Video recorder method server. 1

Set Programme to record. 1

Streaming to another Computer. 1

Fine tuning dipole aerial length. 1

Resetting Media Portal Server. 1



In this data case study we will look at Media Portal’s data to obtain the EPG (Electronic Program Guide).

Having acquired the EPG we will look at how to use this data combined with VLC to build a simple but functional Personal Video Recorder with the following functionality:

·         Scan for Channels and store to database

·         Obtain programme listings EPG (Electronic Programme Guide) and store to database (DVB-Terrestrial has 7 day listings built into the standard)

·         Display Channels and programmes to either watch live or record for later

·         Receive and display DVB programmes (Live TV)

·         Receive and transcode DVB programmes (Stream TV)

·         Schedule to Receive and save DVB programmes to a file (Record TV)

·         Playback recorded programmes

Some Digital Broadcasting Terms

Familiarise yourself with these.

MUX (Multiplexer)

Terrestrial TV the transport that carries many individual TV and radio channels (around 10 or more TV channels). It exists on a particular frequency and there are several MUXs available in any particular location (typically around 7 currently).

TP (Transponder)

Satellite TV this is exactly the same thing as a MUX they just use a different name and have loads more. In Media Portal as it can do both so it uses the term Transponder.

DVB-?? (Digital Video Broadcasting)

T=Terrestrial, S=Satellite, C=Cable. The number means the generation, hardware cannot receive future generations’ broadcasts. The first generation doesn’t have a number.

Setting up the DVB-T Hardware


If you don’t have access to a proper TV aerial and you live in a strong signal area like in a city or near a transmitter then it’s worth trying out a “half-wave coat hanger dipole” aerial.

Make the total width of the diploe 30cm to start with. You can fine tune the aerial length later when you know what frequency your channels are on.

NOTE: It is a popular misconception you need a good aerial to receive digital TV. During the transition from analogue the digital signal was being transmitted at reduced strength, when analogue was switched off they turned it up and ripped off the knob.

Ensure your aerial is polarized correctly either horizontal (what you normally expect) or vertical (on its side), check this by looking on neighbours roofs. Horizontal should be perpendicular to the transmitter, with vertical it doesn’t matter provided the cable is not in the way.

TIP: You may find moving the aerial around by small amounts can make a big difference.

Tuner Card

You will need a DVB-T (terrestrial digital TV) tuner card. Digital terrestrial TV is currently on its second generation DVB-T2 so if you want HD channels you will need a DVB-T2 card.

In this demo I used and old DVB-T (first generation) card so it will not tune to the single T2-MUX (multiplexer) that carries the HD channels, but it was fine with the other 6 T1-MUXs that carry everything else.

NOTE: In the future the T1 MUXs will be migrated to T2 so old cards will eventually become useless.

You really want at least a twin tuner card so you can have one that sits there for the EPG and the other for recording and watching.

Installing VLC (Only working with older version 2.2.8)

Ensure you install the 64 bit version.

During testing I had major problems with version 3 of VLC.

This is the only supported version of VLC to work with this demo:


NOTE: Some recording and streaming tests I performed with version 3 of VLC put Windows 10 into such a mess I couldn’t even get to task manager I had to hold down the power button.

Installing and configuring Media Portal

Media Portal is a complete open source software DVR. It has a server and client component, the server runs on the machine with the DVB cards in and the client(s) runs on the machine you watch TV on. I will only install the server component here. Obviously you could just use the Media Portal client but where’s the fun it that?

·         Download and run the Media Portal installer (V2).

·         The installer may install some prerequisites first like C++ redistributables and the DirectX SDK (Note: Don’t let any of the prerequisite installers reboot)

·         Now on the main install choose the components you require (I only want the server)

·         Run the TV Server Configuration and expand “TV Servers” and select the local host “WSYS-HOME-TV” the tuners are displayed in the main panel.

·         Disable all DVB-T tuner cards but the last one (this will grab EPG) and click OK.

·         The program will restart the Windows Service and exit, start it up again.

·         Go back through “TV Servers->WSYS-HOME-TV” and select the DVB-T tuner, the channel scan dialogue is displayed in the panel.

·         Select you county and region and click the scan button (Note: There is an “All Regions” option that will scan every MUX in the band rather than just the MUXs it has on record for your region).

·         Note: In the video TP 3 shows no signal this is because it’s a T2 MUX and I’m using an old T1 card that is unable to demodulate the newer signal.

·         Go into “TV Channels” and check it looks good (Note: A bug in Media Portal seems to occasionally give bad channel numbers 10000, see below for the workaround).

·         Go into “DVB EPG->TV EPG Grabber” and click the “All” link button to select all the channels. Click OK.

·         Re-run the configuration program and select “Manual Control”. From here you can see what it’s doing, it should be “Grabbing EPG”

·         I seems to finish after around an hour although it obtains data sooner.

That’s it set up. You can just forget about it now, the Windows Service will be running whenever the computer is switched on and it will periodically update the EPG to its own SQLite database.

Installing the SQLite Spludlow DAL

As MediaPortal uses the SQLite database we need to install the Spludlow.Data.SQLite component to access it from Spludlow.

Please see the main SQLite page for more details.

NOTE: You can install the Spludlow Framework and have the master use SQLite, in which case the SQLite components will already be present.

Setting up the Personal Video Recorder

This video shows all the steps required to run a personal video recorder using the Spludlow Framework with details in the following text.

Storage Directory

Create a directory for the recorded programmes and schedule data:


Give “SpludlowGroup” full control of this directory.

Spludlow Configuration

The video recorder requires 2 configuration items, use the Intranet Config page to add them at the “network” level:

<add key="VideoRecorder.TunerHost" value="WSYS-HOME-TV" />

<add key="VideoRecorder.Directory" value="C:\VideoRecorder"/>

Release the configuration to all hosts. Check the Status page to confirm it worked.

NOTE: VLC did not work with network paths. If you want the Intranet running on a separate host then remove VideoRecorder.Directory config at the network level and put it in for each host with a local path on the tuner host and network path on the Intranet host.

Un-Hide the DVB page in the Intranet

Edit the file and uncomment the DVB line by removing the #:

                C:\Program Files\SpludlowV1\Spludlow-Intranet\App_Data\Pages.txt

Recycle the Intranet application pool using the Intranet Status page. In the video this step is not required as the configuration release will also recycle application pools.

MediaPortal EPG Data Export

On the Intanet Call page search for “MediaPortal” and click the “Export” method, without parameters.

Click “Make Call Text” and “Run CallText”.

Check on the status page, when it’s finished you can view the logs.

NOTE: The Channels and Programmes tables are logged. Due to the size of the Programmes table I wouldn’t recommend viewing it on the Intranet Logs Page the browser will choke.

Check the 2 text tables produced, you can open them in notepad and copy and paste to a spreadsheet.



View the EPG and watch a programme

Everything should now be in place to use the Intranet DVB page. Clicking a channel name hyperlink will launch VLC and tune it in.

NOTE: You may have to fiddle with your browser settings to allow it to launch, its sending text with a MIME type of “application/bat”, rather nasty but it gets the job done.

Schedule the Media Portal EPG export

Earlier we ran the Media Portal Export manually using the Intranet Call page let’s set it up to run daily. Edit in notepad the file:


Add the following line:

# [TimeSpec]     [Address]                            [Assembly]         [Type]                                                   [Method]                [Parameters]

03:00                     WSYS-HOME-TV:Run      Spludlow             Spludlow.Video.MediaPortal      Export

Restart the scheduler thread using the Intranet status page

This will now run every day at 3 AM. You can check the schedule on the Intranet schedule page.

Enable the Video recorder method server

A simple Video Recorder class has been provided the “Run” method can be configured as a “Method Server” to take care of recording. Edit the file:


Add the following line:

#Method             [Key]                                     [Assembly]                                         [Type]                                                   [Method]            [Parameters]

Method               VideoRecorder                 Spludlow                                             Spludlow.Video.Recorder             Run

Restart the Spludlow Service using the Intranet Status page. The recorder is now up and running.

Set Programme to record

To schedule a recording click on a programme hyperlink on the DVB page then click the record button. When you do this a file is dropped to “C:\VideoRecorder\Submit” the server will pick this up and add it to “C:\VideoRecorder\Schedule.txt”, you can check the file. The DVB Intranet page will show scheduled recordings in red.

When the time is right VLC will be launched for a certain duration and the programme will be recorded in a fire and forget manor.

NOTE: You can start watching the programme before it has finished recording.

Streaming to another Computer

By changing the dropdown list and click the “Update” button on the DVB Intranet page you can stream to other computers that don’t have a DVB card. This is achieved by starting VLC on the “Tuner Host” and then the client VLC will connect to it.

Some streaming points to consider:

·         Streaming sometimes seems sketchy I can only put it down to bugs in VLC. It used to be rock solid years ago but this is no longer the case.

·         You will have to configure Windows Firewall to allow any instances of VLC on each host.

·         By using port forwarding on your Internet router you can stream to remote networks, so the MRS can watch Coronation Street on holiday.

·         You may be better off recording to file then transferring the file to remote networks and forget about streaming

Fine tuning dipole aerial length

It’s a rule of nature that any antenna design works best for a specific frequency, when you go above or below that frequency the signal will get weaker. The only design consideration for a dipole is the length so get it right.

On the DVB Intranet page, past the listings, is the “Band Usage” table. This shows frequency for each mux and what channels it is carrying.

This table provides an “Antenna CM” column, this is the calculated dipole length. You should choose a length in the mid-point for your mux frequencies.

In this screen shot example a length of 25cm should be about right. As the middle here is empty you could make 2 aerials of 30cm and 21cm depending on what you are tuning to and you should get better performance.

NOTE: If you are running UHF distribution through your house aerial cables you want to pick a frequency that is as far as possible from existing mux frequencies.

Resetting Media Portal Server

If things seem a bit messed up with media portal, like bad channel numbers, rather than trying to fix in place I like to just start again. Perform the following steps:

·         Stop the “MediaPortal 2 Server Service” (MP2-Server) in computer Manager->Services

·         Delete the directory “C:\ProgramData\Team MediaPortal\MP2-Server”

·         Start the MP2-Server service, it will re-create all the files you just removed.

·         Configure your tuner cards

·         Perform channel scan

·         Confirm Channel numbers are correct

·         Configure EPG grabber


Spludlow Web Footer