You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.7 KiB
Plaintext

4 years ago
webvideo () {
ffmpeg -i $1 -map_metadata -1 -c:a libopus -c:v libaom-av1 -crf 34 -b:v 0 -pix_fmt yuv420p -movflags +faststart -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -strict experimental $1.av1.mp4
ffmpeg -i $1 -map_metadata -1 -c:a libfdk_aac -c:v libx265 -crf 24 -preset veryslow -pix_fmt yuv420p -movflags +faststart -tag:v hvc1 -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" $1.hevc.mp4
ffmpeg -i $1 -map_metadata -1 -c:a libfdk_aac -c:v libx264 -crf 24 -preset veryslow -profile:v main -pix_fmt yuv420p -movflags +faststart -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" $1.h264.mp4
}
4 years ago
webvideonoaudio () {
ffmpeg -i $1 -map_metadata -1 -an -c:v libaom-av1 -crf 34 -b:v 0 -pix_fmt yuv420p -movflags +faststart -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -strict experimental $1.av1.mp4
ffmpeg -i $1 -map_metadata -1 -an -c:v libx265 -crf 24 -preset veryslow -pix_fmt yuv420p -movflags +faststart -tag:v hvc1 -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" $1.hevc.mp4
ffmpeg -i $1 -map_metadata -1 -an -c:v libx264 -crf 24 -preset veryslow -profile:v main -pix_fmt yuv420p -movflags +faststart -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" $1.h264.mp4
}
4 years ago
webvideooptimized () {
4 years ago
ffmpeg -i $1 -map_metadata -1 -c:a libfdk_aac -c:v libx264 -crf 24 -preset veryfast -profile:v main -pix_fmt yuv420p -movflags +faststart -vf "scale=900:trunc(ow/a/2)*2" $1.h264.mp4
}
4 years ago
webvideooptimizednoaudio () {
ffmpeg -i $1 -map_metadata -1 -an -c:v libx264 -crf 24 -preset veryslow -profile:v main -pix_fmt yuv420p -movflags +faststart -vf "scale=1920:trunc(ow/a/2)*2" $1.h264.mp4
}
4 years ago
webvideooptimizednoaudiomobile () {
ffmpeg -i $1 -map_metadata -1 -an -c:v libx264 -crf 24 -preset veryslow -profile:v main -pix_fmt yuv420p -movflags +faststart -vf "scale=720:trunc(ow/a/2)*2" $1.h264.mp4
}
4 years ago
webvideoposter () {
ffmpeg -ss 00:00:02 -i $1 -frames:v 1 $1.jpg
}
l () {
if [ -n $NNNLVL ] && [ "${NNNLVL:-0}" -ge 1 ]; then
echo "nnn is already running"
return
fi
export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
nnn -deH "$@"
if [ -f "$NNN_TMPFILE" ]; then
. "$NNN_TMPFILE"
rm -f "$NNN_TMPFILE" > /dev/null
fi
}
# create and change to directory/folder
4 years ago
take () {
mkdir -p $1
cd $1
}
# a function to get the current branch for git shortcuts etc
4 years ago
current_branch () {
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
ref=$(git rev-parse --short HEAD 2> /dev/null) || return
echo ${ref#refs/heads/}
}
9 years ago
# easy vim/terminal switch
fancy-ctrl-z () {
if [[ $#BUFFER -eq 0 ]]; then
BUFFER="fg"
zle accept-line
else
zle push-input
zle clear-screen
fi
}
4 years ago
wttr () {
if [[ -n "$1" ]]
then
curl "wttr.in/$1?format=v2"
else
curl "wttr.in/Leipzig?format=v2"
fi
}