Multiple Recordings with VLC

From MythTV Official Wiki
Revision as of 23:03, 21 May 2007 by Greg (talk | contribs) (Define our IPTV channels list for MythTV)

Jump to: navigation, search

About This Page

This page is to document how I setup MythTV and VLC to record multiple channels from a single multplex on a single DVB card. YMMV but overall this works very well for me in the few days I've been using it.

This allowed me to record 8 seperate channels from the single card and lucky for me 7 of 8 are my main recording channels.

While I know that work is ongoing enabling this type of recording directly in mythtv but one night I had a thought on how I might do it using VLC and decided to try it out with happy results.

The Theory

Basically I setup VLC to access the DVB card, reading in the entire multiplex and breaking it out into 8 seperate IPTV streams which I then configure mythtv's IPTV recorder to record. In my case the DVB source is in the same machine as the slave backend I'm recording this on, but there is no reason this wouldn't work across hosts over a network as well.


For this I used VLC 0.8.6b and MythTV svn head revision #13447. I don't see any reason this wouldn't work with earlier revisions, I've just never tested those. On my backend (XP2500+) vlc used about 13% cpu in this role and the backend used almost none.

For this to work your version of VLC must be compiled with --enable-dvb and the linux dvb headers installed. Unfortunately in my case the vlc package for Slackware didn't include DVB support so I had to compile my own.

Getting Started

First I defined my VLC config file.

I defined the adapter I wanted to use (dvb1 in my case),
The fact that I wanted to use QAM256,
The Frequency of the multiplex I wanted,
The program ID's of each channel I wanted to be made available,
And finally I defined what I wanted to be done with each stream.(repackaged as MPEG2TS and streamed to a specific IP/PORT),

The Frequency information and program ID's can either be gathered from the mythtv database if you have previously scanned the channels or from a channels.conf. I'll leave that as a project for you to figure out.

Below is my file for reference

~$ cat dvb2iptv.vlm
new QAM2IPTV broadcast enabled

setup QAM2IPTV input "dvb://"
setup QAM2IPTV option dvb-adapter=1
setup QAM2IPTV option dvb-frequency=681000000
setup QAM2IPTV option dvb-modulation=256
setup QAM2IPTV option programs=11,12,13,14,15,16,17,18
setup QAM2IPTV option ts-es-id-pid

#### These are the lines from my channels.conf I used to get the program ID (last column) and Frequency (3rd column)

setup QAM2IPTV output #duplicate{dst=standard{access=udp,mux=ts,url=,sap,group="MyStation",name="WCVB"},select="program=11",dst=standard{access=udp,mux=ts,url=,sap,group="MyStation",name="WBZ"},select="program=12",dst=standard{access=udp,mux=ts,url=,sap,group="MyStation",name="WHDH"},select="program=13",dst=standard{access=udp,mux=ts,url=,sap,group="MyStation",name="WUHF"},select="program=14",dst=standard{access=udp,mux=ts,url=,sap,group="MyStation",name="CJCH"},select="program=15",dst=standard{access=udp,mux=ts,url=,sap,group="MyStation",name="ASN"},select="program=16",dst=standard{access=udp,mux=ts,url=,sap,group="MyStation",name="CBHT"},select="program=17",dst=standard{access=udp,mux=ts,url=,sap,group="MyStation",name="CIHF"},select="program=18"}

control QAM2IPTV play

Define our IPTV channels list for MythTV

Here is the M3U file I defined for each of the channels I wanted to use. I also took advantage of the mythtv specific EXTMYTHTV tag to specify the XMLTVID for each station since I wanted to make sure I got proper program guide data.

In this example I used channels 881 through 888, and configured myth to listen on port 1231 through 1238 for each

~$ cat .mythtv/iptv.m3u
#EXTINF:0,881 - WCVB
#EXTINF:0,882 - WBZ
#EXTINF:0,883 - WHDH
#EXTINF:0,884 - WUHF
#EXTINF:0,885 - CJCH
#EXTINF:0,886 - ASN
#EXTINF:0,887 - CBHT
#EXTINF:0,888 - CIHF