diff -urNw ARToolKit2.40/examples/distortion/Makefile.Linux ARToolKit2.40-good/examples/distortion/Makefile.Linux
--- ARToolKit2.40/examples/distortion/Makefile.Linux	2001-05-29 08:23:05.000000000 +0200
+++ ARToolKit2.40-good/examples/distortion/Makefile.Linux	2002-11-21 21:40:41.000000000 +0100
@@ -3,7 +3,7 @@
 BIN_DIR= ../../bin
 
 LDFLAG= -L/usr/X11R6/lib -L$(LIB_DIR)
-LIBS= -lARgsub -lARvideo -lAR -lglut -lGLU -lGL -lXi -lXmu -lX11 -lm
+LIBS= -lARgsub -lARvideo -lAR -lglut -lGLU -lGL -lXi -lXmu -lX11 -lm -lccvt
 CFLAG= -O -I/usr/X11R6/include -I$(INC_DIR)
 
 OBJS = object.o draw_object.o
diff -urNw ARToolKit2.40/examples/exview/Makefile.Linux ARToolKit2.40-good/examples/exview/Makefile.Linux
--- ARToolKit2.40/examples/exview/Makefile.Linux	2001-05-29 08:23:05.000000000 +0200
+++ ARToolKit2.40-good/examples/exview/Makefile.Linux	2002-11-21 21:40:41.000000000 +0100
@@ -3,7 +3,7 @@
 BIN_DIR= ../../bin
 
 LDFLAG= -L/usr/X11R6/lib -L$(LIB_DIR)
-LIBS= -lARgsub -lARvideo -lAR -lglut -lGLU -lGL -lXi -lXmu -lX11 -lm
+LIBS= -lARgsub -lARvideo -lAR -lglut -lGLU -lGL -lXi -lXmu -lX11 -lm -lccvt
 CFLAG= -O -I/usr/X11R6/include -I$(INC_DIR)
 
 OBJS = draw_object.o
diff -urNw ARToolKit2.40/examples/optical/Makefile.Linux ARToolKit2.40-good/examples/optical/Makefile.Linux
--- ARToolKit2.40/examples/optical/Makefile.Linux	2001-05-29 08:23:05.000000000 +0200
+++ ARToolKit2.40-good/examples/optical/Makefile.Linux	2002-11-21 21:40:41.000000000 +0100
@@ -3,7 +3,7 @@
 BIN_DIR= ../../bin
 
 LDFLAG= -L/usr/X11R6/lib -L$(LIB_DIR)
-LIBS= -lARgsubUtil -lARgsub -lARvideo -lAR -lglut -lGLU -lGL -lXi -lXmu -lX11 -lm
+LIBS= -lARgsubUtil -lARgsub -lARvideo -lAR -lglut -lGLU -lGL -lXi -lXmu -lX11 -lm -lccvt
 CFLAG= -O -I/usr/X11R6/include -I$(INC_DIR)
 
 OBJS = object.o draw_object.o
diff -urNw ARToolKit2.40/examples/simple/Makefile.Linux ARToolKit2.40-good/examples/simple/Makefile.Linux
--- ARToolKit2.40/examples/simple/Makefile.Linux	2001-05-29 08:23:05.000000000 +0200
+++ ARToolKit2.40-good/examples/simple/Makefile.Linux	2002-11-21 21:40:41.000000000 +0100
@@ -3,7 +3,7 @@
 BIN_DIR= ../../bin
 
 LDFLAG= -L/usr/X11R6/lib -L$(LIB_DIR)
-LIBS= -lARgsub -lARvideo -lAR -lglut -lGLU -lGL -lXi -lXmu -lX11 -lm
+LIBS= -lARgsub -lARvideo -lAR -lglut -lGLU -lGL -lXi -lXmu -lX11 -lm -lccvt
 CFLAG= -O -I/usr/X11R6/include -I$(INC_DIR)
 
 OBJS =
diff -urNw ARToolKit2.40/examples/simple/simpleTest.c ARToolKit2.40-good/examples/simple/simpleTest.c
--- ARToolKit2.40/examples/simple/simpleTest.c	2001-05-29 08:23:05.000000000 +0200
+++ ARToolKit2.40-good/examples/simple/simpleTest.c	2002-11-21 21:41:28.000000000 +0100
@@ -14,7 +14,7 @@
 char            *vconf = "";
 #endif
 #ifdef __linux
-char            *vconf = "-channel=1";
+char            *vconf = "-channel=0";
 #endif
 #ifdef _WIN32
 char            *vconf = "";
diff -urNw ARToolKit2.40/include/AR/config.h ARToolKit2.40-good/include/AR/config.h
--- ARToolKit2.40/include/AR/config.h	2001-05-29 08:23:05.000000000 +0200
+++ ARToolKit2.40-good/include/AR/config.h	2002-11-21 21:37:50.000000000 +0100
@@ -33,9 +33,9 @@
 #define   VIDEO_MODE_NTSC             1
 #define   VIDEO_MODE_SECAM            2
 #define   DEFAULT_VIDEO_DEVICE        "/dev/video"
-#define   DEFAULT_VIDEO_WIDTH         640
-#define   DEFAULT_VIDEO_HEIGHT        480
-#define   DEFAULT_VIDEO_CHANNEL       1
+#define   DEFAULT_VIDEO_WIDTH         320
+#define   DEFAULT_VIDEO_HEIGHT        240
+#define   DEFAULT_VIDEO_CHANNEL       0
 #define   DEFAULT_VIDEO_MODE          VIDEO_MODE_NTSC
 #define   DEFAULT_IMAGE_PROC_MODE     AR_IMAGE_PROC_IN_HALF
 #define   DEFAULT_FITTING_MODE        AR_FITTING_TO_IDEAL
diff -urNw ARToolKit2.40/lib/SRC/VideoLinux/video.c ARToolKit2.40-good/lib/SRC/VideoLinux/video.c
--- ARToolKit2.40/lib/SRC/VideoLinux/video.c	2001-05-29 08:23:05.000000000 +0200
+++ ARToolKit2.40-good/lib/SRC/VideoLinux/video.c	2002-11-21 21:47:32.000000000 +0100
@@ -19,6 +19,7 @@
 #include <AR/config.h>
 #include <AR/ar.h>
 #include <AR/video.h>
+#include <ccvt.h>
 
 #define MAXCHANNEL   10
 
@@ -114,6 +115,7 @@
     struct video_capability   vd;
     struct video_channel      vc[MAXCHANNEL];
     struct video_picture      vp;
+    struct video_window       vw;
     char                      *a, line[256];
     int                       i;
 
@@ -236,6 +238,17 @@
         printf("  vd.minheight =   %d\n",vd.minheight);
     }
     
+    memset(&vw, 0, sizeof(vw));
+    vw.width  = vid->width;
+    vw.height = vid->height;
+    vw.clipcount = 0;
+    if(ioctl(vid->fd, VIDIOCSWIN, &vw) < 0)
+    {
+      printf("couldn't set window size\n");
+      free(vid);
+      return 0;
+    }
+    
     /* check capture size */
     if(vd.maxwidth  < vid->width  || vid->width  < vd.minwidth ||
        vd.maxheight < vid->height || vid->height < vd.minheight ) {
@@ -299,7 +312,7 @@
     vp.contrast   = 32767 * 2.0 * vid->contrast;
     vp.whiteness  = 32767;
     vp.depth      = 24;                      /* color depth    */
-    vp.palette    = VIDEO_PALETTE_RGB24;     /* palette format */
+    vp.palette    = VIDEO_PALETTE_YUV420P;     /* palette format */
     if(ioctl(vid->fd, VIDIOCSPICT, &vp)) {
         printf("error: setting palette\n");
         free( vid );
@@ -337,7 +350,7 @@
     vid->vmm.frame  = 0;
     vid->vmm.width  = vid->width;
     vid->vmm.height = vid->height;
-    vid->vmm.format = VIDEO_PALETTE_RGB24;
+    vid->vmm.format = VIDEO_PALETTE_YUV420P;
 
     vid->video_cont_num = -1;
 
@@ -407,6 +420,8 @@
 
 ARUint8 *ar2VideoGetImage( AR2VideoParamT *vid )
 {
+    ARUint8 *convbuf = (ARUint8 *) malloc(vid->vmm.width * vid->vmm.height * 3);
+
     if(vid->video_cont_num < 0){
         printf("arVideoCapStart has never been called.\n");
         return NULL;
@@ -419,9 +434,17 @@
     vid->video_cont_num = 1 - vid->video_cont_num;
 
     if(vid->video_cont_num == 0)
-        return (vid->map + vid->vm.offsets[1]); 
+    {
+        ccvt_420p_bgr24(vid->vmm.width, vid->vmm.height, vid->map +
+                vid->vm.offsets[0], convbuf);
+        return convbuf; 
+    }
     else
-        return (vid->map + vid->vm.offsets[0]);
+    {
+        ccvt_420p_bgr24(vid->vmm.width, vid->vmm.height, vid->map +
+                vid->vm.offsets[1], convbuf);
+        return convbuf;
+    }
 }
 
 int ar2VideoInqSize(AR2VideoParamT *vid, int *x,int *y)
diff -urNw ARToolKit2.40/util/calib_camera/Makefile.Linux ARToolKit2.40-good/util/calib_camera/Makefile.Linux
--- ARToolKit2.40/util/calib_camera/Makefile.Linux	2001-05-29 08:23:05.000000000 +0200
+++ ARToolKit2.40-good/util/calib_camera/Makefile.Linux	2002-11-21 21:39:51.000000000 +0100
@@ -5,7 +5,7 @@
 CFLAG= -O -I/usr/X11R6/include -I$(INC_DIR)
 LDFLAG= -L/usr/X11R6/lib -L$(LIB_DIR)
 LIBFLAG=
-LIBS= -lAR -lARvideo -lglut -lGLU -lGL -lXmu -lX11 -lXi -lm
+LIBS= -lAR -lARvideo -lglut -lGLU -lGL -lXmu -lX11 -lXi -lm -lccvt
 
 
 all: $(BIN_DIR)/calib_cparam
diff -urNw ARToolKit2.40/util/calib_distortion/Makefile.Linux ARToolKit2.40-good/util/calib_distortion/Makefile.Linux
--- ARToolKit2.40/util/calib_distortion/Makefile.Linux	2001-05-29 08:23:05.000000000 +0200
+++ ARToolKit2.40-good/util/calib_distortion/Makefile.Linux	2002-11-21 21:39:41.000000000 +0100
@@ -5,7 +5,7 @@
 CFLAG= -O -I/usr/X11R6/include -I$(INC_DIR)
 LDFLAG= -L/usr/X11R6/lib -L$(LIB_DIR)
 LIBFLAG= 
-LIBS= -lAR -lARvideo -lglut -lGLU -lGL -lXmu -lX11 -lXi -lm
+LIBS= -lAR -lARvideo -lglut -lGLU -lGL -lXmu -lX11 -lXi -lm -lccvt
 
 
 all: $(BIN_DIR)/calib_dist
diff -urNw ARToolKit2.40/util/mk_patt/Makefile.Linux ARToolKit2.40-good/util/mk_patt/Makefile.Linux
--- ARToolKit2.40/util/mk_patt/Makefile.Linux	2001-05-29 08:23:05.000000000 +0200
+++ ARToolKit2.40-good/util/mk_patt/Makefile.Linux	2002-11-21 21:40:02.000000000 +0100
@@ -5,7 +5,7 @@
 CFLAG= -O -I/usr/X11R6/include -I$(INC_DIR)
 LDFLAG= -L$(LIB_DIR)
 LIBFLAG= -L/usr/X11R6/lib
-LIBS= -lARgsub -lARvideo -lAR -lglut -lGL -lGLU -lXi -lXmu -lX11 -lm
+LIBS= -lARgsub -lARvideo -lAR -lglut -lGL -lGLU -lXi -lXmu -lX11 -lm -lccvt
 
 
 all: $(BIN_DIR)/mk_patt
