= Veejay's Uses = == Live Cinema == The first LiveCinema gig was done by wiring video4linux capture cards , now we send video over a high bandwith network (min. 100mbit) http://veejay.sourceforge.net/livecinema.png == Interoperability with other applications == With sendVIMS for PD you can wire veejay into your PD patch http://veejay.sourceforge.net/pd.png Applications that support the [http://www.cnmat.berkeley.edu/OpenSoundControl/ Open Sound Control] can be used to trigger actions in Veejay. Currently only VIMS provides full duplex communication (see Roadmap) == Scriptability == Veejay can be controlled from (perl,shell,...) scripts using the commandline 'sayVIMS' tool, or using the 'sendOSC' utility. Both are included in veejay source. The following script animates a 'picture in picture' effect to make it bounce in a random way. make two streams ( I used two v4l streams) and switch to stream 2 to watch the effect. script can be used for both osc and vims by toggling a setting. {{{ I AM NOT A VERY EXPERIENCED PERL PROGRAMMER!!! - Matthijs }}} {{{ #!/usr/bin/perl use warnings; use strict; use POSIX; use Time::HiRes qw( usleep ualarm gettimeofday tv_interval nanosleep ); ######################################################### # # # # Moves a picture in picture effect over the video # # in a random way. wobbling is also done. # # nothing fancy. # # # # MVH2006 - cola@looze.net # ######################################################### my $osc = 0; # send messages using osc or VIMS? # for VIMS: my $cmd = "| sayVIMS -h localhost -p 3490"; if($osc){ # For OSC: print STDOUT "Using OSC\n"; $cmd = "| sendOSC -h localhost 3492"; } my $chainentry = 5; # wich chain entry to use my $width = 176; # initial size of the square my $height = 144; my $speed = 120; # movement speed: higher is slower my $wobble = 100; # wobble: wobble at random my $xvideo = 352; # width of video my $yvideo = 288; # height of video my $x = 1; # start coordinates my $y = 1; my $debug = "0"; my $once = 0; my $count = 0; sub info{ my $send = shift; if($debug){ print STDOUT $send;} } sub setup_chain{ my $send = 0; # color enhance 164 $send = "361:0 3 164 0 - 100;\n"; # LumaKey 205 $send = "$send 361:0 7 205 255 0 47 1 0;\n"; # Cartoon 161 $send = "$send 361:0 9 161 64 128 196;\n"; # Amplify Low Noise 134 $send = "$send 361:0 11 134 2 1936;\n"; info($send); print VJ $send; } sub open_v4l{ # 240:0 1; open(VJ, $cmd); select(VJ); $| = 1; # disable buffering my $send = "240:0 1;\n"; if($osc){ $send="/entry/select $chainentry\n/stream/new/v4l 0 1\n"; } print VJ $send; info($send); close(VJ); } sub reach{ my $x = shift; my $y = shift; my $dx = shift; my $dy = shift; if(abs($dx-$x)<3){ if(abs($dy-$y)<3){ return 1; } } return 0; } sub move{ my $x = ceil(shift); my $y = ceil(shift); my $w = ceil(shift); my $h = ceil(shift); my $send = "361:0 $chainentry 239 $w $h $x $y;\n368:0 5 1 1;\n"; if($osc){ $send = "/entry/preset 239 $w $h $x $y 2 1\n"; if($once){ $send = "$send/entry/source 1\n"; $once = 0; } } print VJ $send; info($send); usleep(40000); } { # static variables destinations my $oldw = $width; my $oldh = $height; my $max_wobble = $wobble; my $dir = 1; sub wobble{ my $w = shift; my $h = shift; $w = $w+$dir; $h = $h+$dir; if($h >= ($oldh+$wobble)){ $dir = int -1*(rand(8)); # $max_wobble = rand($wobble); } if($h <= $oldh){ $dir = int rand(8); } return $w, $h; }} sub newxy{ my $x = shift; my $y = shift; if(($x <= 2) || ($x >= $xvideo-$width-1)){ $x = 1 + int rand($xvideo-$width-1); if(rand(2) < 1){ $y = $yvideo-$height; } else { $y = 1; } } else{ $y = 1 + int rand($yvideo-$height-1); if(rand(2) < 1){ $x = $xvideo-$width; } else{ $x = 1; } } return $x, $y; } #open_v4l(); #sleep(5); while(1){ # print STDOUT ("start loop\n"); my($dx, $dy) = newxy($x, $y); # destination XY my $oldx = $x; my $oldy = $y; my $dest = 0; open(VJ, $cmd); select(VJ); $| = 1; # disable buffering while(!$dest){ $x = $x + ($dx - $oldx)/$speed; $y = $y + ($dy - $oldy)/$speed; $dest = reach($x, $y, $dx, $dy); move($x, $y, $width, $height); # setup_chain(); if($wobble){ ($width, $height) = wobble($width, $height); } } close(VJ); } }}}