style:defaultalt 1alt 2

Creative Ways to Use Linux

 <<< index of Linux

Introduction

As a lover of tools and mechanisms, I find that the Gentoo Linux metadistribution provides amazing flexibility for solving my computing needs, no matter how strange, and with only some on-the-fly coding. Here are some of the strange and silly ways that I've made use of a few Linux machines about the house.

NOTE: This document is a work-in-progress with frequent additions/modifications.

Wireless TV Tuner

My primary desktop is an Apple PowerBook running Linux, and I wanted to watch cable television on it while simultaneously using other applications. The only video capture cards that are CPU-friendly and Linux/PPC laptop compatible are Firewire-based, and rather expensive. (USB and PC Card are not CPU-friendly with raw video data.) But my headless x86 server does have a cheap PCI tuner card. So, rather than purchase new hardware, I decided to stream the tuner output over the 802.11 wireless, and watch TV wirelessly on my laptop.

Since a Base 100 switched Ethernet connection would be necessary to stream raw video from the tuner card, a lossy compression scheme must be used to encode the data to a Base 5 wireless rate, low enough for near-worst-case connectivity. Also, the data must be adequately buffered for variations in the network speed. To accomplish this, a few applications are wrapped together with a script. The necessary applications for streaming the data:

Additionally, a few other applications are added to enhance usability/automation, but could be substituted or removed:

Finally, an arbitrary port is opened on each machine's firewall to permit the custom communication (port 10001, for this example).

TV Streaming Script: tv-stream.sh  (md5)  (asc)

Some pseudo-code to explain the script:

	set user constants for video/audio rates and codecs

	examine command-line input for channel number
	    if number not specified:  run zenity to query
	
	spawn terminal:
	  connect to server with tuner card via SSH:
            create fifo file
	    run mencoder: input TV channel, output to fifo file
	    run bfr:      input fifo file, output to pipe 'A'
	    run netcat:   input pipe 'A', output to TCP pipe

	local:
	    run netcat:   input TCP pipe, output to pipe 'B'
	    run bfr:      input pipe 'B', output to pipe 'C'
	    run mplayer:  input pipe 'C', render on X11 display
      
This page was last modified on Sun, 10 Sep 2006. © Copyright Timothy Stotts 2002, 2007. All rights reserved. ^ top of page
validate:  xhtml  css  rss  atomcontact:  email  xmpp <<< index of Linux