cc2y4m - translates broken PAL signals to YUV4MPEG
--------------------------------------------------


Compilation:
~~~~~~~~~~~~

Just type
$ make
It should compile.


Portability:
~~~~~~~~~~~~

The program currently only works on x86 linux machines with an MMX
processor. Color decoding is already ported to C. So the only obstacle
is the low-level interface with the card and the v4l interface. 



Installing:
~~~~~~~~~~~

Just copy cc2y4m to /usr/local/bin. If you want non-root users to
be able to use it, you need to install it SUID root.
# cp cc2y4m /usr/local/bin
# chown root:root /usr/local/bin/cc2y4m
# chmod +s /usr/local/bin/cc2y4m

Note: it is a big security risk to install this program SUID root
on a machine connected to a network.

Copy cc2y4m.conf to $HOME/.cc2y4m and edit the file. Instructions within.

Usage:
~~~~~~

Assume that a channel without sync pulses is broadcasting at the first
channels specified in $HOME/.cc2y4m.  Then
run
$ cc2y4m | mplayer -

assuming you have mplayer(1) installed. If you don't, you should.


Bugreports/Feature request:
~~~~~~~~~~~~~~~~~~~~~~~~~~~

I am lazy. I will keep the program in such a state that it satisfies
my needs. If you want a bug fixed or a feature added, you may send
a patch for it. Decent patches will be applied. Send them to me
<snel@phys.uu.nl>.


Hacking:
~~~~~~~~

The program includes a debug mode in which an SDL window appears
with output from the capture card. See the manpage on how to enable
it.

The program has 3 threads.

1. capture thread, it is implemented in bttv.c, it is responsible for
buffer management, and it can be instructed to change the PLL frequency
at specified times. It is important that the times at which the PLL changes
are known, so the locking code can predict the next appearance of the 
sync point.

2. locking thread, it is implemented in lock.c, it is responsible for
knowing where the upper left corner of the TV image currently is on the 
screen and for ensuring that it moves to (and stays at) the upper left
corner of the output window.

3. main thread, it is responsible for starting the two other threads,
decoding the image to YUV and deciding if inversion is needed, it 
is implemented in cc2y4m.c. Color decoding resides in esnelmDecode.c

Some info on the locking code can be found in ./TECH.

License:
~~~~~~~~

The GNU GPL applies. See COPYING.


Further info:
~~~~~~~~~~~~~

See the manpage and the FAQ.

$Id: README 65 2004-08-01 10:35:47Z rsnel $
