#!/usr/bin/perl my $nbrefichiers=0; my $nbredepassage=10; my $nombre=10000; my $j=100000; my $i=0; my $l=0; my @chars = split(" ","a b c d e f g h i j k l m n o"); my $dureedufilm=30; sub mkdirtmp{ `mkdir ./$_[0]`; } sub deldirtmp{ `rm -rf ./$_[0]/`; } sub lswc{ $nbrefichiers=`ls -la ./$_[0]/*.jpg | wc -l`; } sub primo{ `ffmpeg -i $ARGV[0] -ss $_[0] -t $_[1] ./$_[3]/$_[2]-%d.jpg`; } sub rename{ my $k=100000; while (<./$_[0]/*.jpg>) { `mv $_ ./$_[0]/image-$k.jpg `; $k++; } } sub buggy2{ $count=int(rand($nombre)); `dd if=./$_[2]/image-$_[0].jpg of=./$_[3]/image-$_[1].jpg bs=1c count=$count`; $decalage=int(rand(2)); $decalage+=$count; `dd if=./$_[2]/image-$_[0].jpg of=./$_[3]/image-$_[1].jpg bs=1c skip=$count seek=$decalage`; } sub fmpeg{ `ffmpeg -f image2 -i ./$_[0]/image-%d.jpg -vcodec libxvid -vtag XVID -s 640x480 -aspect 4:3 -maxrate 1800kb -b 1500kb -qmin 3 -qmax 5 -bufsize 4096 -mbd 2 -bf 2 -flags +4mv -trellis -aic -cmp 2 -subcmp 2 -g 300 "fmpeg-$_[1].avi"`; } sub mencoder{ `mencoder mf://./$_[0]/*.jpg -mf w=800:h=600:fps=25:type=jpeg -ovc lavc -lavcopts vcodec=mpeg4 -oac copy -o mencoder-$_[1].avi`; } sub magick{ while (<./$_[0]/*.jpg>) { my $count=int(rand(35)); if($count==1){my $x=int(rand(10))."x".int(rand(10));`convert -blur $x $_ $_`;} elsif($count==2){my $x=int(rand(100))."x".int(rand(100)); my $y="\'rgb(".int(rand(256)).",".int(rand(256)).",".int(rand(256)).")\'";`convert -bordercolor $y -border $x $_ $_`} elsif($count==3){my $x=int(rand(100))."x".int(rand(100))."+".int(rand(100))."+".int(rand(100));my $y="\'rgb(".int(rand(256)).",".int(rand(256)).",".int(rand(256)).")\'";`convert -background $y -splice $x $_ $_`} elsif($count==4){`convert +dither -colors 8 $_ $_ `} elsif($count==5){`convert -monochrome $_ $_`} elsif($count==6){my $x=int(rand(10));`convert +dither -posterize $x $_ $_`} elsif($count==7){my $x=int(rand(100))."%";`convert -threshold $x $_ $_`} elsif($count==8){`convert -ordered-dither o4x4 $_ $_`} elsif($count==9){my $x=int(rand(10));`convert -paint $x $_ $_`} elsif($count==10){` convert -scale 10% -scale 1000% $_ $_`} else{} } } &mkdirtmp(tmp); &primo(0,3,z,tmp); while($l<$nbredepassage) { my $start=int(rand($dureedufilm)); my $dureedelaboucle=int(rand(4)); &primo($start,$dureedelaboucle,$chars[$l],tmp); $l++; } &rename(tmp); &lswc(tmp); &magick(tmp); &mkdirtmp(tm2); while($i<=$nbrefichiers) { &buggy2($j,$i,tmp,tm2); $i++; $j++; } my ($sec,$min,$hour) = localtime(time); my $date = $sec."-".$min."-".($hour); &fmpeg(tm2,$date); #&mencoder(tm2,$date); &deldirtmp(tmp); &deldirtmp(tm2);