Project

General

Profile

Actions

Tvheadend NTSC » History » Revision 2

« Previous | Revision 2/6 (diff) | Next »
chris1h1 -, 2010-05-27 04:38


Analogue NTSC with HTS-Tvheadend

Tvheadend does not work "out of the box" with analogue NTSC, rather it is necessary to compile tvheadend from source. This guide is aimed at relative Linux novices, and reflects the steps that I took myself when starting with a fresh installation of XBMC Live. Credit is due to Hein (who in turn credited Ram) from the tvheadend mailing list for getting me off on the right track.

First, make sure you have the packages installed that are required to build tvheadend:

{{{
sudo aptitude install build-essential libavahi-client-dev subversion
}}}

Now create the following directory. This is where we'll download the source code to and eventually build the application:

{{{
mkdir -p /opt/tvheadend/src
}}}

Now you need to check out the Tvheadend source code using svn:

{{{
svn co svn://svn.lonelycoder.com/hts/trunk/tvheadend /opt/tvheadend/src/
}}}

We need to make a small edit to a file to switch analogue support from PAL to NTSC:

{{{
cd /opt/tvheadend/src/src
nano v4l.c
}}}

Press Cntl + W to perform a search in this file. Search for the following:

{{{
v4l2_std_id
}}}

Change:

{{{
v4l2_std_id std = 0xff;
}}}

To:

{{{
v4l2_std_id std = V4L2_STD_NTSC;
}}}

Cntl + X to close, Y to save, Enter/Return to save with the existing file name.

Run the configuration script:

{{{
cd ..
./configure --prefix=/opt/tvheadend --release
}}}

If all went well you can compile the Tvheadend source code:

{{{
make
}}}

If the source is compiled with no errors you can install the compiled source:

{{{
make install
}}}

Stop the existing version of tvheadend, in order to copy the new files over the existing ones. Find the PID of everything running that includes "tvheadend" in the name:

{{{
ps aux | grep tvheadend
}}}

The PID is the first number, after "hts". Kill it (replace PID with the actual number from the previous command):

{{{
sudo kill PID
}}}

Make sure tvheadend is not running any longer by trying to access the web ui - you should get a "not responding" style error.

Copy the new files over the existing ones (the "-i" will prompt you to make sure you want to overwrite the files that already exist at the new location. This is just to give feedback that the paths are correct):

{{{
cp -i /opt/tvheadend/bin/tvheadend /usr/bin/tvheadend
cp -i /opt/tvheadend/share/man1/tvheadend.1 /usr/share/man1/tvheadend.1
}}}

Run tvheadend with no username or password prompt, in order to set these credentials from within the web ui:

{{{
cd /usr/bin
./tvheadend -C
}}}

Go to the web ui and set an admin username and password in the "Configuration > Access Control" area. Confirm that you're now running a version from SVN by visiting the "About" tab.

Restart the computer. Since the executable is at the same path and has the same name, the existing script in /etc/init.d/ should start tvheadend upon boot (assuming you're using a recent version of XBMC Live).

Note: If XBMC starts up with just a small grey error message in the middle of the screen complaining about OpenGL, issue the following command and say "yes" to everything once it finishes the long download stage:

{{{
sudo nvidia-installer --update
}}}

Add a video source in XBMC that looks like this (assuming XBMC and tvheadend are running on the same computer):

{{{
<source>
<name>Live TV</name>
<path>htsp://username::9982</path>
</source>
}}}

For XML TV listings I created a free account at http://tvlistings.zap2it.com, then followed the instructions at http://zap2xml.110mb.com/ to use their perl script to create an XMLTV file. With the XBMC Live distribution there were several libraries missing from perl - every time I tried to run the script, I'd get a message like "Can't locate HTML/Parser.pm in @INC". To fix this, do the following:

Go to /usr/bin since this is where perl lives:

{{{
cd /usr/bin
}}}

Go into the perl CLI:

{{{
perl -MCPAN -e shell
}}}

Search for whatever the error message was talking about:

{{{
i /HTML::Parser/
}}}

or

{{{
i /HTML::Cookies/
}}}

etc. Once you've found a likely candidate, install it:

{{{
install HTML::Parser
}}}

Repeat this for each missing item that perl complains about when you try to run the zap2xml script.

Updated by chris1h1 - over 14 years ago · 2 revisions