-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Antonio Roberts
committed
May 21, 2013
1 parent
3a1acc0
commit ca74fd0
Showing
10 changed files
with
538 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
|
||
#Copyright 2013 Antonio Roberts, License: GPL v3+ | ||
|
||
file=$1 | ||
|
||
#make a directory to do the glitching | ||
rand=$RANDOM | ||
mkdir /tmp/temp_$rand | ||
cd /tmp/temp_$rand | ||
|
||
#get bitrate | ||
bitRate=$(avprobe $1 2>&1 | grep bitrate | cut -d ':' -f 6 | sed s/"kb\/s"//) | ||
|
||
#convert the movie to frames | ||
avconv -i $file -b "$bitRate"k out_%d.bmp | ||
|
||
#count the number files in the directory | ||
fileno=$(ls out_*.bmp -1 | wc -l) | ||
|
||
#begin the glitch loop | ||
no=1 | ||
while [ $no -le $fileno ] | ||
do | ||
|
||
convert out_$no.bmp +adjoin -depth 1 -dither FloydSteinberg out_$no.gif | ||
|
||
echo -e "Glitched file $no of $fileno" | ||
|
||
rm out_$no.bmp | ||
|
||
no=`expr $no + 1` | ||
|
||
done | ||
|
||
#combine the images into a video | ||
avconv -i out_%d.gif -b "$bitRate"k "$file"_1bitgif.mkv | ||
|
||
#remove the temporary directory | ||
cd ../ | ||
rm -rf temp_$rand/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
#Copyright 2013 Antonio Roberts, License: GPL v3+ | ||
|
||
file=$1 | ||
|
||
#make a directory to do the glitching | ||
rand=$RANDOM | ||
mkdir /tmp/temp_$rand | ||
cd /tmp/temp_$rand | ||
|
||
#get bitrate | ||
bitRate=$(avprobe $1 2>&1 | grep bitrate | cut -d ':' -f 6 | sed s/"kb\/s"//) | ||
|
||
#convert the movie to frames | ||
avconv -i $file -b "$bitRate"k out_%d.bmp | ||
|
||
#count the number files in the directory | ||
fileno=$(ls out_*.bmp -1 | wc -l) | ||
|
||
#begin the glitch loop | ||
no=1 | ||
while [ $no -le $fileno ] | ||
do | ||
|
||
rand1=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 1) | ||
rand2=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 3) | ||
|
||
#glitch the files | ||
sed -i s/$rand1/$rand2/g out_$no.bmp | ||
|
||
echo -e "Glitched file $no of $fileno" | ||
|
||
no=`expr $no + 1` | ||
|
||
done | ||
|
||
#combine the images into a video | ||
avconv -i out_%d.bmp -b "$bitRate"k "$file"_bmp.mkv | ||
|
||
#remove the temporary directory | ||
cd ../ | ||
rm -rf temp_$rand/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/bin/bash | ||
|
||
#Copyright 2013 Antonio Roberts, License: GPL v3+ | ||
|
||
file=$1 | ||
|
||
#make a directory to do the glitching | ||
rand=$RANDOM | ||
mkdir /tmp/temp_$rand | ||
cd /tmp/temp_$rand | ||
|
||
#get bitrate | ||
bitRate=$(avprobe $1 2>&1 | grep bitrate | cut -d ':' -f 6 | sed s/"kb\/s"//) | ||
|
||
#convert the movie to frames | ||
avconv -i $file -b "$bitRate"k out_%d.bmp | ||
|
||
#count the number files in the directory | ||
fileno=$(ls out_*.bmp -1 | wc -l) | ||
|
||
#begin the glitch loop | ||
no=1 | ||
while [ $no -le $fileno ] | ||
do | ||
|
||
rand1=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 1) | ||
rand2=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 1) | ||
rand3=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 1) | ||
rand4=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 1) | ||
|
||
rand5=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 2) | ||
rand6=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 2) | ||
rand7=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 2) | ||
rand8=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 2) | ||
|
||
convert -colorspace CMYK -separate out_$no.bmp in_%d.bmp | ||
|
||
#glitch the cyan channel | ||
sed -i s/$rand1/$rand5/g in_0.bmp | ||
|
||
#glitch the magenta channel | ||
sed -i s/$rand2/$rand6/g in_1.bmp | ||
|
||
#glitch the yellow channel | ||
sed -i s/$rand3/$rand7/g in_2.bmp | ||
|
||
#glitch the key channel | ||
sed -i s/$rand4/$rand8/g in_3.bmp | ||
|
||
#combine the channels into one image | ||
convert in_0.bmp in_1.bmp in_2.bmp in_3.bmp -set colorspace CMYK -combine out_$no.bmp | ||
|
||
#clear the directory of files | ||
rm in_*.bmp | ||
|
||
echo -e "Glitched file $no of $fileno" | ||
|
||
no=`expr $no + 1` | ||
|
||
done | ||
|
||
#combine the images into a video | ||
avconv -i out_%d.bmp -b "$bitRate"k "$file"_bmpcmyk.mkv | ||
|
||
#remove the temporary directory | ||
cd ../ | ||
rm -rf temp_$rand/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
#Copyright 2013 Antonio Roberts, License: GPL v3+ | ||
|
||
file=$1 | ||
|
||
#make a directory to do the glitching | ||
rand=$RANDOM | ||
mkdir /tmp/temp_$rand | ||
cd /tmp/temp_$rand | ||
|
||
#get bitrate | ||
bitRate=$(avprobe $1 2>&1 | grep bitrate | cut -d ':' -f 6 | sed s/"kb\/s"//) | ||
|
||
#convert the movie to frames | ||
avconv -i $file -b "$bitRate"k out_%d.jpg | ||
|
||
#count the number files in the directory | ||
fileno=$(ls out_*.jpg -1 | wc -l) | ||
|
||
#begin the glitch loop | ||
no=1 | ||
while [ $no -le $fileno ] | ||
do | ||
|
||
rand1=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 1) | ||
rand2=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 1) | ||
|
||
#glitch the files | ||
sed -i s/$rand1/$rand2/g out_$no.jpg | ||
|
||
echo -e "Glitched file $no of $fileno" | ||
|
||
no=`expr $no + 1` | ||
|
||
done | ||
|
||
#combine the images into a video | ||
avconv -i out_%d.jpg -b "$bitRate"k "$file"_jpg.mkv | ||
|
||
#remove the temporary directory | ||
cd ../ | ||
rm -rf temp_$rand/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
#Copyright 2013 Antonio Roberts, License: GPL v3+ | ||
|
||
file=$1 | ||
|
||
#make a directory to do the glitching | ||
rand=$RANDOM | ||
mkdir /tmp/temp_$rand | ||
cd /tmp/temp_$rand | ||
|
||
#get bitrate | ||
bitRate=$(avprobe $1 2>&1 | grep bitrate | cut -d ':' -f 6 | sed s/"kb\/s"//) | ||
|
||
#convert the movie to frames | ||
avconv -i $file -b "$bitRate"k out_%d.pcx | ||
|
||
#count the number files in the directory | ||
fileno=$(ls out_*.pcx -1 | wc -l) | ||
|
||
#begin the glitch loop | ||
no=1 | ||
while [ $no -le $fileno ] | ||
do | ||
|
||
rand1=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 1) | ||
rand2=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 3) | ||
|
||
#glitch the files | ||
sed -i s/$rand1/$rand2/g out_$no.pcx | ||
|
||
echo -e "Glitched file $no of $fileno" | ||
|
||
no=`expr $no + 1` | ||
|
||
done | ||
|
||
#combine the images into a video | ||
avconv -i out_%d.pcx -b "$bitRate"k "$file"_pcx.mkv | ||
|
||
#remove the temporary directory | ||
cd ../ | ||
rm -rf temp_$rand/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/bin/bash | ||
|
||
#Copyright 2013 Antonio Roberts, License: GPL v3+ | ||
|
||
file=$1 | ||
|
||
#make a directory to do the glitching | ||
rand=$RANDOM | ||
mkdir /tmp/temp_$rand | ||
cd /tmp/temp_$rand | ||
|
||
#get bitrate | ||
bitRate=$(avprobe $1 2>&1 | grep bitrate | cut -d ':' -f 6 | sed s/"kb\/s"//) | ||
|
||
#convert the movie to frames | ||
avconv -i $file -b "$bitRate"k out_%d.bmp | ||
|
||
#count the number files in the directory | ||
fileno=$(ls out_*.bmp -1 | wc -l) | ||
|
||
#gimp and imagemagick encode .pix files differently, so we'll go with the one that does it best | ||
echo -e " You may see a lot of error messages here. Don't worry about them" | ||
gimp -n -i -b - <<EOF | ||
(let* ( (file's (cadr (file-glob "*.bmp" 1))) (filename "") (image 0) (layer 0) ) | ||
(while (pair? file's) | ||
(set! image (car (gimp-file-load RUN-NONINTERACTIVE (car file's) (car file's)))) | ||
(set! layer (car (gimp-image-merge-visible-layers image CLIP-TO-IMAGE))) | ||
(set! filename (string-append (substring (car file's) 0 (- (string-length (car file's)) 4)) ".pix")) | ||
(gimp-file-save RUN-NONINTERACTIVE image layer filename filename) | ||
(gimp-image-delete image) | ||
(set! file's (cdr file's)) | ||
) | ||
(gimp-quit 0) | ||
) | ||
EOF | ||
|
||
#begin the glitch loop | ||
no=1 | ||
while [ $no -le $fileno ] | ||
do | ||
|
||
rand1=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 2) | ||
rand2=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 1) | ||
|
||
#glitch the files | ||
|
||
sed -i s/$rand1/$rand2/g out_$no.pix | ||
|
||
echo -e "Glitched file $no of $fileno" | ||
|
||
no=`expr $no + 1` | ||
|
||
done | ||
|
||
#gimp and imagemagick encode .pix files differently, so we'll go with the one that does it best | ||
echo -e "You may see a lot of error messages here. Don't worry about them" | ||
gimp -n -i -b - <<EOF | ||
(let* ( (file's (cadr (file-glob "*.pix" 1))) (filename "") (image 0) (layer 0) ) | ||
(while (pair? file's) | ||
(set! image (car (gimp-file-load RUN-NONINTERACTIVE (car file's) (car file's)))) | ||
(set! layer (car (gimp-image-merge-visible-layers image CLIP-TO-IMAGE))) | ||
(set! filename (string-append (substring (car file's) 0 (- (string-length (car file's)) 4)) ".bmp")) | ||
(gimp-file-save RUN-NONINTERACTIVE image layer filename filename) | ||
(gimp-image-delete image) | ||
(set! file's (cdr file's)) | ||
) | ||
(gimp-quit 0) | ||
) | ||
EOF | ||
|
||
rm out_*.pix | ||
|
||
#combine the images into a video | ||
avconv -i out_%d.bmp -b "$bitRate"k "$file"_pix.mkv | ||
|
||
#remove the temporary directory | ||
cd ../ | ||
rm -rf temp_$rand/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
#Copyright 2013 Antonio Roberts, License: GPL v3+ | ||
|
||
file=$1 | ||
|
||
#make a directory to do the glitching | ||
rand=$RANDOM | ||
mkdir /tmp/temp_$rand | ||
cd /tmp/temp_$rand | ||
|
||
#get bitrate | ||
bitRate=$(avprobe $1 2>&1 | grep bitrate | cut -d ':' -f 6 | sed s/"kb\/s"//) | ||
|
||
#convert the movie to frames | ||
avconv -i $file -b "$bitRate"k out_%d.ppm | ||
|
||
#count the number files in the directory | ||
fileno=$(ls out_*.ppm -1 | wc -l) | ||
|
||
#begin the glitch loop | ||
no=1 | ||
while [ $no -le $fileno ] | ||
do | ||
|
||
#glitch the files | ||
sed -i s/P6/P5/ out_$no.ppm | ||
|
||
echo -e "Glitched file $no of $fileno" | ||
|
||
no=`expr $no + 1` | ||
|
||
done | ||
|
||
#combine the images into a video | ||
avconv -i out_%d.ppm -b "$bitRate"k "$file"_ppm.mkv | ||
|
||
#remove the temporary directory | ||
cd ../ | ||
rm -rf temp_$rand/ |
Oops, something went wrong.