Hack 41. Putting Text on the Screen

   

Hack 41 Putting Text on the Screen

figs/moderate.gif figs/hack41.gif

Ever wanted to add your own Closed Captioning to a television show? Here is your chance .

Have you ever wanted to mute your television show and put words in the mouth of the actor or actress? Maybe you just want to translate the dialog into another language. Or, more maliciously, have you ever wanted to insert your own subliminal messages into a television show? If so, then I have a utility for you.

One possible way to do this is to create an image and use osdwriter [Hack #41], but what a pain that would be. Imagine creating an image in Photoshop, copying it over to TiVo [Hack #36], and then invoking osdwriter every single time you want to put a new line of text on the screen. Ouch!

Enter Christopher Wingert's newtext2osd (http://www.geocities.com/wyngnut2k/newtext2osd-1.4.tar.gz). This is a simple command-line program that takes any arbitrary text as an argument and plops it right on your TV screen.

Download the newtext2osd archive, unzip it, and you should find a single binary called newtext2osd . Transfer it [Hack #36] to your TiVo's /var/hack/bin directory, and make it executable using the chmod command:

 bash-2.02#  chmod 755 /var/hack/bin/newtext2osd  

Using newtext2osd is really easy. To display a "hello, TiVo hacker" at position (10, 10) on the screen for 10 seconds, you'd type:

 bash-2.02#  newtext2osd -s 10 -x 10 -y 10 -t "hello, TiVo hacker"  

Figure 3-9 shows the result.

Figure 3-9. Text sent to the television screen using newtext2osd
figs/tivo_0309.gif

The screen, in newtext2osd dimensions, is about 40x25. If your text simply won't fit, newtext2osd will simply complain. You can even specify the text color and background color using the - f and - b arguments, respectively. The color range is from 0-255, and you can check out the best colors in Table 3-2. This program also understands particular words as colors when passed using the --fg (foreground color) and --bg (background color) arguments. The following are recognized color names : transparent1 , transparent2 , transparent3 , grey , white1 , white2 , white3 , red1 , green , red2 , orange , turquoise , red3 , yellow , black1 , and black2 . Play around and find a combination you like.

Table 3-2. Some of the best color values that you can pass to newtext2osd

Color value

Color

Clear

1

Light grey

4

White

5

Black

6

Blue

7

Green

9

Yellow

11

Red

29

Orange

34

Pink

Of course, text can overlay live television or recorded programming. And that's just the tip of the iceberg. You can also have the program watch a file or wait until the program is killed before it wipes away the text.


   
Top


Tivo Hacks. 100 Industrial-strength Tips Tools 2003
Tivo Hacks. 100 Industrial-strength Tips Tools 2003
ISBN: 1597490318
EAN: N/A
Year: 2004
Pages: 164

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net