This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Feature

Watch TV on your Linux computer

By Rob Reilly on March 11, 2004 (8:00:00 AM)

Share    Print    Comments   

Wouldn't it be nice to sit at your Linux machine and have a crisp little color TV screen right there in one of your desktop windows? Using a cheapo TV tuner card, you can get great picture and sound quality on anything from an old 133 MHz Pentium on up. The hardware requirements, at $20 for a TV card after rebates, are pretty modest, and the payoff is a lot of fun.

"Obsolete" hardware is a beautiful thing, when you can make it do productive work again. My Linux TV machine is a classic Pentium desktop box with the following components:

  • 133 MHz Pentium CPU, jumpered to run at 187 MHz
  • 128 MB RAM
  • 8 MB ATI Rage video card
  • Hauppauge Win-TV BT878-based TV tuner card
  • 3 GB disk
  • 8X CD-R
  • Generic audio card
  • Stereo speakers
  • Mouse and keyboard (these are optional)
  • 15-inch Sony monitor

Obviously, you can put a TV card in a more current desktop machine and be quite happy. I've found that the main factors influencing performance are video memory, followed by main memory. Increasing video memory allows for a larger TV window on the screen and better picture quality. For example, with a 4 MB video card, you can expect a nice color picture in a window of about 200x100 pixels. At 8 MB you'll get a clear picture at about 480x320. It's possible to make the picture bigger, to a limited extent, but it shows horizontal lines and noticeable lags in movements as you increase the window size and keep memory size constant.

Similar issues come up with regular computer memory, although they're not as pronounced as video memory. I've run TV cards on old Pentiums with 64 MB of memory and the performance is just OK. KDE comes up slowly, applications take a long time to load, and action on the picture is jerky.

Hook your computer up to TV input, like a cable connection or external antenna feed. My setup uses a BrightHouse Network cable feed.

Naturally you'll need to have Linux running on your TV box. The distribution I use is SUSE 8.2 Pro. It's a good mix of GUI-based and "do it yourself" configuration tools. The beauty of a distribution like SUSE is that you can use the GUI utilities or the command line, depending on your abilities and knowledge.

Mainstream Linux TV applications

When you install Linux you'll want to look up the TV applications that your distribution supports. There are several such TV programs in the SUSE 8.2 package, all of them mature and easy to use. I'll use one as an example for setup and operation, then point out some particulars you'll want to know about two other packages. Setup and operation are very similar across the three programs.

motv

motv is my favorite TV program because of its easy-to-use, mature user interface. It's actually a cool front end to the xawtv program, which we'll discuss shortly. motv should be available if you load the xawtv package. You can start it from the command line or from the SUSE start menu under Multimedia and Video. It first appear on the screen as a window that displays whatever video source is connected at the time. You can set the video source to the TV tuner, a composite video input, or USB video input, depending on what devices you have hooked up.

To watch TV with motv, begin by making sure your cable TV coax is screwed into the back of the TV tuner card and that you have a good TV signal. Make sure your sound card is working. You may need to start a sound mixer program, such as Kmix or smixer, to adjust sound settings. And don't forget to plug the audio output of the TV card into the line input on your audio card. The first time I used a TV card I sat there wondering why I couldn't hear anything, while puzzling at the little male-to-male audio cable that came with the card. When I made the connection, pardon the pun, I felt pretty doofy.

Once you've started motv, right-click anywhere in the video picture on the screen to see the motv control window, which lets you select Options and Frequency Table. You need to pick the correct channel type for your area. For me it's us-cable.

Next, select Options, TV Norm, and select NTSC if you're in the United States. You may have to use another protocol if you are in another location.

Select Options, Channel Scan, and then Start when the new window appears. The card scans through available channels from 1 to upwards of 115. (One limitation of current commodity TV cards is that they can't scan the whole range of 500+ channels available on cable or satellite service.) Scanning channels may take a few minutes. When the software finishes, you'll see a complete list of channels that it found. You can step through the ones you watch and edit the names to something you can remember. For example, channel 28 in my area is FOX News, so I added that name in place of "channel 28."

When you finish scanning channels and editing station names, and in fact anytime you change any settings, make sure that you save the settings, so that they are there when you start up motv the next time. Select Options and then Save Configuration.

Operating motv is easy. Simply click on one of the channels in the list to watch it. You can resize the picture by dragging a side or corner of the window.

You can explore motv's tool bar and find all kinds of settings to play with to optimize your viewing experience. Clicking on Options and Scales lets you change brightness, hue, saturation, and contrast.

Depending on the video devices you use, it's also possible to grab images and create AVI files using the appropriate buttons or selections from the toolbar. I've had good luck with grabbing pictures to JPEG format using input from the TV tuner source and composite video. I've also captured short video clips, though the picture quality and frame rates are understandably mediocre on the old 133 MHz machines.

xawtv

xawtv is very similar to motv. The biggest difference you'll see is in the simplicity of the user interface. It's basic! xawtv is a nice fast program, though, and has sliders for brightness, contrast, and so on built right into the control panel. The way the sliders work seems backwards to me; I have to right-click while rolled over the slider to get the control to decrease the value. Conversely, I left-click to increase values. xawtv lacks a channel scanning function, although if you configure motv, it will use that channel list.

Like motv, xawtv lets you use alternative video input sources, so if you want to hook up your video camera (composite video, not FireWire) and grab images or make video clips, you can do it with xawtv.

KWinTV

KWinTV is a member of the KDE family. It has a spiffy user interface with a little channel window and control buttons right below the tool bar. Although the interface is nice and offers lots of options to play with, KWinTV doesn't support alternate video sources, such as the composite input.

Much like xawtv, KWinTV scans the channels with a "wizard," and it can grab channels from the motv list.

One unique feature is KWinTV's IR control option, which lets you bind remote control events, such as pushing a certain button, to actions to be taken in KWinTV. Obviously you need an IR detector and the IR drivers set up on your machine. The feature is neat, although might be a little impractical, because getting IR to work on a Linux PC has been problematic and detectors usually are not installed on desktop machines. Still, I've seen some reports of people building personal video recorder boxes and using the IR functions, so if you have the time and patience to get it to work, it's there for you.

What else?

What else can we do with a cheapo TV tuner card and an old desktop Linux box? There are a few more tricks that you might be interested in.

Alternate video input

motv and xawtv have menus that let you select your video input. You can use board-dependent inputs like the tuner or the composite video jack, or you can plug in a USB camera to get your video image. Be cautious, though: some devices (particularly USB-based Web cameras) have driver problems. My five-year-old, $175 CPIA-based Webcam used to lock up my laptop when I was on the 2.4.18 kernel. I've since moved to 2.4.20 and have had much less trouble, except when I try to go to full-screen mode. Make sure you've set up your machine with a journaling file system if you're going to experiment with USB Webcams.

Remote control TV with x2x

In my article Cut the cord on your next presentation" I described using a remote control program called x2x that allows you to control a remote Linux machine and monitor via your local keyboard and mouse. When you want to work on the remote machine, you simply roll the cursor over to that screen and click or type your selections.

I've set up the Linux machine with my cheapo TV card to run without a keyboard or mouse, using x2x. Whenever I want to change channels or raise the volume, I roll the cursor from my laptop screen to the desktop screen and make the adjustments. It works great and helps keep my desk uncluttered.

Poor man's surveillance camera via X

Here's another fun video project. Take two wireless laptops and plug your USB camera into laptop number 1. On laptop number 2, ssh into laptop number 1 with the "-X" option. For example:

     ssh -X 192.168.2.3

You can then start up motv on laptop number 2 and see an image from the camera -- sorry, no audio. When you're using 802.11b cards the picture can be pretty jerky, with a lot of lag in the action. When I've used this technique with regular 100Mbps wired Ethernet, the action from the camera is much smoother.

That's a wrap

Overall, TV cards work very well under current versions of Linux. The key is to use as much video and main memory as possible. The performance is good even with aging hardware. The TV cards are very inexpensive and reliable. Look for sales on the cards at computer and office products retailers around holidays.

Rob Reilly is a freelance technology writer, speaker, and consultant whose articles appear in print and on the Web. He offers contracted writing and seminar services on OpenOffice.org, Road Warrior techniques, and business Web basics.

Share    Print    Comments   

Comments

on Watch TV on your Linux computer

Note: Comments are owned by the poster. We are not responsible for their content.

tvtime instead of xawtv

Posted by: Anonymous Coward on March 11, 2004 05:13 PM
I'd recommend tvtime above xawtv. I've used xawtv for about a year and then I discovered tvtime. It's image quality is simply superior (and a lot) then xawtv's. It gives you various options to process the frames, and you really see the difference. It has a very nice, clean on screen menu for configuring it. Xawtv also gave some grey lines on top and the bottom of the screen, plus it crashes with the latest nvidia drivers.

#

Re:tvtime instead of xawtv

Posted by: Anonymous Coward on March 12, 2004 12:10 AM
Agree that tvtime is much nicer. However, since the author is talking about running it on pretty old machines, it might not be fast enough. (tvtime does not support overlay mode)

#

Re:tvtime instead of xawtv

Posted by: Anonymous Coward on March 12, 2004 06:14 PM
Use fftv. It support true fullscreen overlay mode with black border cropping. It also support scheduled power-on recording and many more features.

http://fftv.sf.net

#

KWinTV - QTVision

Posted by: Anonymous Coward on March 11, 2004 06:15 PM
KWinTV is currently being rewritten as QTVision, the CVS is pretty stable and very useable, oh, and it _has_ output selection + pal/secam/NTSC selection (although there was a bug in that last time I checked, ie mid jan).

#

mplayer

Posted by: Anonymous Coward on March 11, 2004 07:50 PM
I can not belive that nobody mentioned MPlayer. I play TV, DVD and DivX with MPLayer.

DG

#

Absolutely TVTIME

Posted by: Anonymous Coward on March 11, 2004 09:39 PM
Agree with the previous comment. TvTime gives absolutely the best quality, and is AFAIK the only one to give so many de-interlacing options. Interface takes some time to get used to, but once you know it, it's very nice. Our kids use it on 2 PC's every day.

#

Preferred TV card?

Posted by: Anonymous Coward on March 11, 2004 09:49 PM
Does anyone have a preferred TV card? Hauppage has a number of them and it's not clear that all of them are compatible. Also, some probably work better than others. Any suggestions?

ks

#

Re:Preferred TV card?

Posted by: The Spoonman on March 12, 2004 12:53 AM
Most of the Hauppauge cards are BTV848 chipset-based, so should work under Linux. Check around their site and find drivers, Hauppauge is one of those companies that does a good job of keeping their Linux drivers up to date.



As for preference, it all depends on what you're going to do with it. If you're just going to watch TV, then the WinTV gives good bang for the buck. As the article says, it can be run on lower-end hardware, as processing is done on-card. I remember looking once (under Windows) at Task Manager and saw that the TV app was using less than 1% processor usage on my 366Mhz machine. Didn't impact the machine at all.



Now, if you are going to do more, such as record video digitally, first of all you'll need a bigger machine, but if you go with one of their cards that can encode to MPEG-2 in hardware, you're pretty set. I have a friend who has just such a card and he runs it on a PII 333 without fail. He just has it automated to re-encode it to a better format in the middle of the night on a faster machine.

#

Re:Preferred TV card?

Posted by: Curtman on March 12, 2004 05:35 AM
I have a Hauppage WinTV, and and ATI All In Wonder. If you're after picture quality, the ATI is the way to go, hands down. If you want to build a PVR, its much more difficult to do with the ATI though. Thats not to say its impossible, video capture from my ATI has gotten much better over time. The <A HREF="http://gatos.sourceforge.net/" TITLE="sourceforge.net">Gatos</a sourceforge.net> project might be a little difficult to get installed and working, but its well worth it.

#

Any TV/Capture devices for Laptops?

Posted by: Anonymous Coward on March 12, 2004 01:01 AM
Are any of the various manufacturers USB TV/Capture devices suitable for a laptop computer running Linux?
I'm getting ready for a child going away to school next year. Having TV and Vid capture/editing on a laptop would fit her needs completely. Eliminating the need for multiple devices and it's nicely portable.

#

Using RAM for video? &amp; thanks Rob!

Posted by: Anonymous Coward on March 12, 2004 01:36 AM
I don't know if its possible, but I seem to recall a story or tip about using system memory for video, or video memory for system memory. Or both in different articles.

Is it possible to use some system memory for the video? Anyone have a hack or can point to an article?

I've run into the usb camera/lockup issue as well. If I plug it in while my system is running, it freezes the system right in its tracks. I think if I unplug it, it crashes the system, causing a shutdown. That's with a slightly older kernel I tried, perhaps 2.4.22 or 23, not the latest release. If I plug it in before bootup, and leave it plugged in, there don't appear to be any problems. That may not sound like a big deal to windows users, but running GNU/Linux, my system runs for months without a reboot, so the camera is a hassle. Don't remember the name, there's no name on the case, and I'd have to plug it in to check dmesg. It's a no name brand web cam anyway, so the actual manufacturer is different than what showed on the box, wherever that is.

I've used xawtv to take some screen grabs of the webcam. the only problem I ran into was with one of the sliders. The one for the brightness. I couldn't get the picture bright enough, and in sliding it all the way over, it went "under" the edge, and no matter what I tried, I couldn't get that bar to slide back.

Nice article by the way Rob. Thanks. It's always good to be reminded of what's out there, and learn of new apps that we haven't fiddled with yet as well. And I especially appreciate knowing that you were able to get the setup working on a lower end computer such as yours.


 

#

Why not PVR while you're at it?

Posted by: Anonymous Coward on March 12, 2004 02:55 AM
MythTV is all there is to say:



<A HREF="http://www.mythtv.org/" TITLE="mythtv.org">MythTV Site</a mythtv.org>

#

I was waiting for someone to post this

Posted by: Anonymous Coward on March 12, 2004 03:15 AM
The author is explain xawtv, basically how to ride a bicycle across the street without training wheels, and you suggest he should cover a manned mission to Mars in the same article?

When MythTV gets easy enough for your mom to install it, instead of its current situation which would drive a PhD nuts, then maybe you can bring it up. And no, the Myth live CD installer is not what I'm talking about. As the author of MythTV has already stated, he's not writing the software for anyone but himself.

And while we're on the topic, why doesn't someone fork Tivo's source?

#

Re:I was waiting for someone to post this

Posted by: Anonymous Coward on March 12, 2004 10:18 AM
If you use Gentoo Linux it's not hard to install at all.
emerge mythtv

That's it. everything will be taken care of.

#

Re:I was waiting for someone to post this

Posted by: Anonymous Coward on March 12, 2004 07:36 PM
MythTV is a little daunting, but I bootstrapped my installation on Fedora Core 1 with RPMS from ATrpms:

http://atrpms.physik.fu-berlin.de/name/mythtv/

MythTV worked right away with few glitches. It's not for your grandmother, but maybe her grandson can stop by the house every once and a while and give her a hand! Have a cup of tea, chat about the family, and tweak the MythTV recorder.

#

"Cheap" and the drawback.

Posted by: Anonymous Coward on March 12, 2004 05:28 AM
Cheap doesn't mean better. Why not put a more expensive, better TV card in your faster computer? Really, at least think about this and research (!) wether the quality of the cheap card is worth the low price. I happen to have such a card (BT848) and i'm certainly not satisfied with this shitty quality. Seriously, keep the option open. Know what you buy. Know wether a more expensive card is okay. Don't blindly buy a cheap one.

Having such a computer like this one gives not much performance. On a faster computer however, you can watch TV as well as do/run other things. This server-model you're suggesting costs quite a bit power especially when 24/7. Instead, i'd suggest to draw a direct link with the TV (or cable) and the TV card which resides in your main, fast Linux desktop. In this setup you'd also need 2 decent NIC's if you'd watch with a bit of a quality. Decent, which implies i'm not talking about $10 RTL8139's. Like i said, i'd prefer a direct link with my main, albeit a bit faster, Linux desktop.

It might all cost a bit more, but the qualit could be worth it. Try to consider it instead of blindly following the model which has been suggested.

Not a bad article though. I actually liked it, especially because you mentioned a number of applications. Thanks a lot for sharing<nobr> <wbr></nobr>:-)

#

Satellite

Posted by: Anonymous Coward on March 12, 2004 03:14 PM
No mention of satellite TV. I have a cheap (66 ) DVB-S card in my hush silent PC. THis means that I can capture about a zillion high quality channels from the sky.

As a plus, the BBC is in very high quality HDTV format - captures of still images look like they come from a digital camera!

Unfortunately all PVRs only work well with Hauppage cards (220 +) so I am going to have to write my own recording software...

#

random thoughts

Posted by: Anonymous Coward on March 12, 2004 08:52 PM
The configuration of the tv card itself may seem difficult if a gui tool isn't available (draktv?). On gnu/linux a command like "modprobe bttv card=xx tuner=yy" is necessary. The xx and yy can be found in the CARDLIST file (try locate CARDLIST).

Concerning the applications that can be used i'm surprized that there was no mention of other utilities like : alevt (teletexte), fbtv (really useful when no X server is available), xawtv_scantv (finds the channels), xawdecode (record movies) and related utilities (remote control with lirc and for applications for recording).

IIrc there is also something in mplayer/mencoder for recording movies (what does the command-line for doing that look like ?).

#

Re:random thoughts

Posted by: Anonymous Coward on March 13, 2004 07:10 AM
Uhm something like mplayer tv://
Check man mplayer or man mencoder or see the documentation or faq at http://www.mplayerhq.hu (unfortunately the documentation doesn't work here).

#

Skipped the hard part

Posted by: Anonymous Coward on March 12, 2004 09:29 PM
The author completely skipped over the two hard parts:
1. Installation of drivers for tv card (even some hauppauge are a pain)
2. Recording video and audio is a pain even after the drivers are installed (i.e. ati cards)

I have tried a half dozen cards, using both Suse and Slackware, and linux could use a lot of improvement in this area.

#

Re:Skipped the hard part

Posted by: Jack Ungerleider on March 15, 2004 10:41 PM
While every card is different in what is required for drivers, my experience is just the opposite.

Last summer I purchased an Aver Media PC-PVR card for the purpose of transferring some video to take with me when I went on a trip. It was about 2.5-3 minutes of video from a local news story. I plugged in the card and SuSE 8.2 found it and offered to go to YaST for setup. In YaST I made selections based on the documentation with the card. This particular model was not listed. But watching what SuSE listed as the driver to be installed it was clear that other AverMedia cards with the same chipset were listed so I took one of those. Tuner selection provided the an option for the tuner listed in the docs so that was easy.

Recording wasn't difficult, the problem was choosing a compression codec that would make the file "managable" in size for transfer via a CF drive. (In retrospect I should have burned it to a small CD-ROM.)

Basically I bought the card on a Saturday afternoon and by that evening had the video recorded. KWinTV works for me but I'm not that picky.<nobr> <wbr></nobr>;-)

Jack

#

all i have to say....

Posted by: Randall McFarlane on March 15, 2004 11:53 PM
is that I have a ati all-in-wonder and it a bitch to get working(still is). Driver installation needs to be a little soother. I can deal with it but a windows user that can just add a tv card and thats it is not going to use linux.

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya