Skip to content

Commit

Permalink
change to 4-space indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dericed committed Apr 24, 2013
1 parent af4278c commit 498f267
Show file tree
Hide file tree
Showing 22 changed files with 1,117 additions and 1,118 deletions.
67 changes: 33 additions & 34 deletions barcodeinterpret
Original file line number Diff line number Diff line change
Expand Up @@ -5,58 +5,57 @@ scriptdir=`dirname "$0"`
. "$scriptdir/mmfunctions" || { echo "Missing '$scriptdir/mmfunctions'. Exiting." ; exit 1 ;};

cleanup(){
log -a "Process aborted"
exit 1
log -a "Process aborted"
exit 1
}

trap cleanup SIGHUP SIGINT SIGTERM
log -b

if test $# != 1
then
echo "You must supply one argument, a scanned interleaved 2/5 barcode value"; exit
if test $# != 1 ; then
echo "You must supply one argument, a scanned interleaved 2/5 barcode value"; exit
fi

barcode="$1"

translatebyte()
{
val=`echo $1 | echo $(cut -c $2-$3) + 32 | bc`
if [ "$val" = 131 ] ; then
echo 9 | awk '{printf("%c", $0);}'
else
echo $val | awk '{printf("%c", $0);}'
fi
val=`echo $1 | echo $(cut -c $2-$3) + 32 | bc`
if [ "$val" = 131 ] ; then
echo 9 | awk '{printf("%c", $0);}'
else
echo $val | awk '{printf("%c", $0);}'
fi
}
addcolons()
{
echo $(echo $1 | cut -c 1-2):$(echo $1 | cut -c 3-4):$(echo $1 | cut -c 5-6):$(echo $1 | cut -c 7-8)
echo $(echo $1 | cut -c 1-2):$(echo $1 | cut -c 3-4):$(echo $1 | cut -c 5-6):$(echo $1 | cut -c 7-8)
}

get_ids()
{
barcode=$1
c00=`translatebyte $barcode 2 3`
c01=`translatebyte $barcode 4 5`
c02=`translatebyte $barcode 6 7`
c03=`translatebyte $barcode 8 9`
c04=`translatebyte $barcode 10 11`
c05=`translatebyte $barcode 12 13`
c06=`translatebyte $barcode 14 15`
c07=`translatebyte $barcode 16 17`
c08=`translatebyte $barcode 18 19`
c09=`translatebyte $barcode 20 21`
c10=`translatebyte $barcode 22 23`
c11=`translatebyte $barcode 24 25`
c12=`translatebyte $barcode 26 27`
c13=`translatebyte $barcode 28 29`
c14=`translatebyte $barcode 30 31`
c15=`translatebyte $barcode 32 33`
c16=`translatebyte $barcode 34 35`
c17=`translatebyte $barcode 36 37`
c18=`translatebyte $barcode 38 39`
c19=`translatebyte $barcode 40 41`
echo $c00$c01$c02$c03$c04$c05$c06$c07$c08$c09$c10$c11$c12$c13$c14$c15$c16$c17$c18$c19
barcode=$1
c00=`translatebyte $barcode 2 3`
c01=`translatebyte $barcode 4 5`
c02=`translatebyte $barcode 6 7`
c03=`translatebyte $barcode 8 9`
c04=`translatebyte $barcode 10 11`
c05=`translatebyte $barcode 12 13`
c06=`translatebyte $barcode 14 15`
c07=`translatebyte $barcode 16 17`
c08=`translatebyte $barcode 18 19`
c09=`translatebyte $barcode 20 21`
c10=`translatebyte $barcode 22 23`
c11=`translatebyte $barcode 24 25`
c12=`translatebyte $barcode 26 27`
c13=`translatebyte $barcode 28 29`
c14=`translatebyte $barcode 30 31`
c15=`translatebyte $barcode 32 33`
c16=`translatebyte $barcode 34 35`
c17=`translatebyte $barcode 36 37`
c18=`translatebyte $barcode 38 39`
c19=`translatebyte $barcode 40 41`
echo $c00$c01$c02$c03$c04$c05$c06$c07$c08$c09$c10$c11$c12$c13$c14$c15$c16$c17$c18$c19
}

ids=`get_ids $barcode`
Expand Down
12 changes: 6 additions & 6 deletions blackatends
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ scriptdir=`dirname "$0"`
. "$scriptdir/mmfunctions" || { echo "Missing '$scriptdir/mmfunctions'. Exiting." ; exit 1 ;};

cleanup(){
log -a "Process aborted"
exit 1
log -a "Process aborted"
exit 1
}

trap cleanup SIGHUP SIGINT SIGTERM
Expand All @@ -15,9 +15,9 @@ log -b
[ "$#" = 0 ] && { ask_input ; once="y" ;};

while [ "$*" != "" -o "$once" = "y" ] ; do
once="n"
[ "$#" != 0 ] && sourcefile="$1"
black_at_ends "$sourcefile"
shift
once="n"
[ "$#" != 0 ] && sourcefile="$1"
black_at_ends "$sourcefile"
shift
done
log -e
50 changes: 25 additions & 25 deletions checksumpackage
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ scriptdir=`dirname "$0"`
. "$scriptdir/mmfunctions" || { echo "Missing '$scriptdir/mmfunctions'. Exiting." ; exit 1 ;};

cleanup(){
log -a "Process aborted"
exit 1
log -a "Process aborted"
exit 1
}

trap cleanup SIGHUP SIGINT SIGTERM
Expand All @@ -22,28 +22,28 @@ CHECKSUMNAME="checksum.md5"
DFXMLNAME="dfxml.xml"

while [ "$*" != "" ] ; do
if [ -d "$1" ] ; then
pwd=`pwd`
"$scriptdir/removeDSStore" "$1"
if [ ! -s "${1}/metadata/$CHECKSUMNAME" -o ! -s "${1}/$CHECKSUMNAME" ] ; then
report -dt "making Digital Forensics XML (${DFXMLNAME}) and $CHECKSUMNAME for ${1}"
cd "$1"
if [ -d objects ] ; then
md5deep -drl objects > "metadata/$DFXMLNAME"
xml sel -T -t -m "/dfxml/fileobject" -v "hashdigest" -o " " -v "ctime" -o " " -v "filename" -n "metadata/$DFXMLNAME" > "metadata/$CHECKSUMNAME"
else
maketemp
md5deep -drl . > $TMPFILE
mv $TMPFILE "$DFXMLNAME"
xml sel -T -t -m "/dfxml/fileobject" -v "hashdigest" -o " " -v "ctime" -o " " -v "filename" -n "$DFXMLNAME" > "$CHECKSUMNAME"
fi
cd "$pwd"
else
report -dt "${CHECKSUMNAME} already exists, skipping for ${1}"
fi
else
report -dt "ERROR: $0 requires directories as input and $1 is not a directory."
fi
shift
if [ -d "$1" ] ; then
pwd=`pwd`
"$scriptdir/removeDSStore" "$1"
if [ ! -s "${1}/metadata/$CHECKSUMNAME" -o ! -s "${1}/$CHECKSUMNAME" ] ; then
report -dt "making Digital Forensics XML (${DFXMLNAME}) and $CHECKSUMNAME for ${1}"
cd "$1"
if [ -d objects ] ; then
md5deep -drl objects > "metadata/$DFXMLNAME"
xml sel -T -t -m "/dfxml/fileobject" -v "hashdigest" -o " " -v "ctime" -o " " -v "filename" -n "metadata/$DFXMLNAME" > "metadata/$CHECKSUMNAME"
else
maketemp
md5deep -drl . > $TMPFILE
mv $TMPFILE "$DFXMLNAME"
xml sel -T -t -m "/dfxml/fileobject" -v "hashdigest" -o " " -v "ctime" -o " " -v "filename" -n "$DFXMLNAME" > "$CHECKSUMNAME"
fi
cd "$pwd"
else
report -dt "${CHECKSUMNAME} already exists, skipping for ${1}"
fi
else
report -dt "ERROR: $0 requires directories as input and $1 is not a directory."
fi
shift
done
log -e
34 changes: 17 additions & 17 deletions fix_left2stereo
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ scriptdir=`dirname "$0"`
. "$scriptdir/mmfunctions" || { echo "Missing '$scriptdir/mmfunctions'. Exiting." ; exit 1 ;};

cleanup(){
log -a "Process aborted"
exit 1
log -a "Process aborted"
exit 1
}

trap cleanup SIGHUP SIGINT SIGTERM
Expand All @@ -15,27 +15,27 @@ log -b
suffix="_left2stereo"

if test $# != 1 ; then
report -wt "You must supply one argument. Refer to a file after calling the `basename $0` script."; exit
report -wt "You must supply one argument. Refer to a file after calling the `basename $0` script."; exit
fi

while [ "$*" != "" ] ; do

input_movie="$1"
name=`basename "$1"`
input_movie="$1"
name=`basename "$1"`

codec_tag_string=`ffprobe -show_streams -print_format compact "$input_movie" 2>/dev/null| grep codec_type=video | grep -o "codec_tag_string=[^|]*" | cut -d= -f2`
codec_tag_string=`ffprobe -show_streams -print_format compact "$input_movie" 2>/dev/null| grep codec_type=video | grep -o "codec_tag_string=[^|]*" | cut -d= -f2`

[ "$codec_tag_string" = "mpeg" ] && { ffmpeg_opts+=" -c:v copy -c:a pcm_s24le " ; extension="mxf" ; } ;
[ "$codec_tag_string" = "mpeg" ] || { ffmpeg_opts+=" -c:v copy -c:a pcm_s24le " ; extension="mov" ; } ;
[ "$codec_tag_string" = "mpeg" ] && { ffmpeg_opts+=" -c:v copy -c:a pcm_s24le " ; extension="mxf" ; } ;
[ "$codec_tag_string" = "mpeg" ] || { ffmpeg_opts+=" -c:v copy -c:a pcm_s24le " ; extension="mov" ; } ;

if [ -f "${input_movie%.*}${suffix}.${extension}" ] ; then
report -wt "The intended output of `basename $0` already exists. Skipping for now. Please delete \"${input_movie%.*}${suffix}.${extension}\" and rerun or figure out why you are trying to do this."
else
cmd="ffmpeg -i '$input_movie' $ffmpeg_opts -filter pan=stereo:c0=c0:c1=c0 '${input_movie%.*}${suffix}.${extension}'"
echo "$cmd"
eval "$cmd"
report -dt " `basename $0` is done with ${name}."
fi
shift
if [ -f "${input_movie%.*}${suffix}.${extension}" ] ; then
report -wt "The intended output of `basename $0` already exists. Skipping for now. Please delete \"${input_movie%.*}${suffix}.${extension}\" and rerun or figure out why you are trying to do this."
else
cmd="ffmpeg -i '$input_movie' $ffmpeg_opts -filter pan=stereo:c0=c0:c1=c0 '${input_movie%.*}${suffix}.${extension}'"
echo "$cmd"
eval "$cmd"
report -dt " `basename $0` is done with ${name}."
fi
shift
done
log -e
34 changes: 17 additions & 17 deletions fix_rewrap
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,35 @@ scriptdir=`dirname "$0"`
. "$scriptdir/mmfunctions" || { echo "Missing '$scriptdir/mmfunctions'. Exiting." ; exit 1 ;};

cleanup(){
log -a "Process aborted"
exit 1
log -a "Process aborted"
exit 1
}

trap cleanup SIGHUP SIGINT SIGTERM
log -b

if test $# != 1 ; then
report -wt "You must supply one argument. Refer to a file after calling the `basename $0` script."; exit
report -wt "You must supply one argument. Refer to a file after calling the `basename $0` script."; exit
fi

while [ "$*" != "" ] ; do

input_movie="$1"
name=`basename "$1"`
input_movie="$1"
name=`basename "$1"`

codec_tag_string=`ffprobe -show_streams -print_format compact "$input_movie" 2>/dev/null| grep codec_type=video | grep -o "codec_tag_string=[^|]*" | cut -d= -f2`
codec_tag_string=`ffprobe -show_streams -print_format compact "$input_movie" 2>/dev/null| grep codec_type=video | grep -o "codec_tag_string=[^|]*" | cut -d= -f2`

[ "$codec_tag_string" = "mpeg" ] && { ffmpeg_opts+=" -c:v copy -c:a pcm_s24le " ; extension="mxf" ; } ;
[ "$codec_tag_string" = "mpeg" ] || { ffmpeg_opts+=" -c:v copy -c:a pcm_s24le " ; extension="mov" ; } ;
[ "$codec_tag_string" = "mpeg" ] && { ffmpeg_opts+=" -c:v copy -c:a pcm_s24le " ; extension="mxf" ; } ;
[ "$codec_tag_string" = "mpeg" ] || { ffmpeg_opts+=" -c:v copy -c:a pcm_s24le " ; extension="mov" ; } ;

if [ -f "${input_movie%.*}_voladj.${extension}" ] ; then
report -wt "The intended output of `basename $0` already exists. Skipping for now. Please delete \"${input_movie%.*}_rewrap.${extension}\" and rerun or figure out why you are trying to do this."
else
report -dt "Generating '${input_movie%.*}_rewrap.${extension}' ..."
cmd="ffmbc -i '$input_movie' -vcodec copy -acodec copy '${input_movie%.*}_rewrap.${extension}'"
eval "$cmd"
report -dt " `basename $0` is done with ${name}."
fi
shift
if [ -f "${input_movie%.*}_voladj.${extension}" ] ; then
report -wt "The intended output of `basename $0` already exists. Skipping for now. Please delete \"${input_movie%.*}_rewrap.${extension}\" and rerun or figure out why you are trying to do this."
else
report -dt "Generating '${input_movie%.*}_rewrap.${extension}' ..."
cmd="ffmbc -i '$input_movie' -vcodec copy -acodec copy '${input_movie%.*}_rewrap.${extension}'"
eval "$cmd"
report -dt " `basename $0` is done with ${name}."
fi
shift
done
log -e
52 changes: 26 additions & 26 deletions fix_volume
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ scriptdir=`dirname "$0"`
. "$scriptdir/mmfunctions" || { echo "Missing '$scriptdir/mmfunctions'. Exiting." ; exit 1 ;};

cleanup(){
log -a "Process aborted"
exit 1
log -a "Process aborted"
exit 1
}

