File: scripts.txt

package info (click to toggle)
nvtv 0.4.7-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,328 kB
  • ctags: 4,303
  • sloc: ansic: 30,302; sh: 6,614; makefile: 159
file content (86 lines) | stat: -rw-r--r-- 2,597 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
From Russell Sears, sears@users.sourceforge.net:

The FAQ suggests that users write a shell script to automate the TV-Out
setup for video playback on their setup. 

This would seem to be a pretty simple task, but there are some
subtleties to it, such as switching the video mode properly, and
moving the mouse pointer to the upper left corner of the screen for
Mplayer.

Since Mplayer's -fs option causes it to read the current physical
resolution from the X server when xv is the output program, all we need
to do is switch to 640x480 (or 800x600), move the cursor to the upper left
corner of the screen, activate tv-out, run MPlayer, turn off tv-out, and
finally, switch back to the original mode. 

Usage: 
script [additional mplayer arguments] 
For example: 
script -dvd 1 
or 
script file.avi 

(It will prompt you for the root password.) 

Installation: 
1) Use the xv output (-vo xv) option for mplayer. (Other output types
may work) Put a line like vo=xv in your mplayer.conf once you've tested
this. 
2) Make sure you have xwarppointer (see section after script) 
3) Find a good mode for nvtv for your setup, and edit the script to reflect
it. 

This script makes two assumptions about your X setup. 
1) You are in the highest resolution mode when the script is run. 
2) The lowest resolution mode that is setup for your X server is the mode
you want to use for TV out. 

If these assumptions are wrong, you can either find a better program for
mode switching than XVidTune, or alter the number of times it is called. 

Note that: 
'xvidtune -prev' is equivalent to <ctrl>-<alt>-- 
and 
'xvidtune -next' is equivalent to <ctrl>-<alt>-+ 

Here's the perl script. (You'll need to edit it if you aren't using MPlayer, or
if you need to change your nvtv resolution.) 

--- Begin Script --- 
#! /usr/bin/perl -w 
use strict; 

$| = 1; 

my $command = "mplayer -fs " . join " ", @ARGV; 

system( 
"su -p -c \"" 
. "xvidtune -prev; " 
. "xwarppointer 0 0; " 
. "nvtv -r 640,480 -s Large -t -S NTSC; " 
. "$command; " 
. "nvtv -m; xvidtune -next\"" 
); 
--- End Script --- 

All the helper programs are pretty standard, except for xwarppointer,
which you can get here: 

http://razorback.yi.org/xwarppointer/ 

(I had to change the library path on the homepage from /usr/X11/lib to
/usr/X11R6/lib on debian 3.0 to compile it) 

The two things this script is really missing are a setuid nvtv, and a better
way to switch X modes.