Saturday, 1 March 2014

Fixing vidwhacker xscreensaver to successfully grab video from webcam

(Fedora 20)

Firstly ensure that you have the following packages installed:

yum install flumotion netpbm-* xawtv words libjpeg-turbo-utils

Unfortunately, vidwhacker doesn't call xscreensaver-getimage-video correctly. Happily, vidwhacker is a simple perl script, so it can simply be edited using your favourite editor.

This can be fixed by making the following changes:

 $cmd = "xscreensaver-getimage-video $v --stdout";  (line 319)
$cmd = "xscreensaver-getimage-video";

and, after,
$ppm = `$cmd`;  (line 356)
$ppm = `cat $ppm`;

I'm not saying this is particularly elegant as a fix, but it'll get it going.

If you would like vidwhacker only to grab images from the webcam (instead of sometimes searching your files directory as well), make the following change:

   #$do_file_p = (int(rand(2)) == 0);  (line 303)
  $do_file_p = 0;

No comments: