aboutsummaryrefslogtreecommitdiffstats
path: root/.config/init/funcs/make-gif
diff options
context:
space:
mode:
authorkatherine <shmibs@shmibbles.me>2017-03-24 00:20:46 -0700
committerkatherine <shmibs@shmibbles.me>2017-03-24 00:20:46 -0700
commita967cccde337d8068358c6c6f136cc462e9299c4 (patch)
tree4223dbb6099b7bb3d43beac637a632792a0e1007 /.config/init/funcs/make-gif
parent1bcec25cae5ce17f31c02c48426020a6643b9867 (diff)
downloaddotfiles-a967cccde337d8068358c6c6f136cc462e9299c4.tar.gz
fix symlink creation
Diffstat (limited to '.config/init/funcs/make-gif')
-rwxr-xr-x.config/init/funcs/make-gif12
1 files changed, 7 insertions, 5 deletions
diff --git a/.config/init/funcs/make-gif b/.config/init/funcs/make-gif
index 597f799..320a4a0 100755
--- a/.config/init/funcs/make-gif
+++ b/.config/init/funcs/make-gif
@@ -146,7 +146,7 @@ while [[ -f "${tmp_pref}-palette.png" ]] || [[ -f "${tmp_pref}-in" ]]; do
tmp_pref="${tmp_pref}-1"
done
-ln -s "$1" "${tmp_pref}-in" \
+ln -s "${1:a}" "${tmp_pref}-in" \
|| abort "could not write to output dir"
# get output height using aspect ratio
@@ -162,24 +162,26 @@ ffprobe -loglevel -8 -print_format json -show_streams "${tmp_pref}-in" \
# convert
if [[ $subs ]]; then
echo "pass 1..."
- ffmpeg -loglevel 16 -y -ss $start $t $length -i "$1" -copyts \
+ ffmpeg -loglevel 16 -y -ss $start $t $length -i "${tmp_pref}-in" -copyts \
-vf "subtitles=${tmp_pref}-in:si=$strack,setsar=1/1,fps=$fps,scale=${width}:${height}:flags=lanczos,palettegen" \
${tmp_pref}-palette.png
[[ $? -ne 0 ]] && fferr=true
[[ ! $fferr ]] && echo "pass 2..." && ffmpeg -loglevel 24 \
- -ss $start $t $length -i "$1" -i ${tmp_pref}-palette.png \
+ -ss $start $t $length \
+ -i "${tmp_pref}-in" -i ${tmp_pref}-palette.png \
-copyts -filter_complex \
"subtitles=${tmp_pref}-in:si=$strack,setsar=1/1,fps=$fps,scale=${width}:${height}:flags=lanczos[x];[x][1:v]paletteuse" \
"$2" || abort
[[ $? -ne 0 ]] && fferr=true
else
echo "pass 1..."
- ffmpeg -loglevel 16 -y -ss "$start" $t $length -i "$1" \
+ ffmpeg -loglevel 16 -y -ss "$start" $t $length -i "${tmp_pref}-in" \
-vf "setsar=1/1,fps=$fps,scale=${width}:${height}:flags=lanczos,palettegen" \
${tmp_pref}-palette.png
[[ $? -ne 0 ]] && fferr=true
[[ ! $fferr ]] && echo "pass 2..." && ffmpeg -loglevel 24 \
- -ss $start $t $length -i "$1" -i ${tmp_pref}-palette.png -filter_complex \
+ -ss $start $t $length \
+ -i "${tmp_pref}-in" -i ${tmp_pref}-palette.png -filter_complex \
"setsar=1/1,fps=$fps,scale=${width}:${height}:flags=lanczos[x];[x][1:v]paletteuse" \
"$2"
[[ $? -ne 0 ]] && fferr=true