trap cleanup SIGHUP SIGINT SIGTERM
Expand All @@ -18,29 +18,29 @@ log -b
[ $# = 0 ] && { report -wt "You must supply one or many arguments. Usage: $(basename $0) [ file1 file2 ... ] ."; exit 2 ;};

while [ "$*" != "" ] ; do
input_movie="$1"
name=`basename "$1"`
get_codectagstring
#[ "$codec_tag_string" = "mpeg" ] && { ffmpeg_opts+=" -c:v copy -c:a pcm_s24le" ; extension="mxf" ; } ;
#[ "$codec_tag_string" = "mpeg" ] || { ffmpeg_opts+=" -c:v copy -c:a pcm_s24le" ; extension="mov" ; } ;
[ "$codec_tag_string" = "mpeg" ] && { ffmpeg_opts+=" -c:a pcm_s24le -f s24le -ar 48000 -ac 2 " ; ffmbc_opts=" -vcodec copy -f s24le -ar 48000 -ac 2 -map_audio_channel 1:0:0:0:1:0 -map_audio_channel 1:0:1:0:1:1 " ; extension="mxf" ; } ;
[ "$codec_tag_string" = "mpeg" ] || { ffmpeg_opts+=" -c:a pcm_s24le -f s24le -ar 48000 -ac 2 " ; ffmbc_opts=" -vcodec copy -f s24le -ar 48000 -ac 2 -map_audio_channel 1:0:0:0:1:0 -map_audio_channel 1:0:1:0:1:1 " ; extension="mov" ; } ;
output_movie="${input_movie%.*}${suffix}.${extension}"
if [ -f "$output_movie" ] ; then
report -wt "The intended output of `basename $0` already exists. Skipping for now. Please delete \"$output_movie\" and rerun or figure out why you are trying to do this."
else
get_volume_adjustment "$input_movie"
if [ -n "$VOLADJ" ] ; then
report -dt "Generating $output_movie ..."
#cmd="ffmpeg -i \"$input_movie\" $ffmpeg_opts -af volume=${VOLADJ}dB '$output_movie'"
cmd="ffmpeg -i \"$input_movie\" $ffmpeg_opts -af volume=${VOLADJ}dB - | ffmbc -i \"$input_movie\" $ffmbc_opts -i pipe:0 -acodec pcm_s24le \"$output_movie\""
report -dt "Running: $cmd"
eval "$cmd"
report -dst "Done with ${name}."
else
report -dst "Integrated loudness for $name is ${integrated_loudness}dB. Reference is $reference. No adjustment is needed for ${name}, skipping."
fi
fi
shift
input_movie="$1"
name=`basename "$1"`
get_codectagstring
#[ "$codec_tag_string" = "mpeg" ] && { ffmpeg_opts+=" -c:v copy -c:a pcm_s24le" ; extension="mxf" ; } ;
#[ "$codec_tag_string" = "mpeg" ] || { ffmpeg_opts+=" -c:v copy -c:a pcm_s24le" ; extension="mov" ; } ;
[ "$codec_tag_string" = "mpeg" ] && { ffmpeg_opts+=" -c:a pcm_s24le -f s24le -ar 48000 -ac 2 " ; ffmbc_opts=" -vcodec copy -f s24le -ar 48000 -ac 2 -map_audio_channel 1:0:0:0:1:0 -map_audio_channel 1:0:1:0:1:1 " ; extension="mxf" ; } ;
[ "$codec_tag_string" = "mpeg" ] || { ffmpeg_opts+=" -c:a pcm_s24le -f s24le -ar 48000 -ac 2 " ; ffmbc_opts=" -vcodec copy -f s24le -ar 48000 -ac 2 -map_audio_channel 1:0:0:0:1:0 -map_audio_channel 1:0:1:0:1:1 " ; extension="mov" ; } ;
output_movie="${input_movie%.*}${suffix}.${extension}"
if [ -f "$output_movie" ] ; then
report -wt "The intended output of `basename $0` already exists. Skipping for now. Please delete \"$output_movie\" and rerun or figure out why you are trying to do this."
else
get_volume_adjustment "$input_movie"
if [ -n "$VOLADJ" ] ; then
report -dt "Generating $output_movie ..."
#cmd="ffmpeg -i \"$input_movie\" $ffmpeg_opts -af volume=${VOLADJ}dB '$output_movie'"
cmd="ffmpeg -i \"$input_movie\" $ffmpeg_opts -af volume=${VOLADJ}dB - | ffmbc -i \"$input_movie\" $ffmbc_opts -i pipe:0 -acodec pcm_s24le \"$output_movie\""
report -dt "Running: $cmd"
eval "$cmd"
report -dst "Done with ${name}."
else
report -dst "Integrated loudness for $name is ${integrated_loudness}dB. Reference is $reference. No adjustment is needed for ${name}, skipping."
fi
fi
shift
done
log -e
Loading

0 comments on commit 498f267

Please sign in to comment.