mirror of
https://github.com/JanJastrow/.dotfiles.git
synced 2024-11-24 11:22:50 +01:00
Compare commits
No commits in common. "0f565c47f5c98b8fcdb2140431377f69f4db9df8" and "d1425c416dbabb5dfd48113a2b3d82f5fdc720cb" have entirely different histories.
0f565c47f5
...
d1425c416d
18
zsh/ffmpeg
18
zsh/ffmpeg
@ -40,24 +40,6 @@ function ff-mp4 () {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Recompress input MP4 to 720p MP4 (copy audio)
|
|
||||||
ff-recompress720p() {
|
|
||||||
for input in *.mp4; do
|
|
||||||
if [[ -f "$input" ]]; then
|
|
||||||
tempfile="temp_${input%.mp4}"
|
|
||||||
ffmpeg -hide_banner -i "$input" -map 0 -c:v libx264 -crf 18 -vf scale=1280:-1 -preset slow -tune film -x264-params "ref=5:bframes=5:crf-max=25:qpmax=34:level=3.1:b-adapt=2:direct=auto:deblock=-1,-1:analyse=all:me=umh:subme=9:trellis=2:psy-rd=1,0.15:vbv-bufsize=17500:vbv-maxrate=17500:rc-lookahead=60" -c:a copy -movflags faststart "$tempfile.mp4"
|
|
||||||
|
|
||||||
if [[ $? -eq 0 ]]; then
|
|
||||||
mv "$input" "_$input"
|
|
||||||
mv "$tempfile.mp4" "$input"
|
|
||||||
echo "Conversion successful: $input"
|
|
||||||
else
|
|
||||||
echo "Conversion failed for: $input"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# ffmpeg-convert
|
# ffmpeg-convert
|
||||||
# source: https://yohanes.gultom.me/2016/05/21/bash-script-to-batch-convert-mkv-to-mp4-linux/
|
# source: https://yohanes.gultom.me/2016/05/21/bash-script-to-batch-convert-mkv-to-mp4-linux/
|
||||||
function ff-ac3-to-stereo() {
|
function ff-ac3-to-stereo() {
|
||||||
|
18
zsh/scripts
18
zsh/scripts
@ -41,15 +41,15 @@ function manp() {
|
|||||||
|
|
||||||
# pushover notification
|
# pushover notification
|
||||||
function pushover() {
|
function pushover() {
|
||||||
curl -s \
|
curl -s \
|
||||||
--form-string "token=$pushover_token" \
|
--form-string "token=$pushover_token" \
|
||||||
--form-string "user=$pushover_user" \
|
--form-string "user=$pushover_user" \
|
||||||
--form-string "title=$HOST" \
|
--form-string "title=$HOST" \
|
||||||
--form-string "message=$1" \
|
--form-string "message=$1" \
|
||||||
https://api.pushover.net/1/messages.json
|
https://api.pushover.net/1/messages.json
|
||||||
}
|
}
|
||||||
|
|
||||||
# png to jpg 85
|
# png to jpg
|
||||||
function png2web() {
|
function png2web() {
|
||||||
findpath=$1
|
findpath=$1
|
||||||
: "${findpath:="."}"
|
: "${findpath:="."}"
|
||||||
@ -57,7 +57,7 @@ function png2web() {
|
|||||||
dir=$(dirname "$f");
|
dir=$(dirname "$f");
|
||||||
file=$(basename "$f");
|
file=$(basename "$f");
|
||||||
name="${file%.*}";
|
name="${file%.*}";
|
||||||
magick convert "$f" pnm:- | cjpeg -progressive -quality 85 > "$dir/$name.jpg" </dev/null
|
magick convert "$f" pnm:- | cjpeg -progressive -quality 97 > "$dir/$name.jpg" </dev/null
|
||||||
rm -f "$f";
|
rm -f "$f";
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@ -93,7 +93,7 @@ function extract () {
|
|||||||
*.Z) uncompress "$1" ;;
|
*.Z) uncompress "$1" ;;
|
||||||
*.7z) 7z x "$1" ;;
|
*.7z) 7z x "$1" ;;
|
||||||
*) echo "'$1' cannot be extracted via extract()" ;;
|
*) echo "'$1' cannot be extracted via extract()" ;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
echo "'$1' is not a valid file"
|
echo "'$1' is not a valid file"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user