Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
chunk_stitching
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 57 lines (50 sloc) 1.25 KB
#!/bin/bash -l
set -e
code_dir=$(dirname "$0")
# Parse command line args
pipeline_args=""
rerun=false
for i in "$@"
do
case $i in
--filter=*)
filter="${i#*=}"
shift
;;
--pipeline-args=*)
pipeline_args="${i#*=}"
shift
;;
--rerun)
rerun=true
shift
;;
esac
done
# Parse local config file
while IFS="=" read -r name value; do
declare "$name=$value"
done < "$HOME/.cuttleline.cfg"
if [[ -z ${outdir+x} ]]; then
$outdir="$dirname/.."
fi
if [[ -z ${filter+x} ]]; then
sepia_dirs=($(ls -d "$sepia_dir"/*))
else
sepia_dirs=($(ls -d "$sepia_dir"/* | grep "$filter"))
fi
for sepia_dir in "${sepia_dirs[@]}"; do
# Get sepia prefix
basename=$(basename "$sepia_dir")
video="$sepia_dir/${basename#*-}".mov
config="$sepia_dir/${basename#*-}".cfg
areas="$outdir/$basename/${basename#*-}".areas
if [[ -f "$video" ]] && [[ -f "$config" ]] \
&& ( [[ ! -f "$areas" ]] \
|| [[ "$areas" -ot "$video" ]] \
|| [[ "$rerun" = true ]] ); then
echo "Processing $video"
echo "$pipeline_args" | xargs "$code_dir"/run_pipeline.sh \
"$video"
fi
done