Commit e46c9660 authored by Richard Torenvliet's avatar Richard Torenvliet

Initial commit

parents
#!/bin/bash
if [ $# -lt 2 ]; then
echo "missing arguments:"
echo "usage $0 <video> <options>"
exit 1
fi
video=$1
output_video=$2
echo "output_video" $2
#options=$2
base=$(basename "$output_video")
extension="${base##*.}"
base_filename="${base%.*}"
transform_file="converted/$base_filename.trf"
output_merged="converted/$base_filename-stb$opts-merged.$extension"
echo "ffmpeg -i $video $options -vf vidstabdetect=shakiness=8:accuracy=15:result=$transform_file -f null -"
echo "Options"
echo $options
echo "==="
if [ -z "$options" ]; then
echo "No time limit"
ffmpeg -y -i $video -vf vidstabdetect=shakiness=5:accuracy=15:result=$transform_file -f null -
ffmpeg -y -i $video -vf \
vidstabtransform=smoothing=5:interpol=bicubic:input=$transform_file,unsharp=5:5:0.8:3:3:0.4 $output_video
ffmpeg -y -i $video -i $output_video -filter_complex "[0:v:0]pad=iw*2:ih[bg]; [bg][1:v:0]overlay=w" $output_merged
fi
if [ -n "$options" ]; then
echo "Time limit"
ffmpeg -y -i $video $options -vf vidstabdetect=shakiness=5:accuracy=15:result=$transform_file -f null -
ffmpeg -y -i $video $options -vf \
vidstabtransform=smoothing=5:interpol=bicubic:input=$transform_file,unsharp=5:5:0.8:3:3:0.4 $output_video
ffmpeg -y $options -i $video -i $output_video -filter_complex "[0:v:0]pad=iw*2:ih[bg]; [bg][1:v:0]overlay=w" $output_merged
fi
converted/%.MOV:
./convert.sh $(VIDEO) $@ "$(OPTIONS)"
#!/bin/bash
if [ $# -ne 1 ]; then
echo "missing arguments:"
echo "usage $0 <list>"
exit 1
fi
tmpIFS=$IFS
while IFS='' read -r var
do
video=`echo "$var" | cut -f1 -d ','`
video=`echo $video | sed 's/,//g'`
options=`echo "$var" | cut -f2 -d ','`
base=$(basename "$video")
extension="${base##*.}"
base_filename="${base%.*}"
transform_file="converted/$base_filename.trf"
opts=$(echo $options | sed 's/\ //g')
opts=$(echo $opts| sed 's/:/-/g')
opts=$(echo $opts| sed 's/\"//g')
output_video="converted/$base_filename-stb$opts.$extension"
output_merged="converted/$base_filename-stb$opts-merged.$extension"
#echo $output_video
echo $video
original_video=$(echo $output_video| sed 's/\(.*\)\(-stb.*\)\(.MOV$\)/\1\3/g')
#echo $derp
echo $tmpIFS
IFS=$tmpIFS
if [ -z "$options" ]; then
VIDEO=$video make $output_video ;
fi
if [ -n "$options" ]; then
VIDEO=$video OPTIONS=$options make $output_video ;
fi
done < "$1"
# for t in $ALL_TARGETS; do IFS=" " ;
# video=`echo $$t | cut -f1 -d ','`
# options=`echo $$t | cut -f2 -d ','`
# base=`basename $video`
# extension=MOV
# base_filename=`echo $base | sed 's/.MOV//g'`
# transform_file="converted/$base_filename.trf"
# opts=`echo $options | sed 's/\ //g'`
# opts=`echo $opts | sed 's/:/-/g'`
# output_video="$base_filename-stb$opts.$extension"
# output_merged="$base_filename-stb$opts-merged.$extension"
# #MOVIE=echo $t | cut -f1 -d ',' "OPT=${echo $t | cut -f2 -d ','}" make $output_video
# done
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment