g* auto git commands added, some encoding stuff as well
This commit is contained in:
parent
d6c388bfb5
commit
75db2da32f
43
bin/av1_enc
Executable file
43
bin/av1_enc
Executable file
@ -0,0 +1,43 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ -z "$1" ]]; then
|
||||||
|
printf 'Need an input file.\n' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -f "$1" ]]; then
|
||||||
|
printf '%s doesnt exist.\n' >&2 "$1"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
full_filename="$1"
|
||||||
|
filename=$(basename -- "$1")
|
||||||
|
output_file="${filename%.*}.webm"
|
||||||
|
log1="/dev/shm/${filename%.*}.log1"
|
||||||
|
log2="/dev/shm/${filename%.*}.log2"
|
||||||
|
|
||||||
|
read width height < <(mediainfo --Output=JSON "$full_filename" | jq -r '.media.track[] | select(."@type"=="Video") | .Width + " " + .Height')
|
||||||
|
|
||||||
|
aomenc -o "$output_file" --codec=av1 --passes=3 --pass=1 --fpf="$log1" \
|
||||||
|
-v --webm -u 0 -t 24 --enable-dnl-denoising=0 --denoise-noise-level=5 \
|
||||||
|
--target-bitrate=50000 "$full_filename" -w "$width" -h "$height"
|
||||||
|
if [[ $? != 0 ]]; then
|
||||||
|
printf 'oops\n' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
aomenc -o "$output_file" --codec=av1 --passes=3 --pass=2 --fpf="$log1" \
|
||||||
|
-spf "$log2" -v --webm -u 0 -t 24 --enable-dnl-denoising=0 \
|
||||||
|
--denoise-noise-level=5 --target-bitrate=50000 "$full_filename"
|
||||||
|
if [[ $? != 0 ]]; then
|
||||||
|
printf 'oops\n' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
aomenc -o "$output_file" --codec=av1 --passes=3 --pass=3 --fpf="$log1" \
|
||||||
|
-spf "$log2" -v --webm -u 0 -t 24 --enable-dnl-denoising=0 \
|
||||||
|
--denoise-noise-level=5 --target-bitrate=50000 "$full_filename"
|
||||||
|
if [[ $? != 0 ]]; then
|
||||||
|
printf 'oops\n' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
44
bin/extract_audio
Executable file
44
bin/extract_audio
Executable file
@ -0,0 +1,44 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
err_file="/tmp/getaudio_$$"
|
||||||
|
|
||||||
|
if [[ -z "$1" ]]; then
|
||||||
|
printf 'Need a filename of a video\n' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
input_file="$1"
|
||||||
|
if [[ ! -f "$input_file" ]]; then
|
||||||
|
printf "Can't read %s\n" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
base_path="$(dirname "$input_file" 2>"$err_file")"
|
||||||
|
err="$(<"$err_file")"
|
||||||
|
|
||||||
|
if [[ -n "$err" ]]; then
|
||||||
|
printf '%s\n' "$err" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# audio_ext="$(ffprobe "$input_file" 2>&1 | sed -nr 's/.*Audio: (...).*/\1/p')"
|
||||||
|
|
||||||
|
mediainfo_json="$(mediainfo --Output=JSON "$input_file")"
|
||||||
|
audio_codec="$(jq -r '.media.track[] | select(."@type"=="Audio") | .Format' <<< "$mediainfo_json")"
|
||||||
|
audio_ext="$(tr [:upper:] [:lower:] <<< "$audio_codec")"
|
||||||
|
|
||||||
|
if [[ -n "$2" ]]; then
|
||||||
|
if [[ "$2" == *.* ]]; then
|
||||||
|
audio_out="$2"
|
||||||
|
else
|
||||||
|
audio_out="${2}.${audio_ext}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
out_file="$(basename ${input_file%%.*})"
|
||||||
|
audio_out="${base_path}/${out_file}.${audio_ext}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ffmpeg -i "$input_file" -vn -acodec copy "$audio_out"
|
||||||
|
ffmpeg -i "$input_file" -vn -acodec copy "$audio_out"
|
||||||
|
|
29
bin/gclone
Executable file
29
bin/gclone
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ -z "$1" ]]; then
|
||||||
|
printf 'Need a project:\n\n' >&2
|
||||||
|
pass show gitea/token >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
project="$1"
|
||||||
|
shift
|
||||||
|
unset token
|
||||||
|
token="$(pass show gitea/token/${project})"
|
||||||
|
if [[ -z "$token" ]]; then
|
||||||
|
printf 'Failed to get token.\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [[ "$project" == 'pass' ]]; then
|
||||||
|
if [[ -n "$@" ]]; then
|
||||||
|
pass git pull "$@" "https://luke:${token}@git.drheck.dev/luke/${project}.git"
|
||||||
|
else
|
||||||
|
pass git pull "https://luke:${token}@git.drheck.dev/luke/${project}.git"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [[ -n "$@" ]]; then
|
||||||
|
git clone "$@" "https://luke:${token}@git.drheck.dev/luke/${project}.git"
|
||||||
|
else
|
||||||
|
git clone "https://luke:${token}@git.drheck.dev/luke/${project}.git"
|
||||||
|
fi
|
||||||
|
fi
|
38
bin/get_audio
Executable file
38
bin/get_audio
Executable file
@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
err_file="/tmp/getaudio_$$"
|
||||||
|
|
||||||
|
if [[ -z "$1" ]]; then
|
||||||
|
printf 'Need a filename of a video\n' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
input_file="$1"
|
||||||
|
if [[ ! -f "$input_file" ]]; then
|
||||||
|
printf "Can't read %s\n" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
base_path="$(dirname "$input_file" 2>"$err_file")"
|
||||||
|
err="$(<"$err_file")"
|
||||||
|
|
||||||
|
if [[ -n "$err" ]]; then
|
||||||
|
printf '%s\n' "$err" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
audio_ext="$(ffprobe "$input_file" 2>&1 | sed -nr 's/.*Audio: (...).*/\1/p')"
|
||||||
|
|
||||||
|
if [[ -n "$2" ]]; then
|
||||||
|
if [[ "$2" == *.* ]]; then
|
||||||
|
audio_out="$2"
|
||||||
|
else
|
||||||
|
audio_out="${2}.${audio_ext}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
out_file="$(basename ${input_file%%.*})"
|
||||||
|
audio_out="${base_path}/${out_file}.${audio_ext}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ffmpeg -i "$input_file" -vn -acodec copy "$audio_out"
|
||||||
|
ffmpeg -i "$input_file" -vn -acodec copy "$audio_out"
|
5
bin/gitea_hints
Executable file
5
bin/gitea_hints
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
printf 'https://username:PERSONAL_ACCESS_TOKEN@github.com/username/project.git\n'
|
||||||
|
printf 'git push https://username:PERSONAL_ACCESS_TOKEN@github.com/username/project.git\n'
|
||||||
|
printf 'token: avatar, settings, applications\n'
|
19
bin/gmic_test.sh
Executable file
19
bin/gmic_test.sh
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
input_dir="${HOME}/vids/Home/out"
|
||||||
|
output_dir="${HOME}/vids/Home/out2"
|
||||||
|
a=0
|
||||||
|
effect="fx_sketchbw 3,45,180,30,1.75,0.02,0.5,0.75,0.1,0.7,3,6,0,1,4,0,0,50,50"
|
||||||
|
effect="fx_sketchbw 5,45,180,16,1.75,0.0291,0.5,0.75,0.1,0.7,3,6,1,1,4,0,0,50,50"
|
||||||
|
effect="samj_Angoisse 1,5,0,5,100,2,4,1,250"
|
||||||
|
effect="boxfitting 2,0"
|
||||||
|
for i in *.png; do
|
||||||
|
# a=$((a+1))
|
||||||
|
echo "$i"
|
||||||
|
# print_a=$(printf "%04d" "$a")
|
||||||
|
echo gmic "${input_dir}/${i}" $effect output "${output_dir}/${i}" >> /tmp/cmds
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
# ffmpeg -i "${output_dir}/%09d.png" -c:v libx264 -vf fps=25 -pix_fmt yuv420p "${HOME}/vids/home_effect.mp4"
|
29
bin/gpull
Executable file
29
bin/gpull
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ -z "$1" ]]; then
|
||||||
|
printf 'Need a project:\n\n' >&2
|
||||||
|
pass show gitea/token >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
project="$1"
|
||||||
|
shift
|
||||||
|
unset token
|
||||||
|
token="$(pass show gitea/token/${project})"
|
||||||
|
if [[ -z "$token" ]]; then
|
||||||
|
printf 'Failed to get token.\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [[ "$project" == 'pass' ]]; then
|
||||||
|
if [[ -n "$@" ]]; then
|
||||||
|
pass git pull "$@" "https://luke:${token}@git.drheck.dev/luke/${project}.git"
|
||||||
|
else
|
||||||
|
pass git pull "https://luke:${token}@git.drheck.dev/luke/${project}.git"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [[ -n "$@" ]]; then
|
||||||
|
git pull "$@" "https://luke:${token}@git.drheck.dev/luke/${project}.git"
|
||||||
|
else
|
||||||
|
git pull "https://luke:${token}@git.drheck.dev/luke/${project}.git"
|
||||||
|
fi
|
||||||
|
fi
|
29
bin/gpush
Executable file
29
bin/gpush
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ -z "$1" ]]; then
|
||||||
|
printf 'Need a project:\n\n' >&2
|
||||||
|
pass show gitea/token >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
project="$1"
|
||||||
|
shift
|
||||||
|
unset token
|
||||||
|
token="$(pass show gitea/token/${project})"
|
||||||
|
if [[ -z "$token" ]]; then
|
||||||
|
printf 'Failed to get token.\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [[ "$project" == 'pass' ]]; then
|
||||||
|
if [[ -n "$@" ]]; then
|
||||||
|
pass git push "$@" "https://luke:${token}@git.drheck.dev/luke/${project}.git"
|
||||||
|
else
|
||||||
|
pass git push "https://luke:${token}@git.drheck.dev/luke/${project}.git"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [[ -n "$@" ]]; then
|
||||||
|
git push "$@" "https://luke:${token}@git.drheck.dev/luke/${project}.git"
|
||||||
|
else
|
||||||
|
git push "https://luke:${token}@git.drheck.dev/luke/${project}.git"
|
||||||
|
fi
|
||||||
|
fi
|
@ -1,2 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
wf-recorder -g "$(slurp)" --file=$(date "+%s").mp4
|
if [[ -z "$1" ]]; then
|
||||||
|
file="$(date +%Y-%M-%d_%H:%m)"
|
||||||
|
else
|
||||||
|
file="$1"
|
||||||
|
fi
|
||||||
|
wf-recorder -g "$(slurp)" --file="${file}.mp4"
|
||||||
|
@ -1,2 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
wf-recorder -g "$(slurp)" --audio --file=$(date "+%s").mp4
|
if [[ -z "$1" ]]; then
|
||||||
|
file="$(date +%Y-%M-%d_%H:%m)"
|
||||||
|
else
|
||||||
|
file="$1"
|
||||||
|
fi
|
||||||
|
wf-recorder -g "$(slurp)" --audio --file="${file}.mp4"
|
||||||
|
11
shell/bashrc
11
shell/bashrc
@ -60,6 +60,7 @@ sources=(
|
|||||||
"${HOME}/.bash_functions"
|
"${HOME}/.bash_functions"
|
||||||
"${HOME}/.bash_functions2"
|
"${HOME}/.bash_functions2"
|
||||||
"${HOME}/.cargo/env"
|
"${HOME}/.cargo/env"
|
||||||
|
"${HOME}/.config/gom/init"
|
||||||
"${KITTY_INSTALLATION_DIR}/shell-integration/bash/kitty.bash"
|
"${KITTY_INSTALLATION_DIR}/shell-integration/bash/kitty.bash"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -117,6 +118,16 @@ if [[ "$?" == "1" ]]; then
|
|||||||
fi
|
fi
|
||||||
[[ -L "${ssh_auth_link}" ]] && [[ -e "${ssh_auth_link}" ]] && export SSH_AUTH_SOCK="$ssh_auth_link"
|
[[ -L "${ssh_auth_link}" ]] && [[ -e "${ssh_auth_link}" ]] && export SSH_AUTH_SOCK="$ssh_auth_link"
|
||||||
|
|
||||||
|
# autotmux
|
||||||
|
# export AT=true on connecting host to enable
|
||||||
|
default_session=shell
|
||||||
|
tls 2>/dev/null | grep -E "$default_session"'.*attached' &>/dev/null
|
||||||
|
not_in_tmux="$?"
|
||||||
|
no_auto="${HOME}/.config/autotmux/disable"
|
||||||
|
if [[ ! -f "$no_auto" ]] && [[ "$AT" == 'true' ]] && [[ "$not_in_tmux" ]]; then
|
||||||
|
stx "${default_session}"
|
||||||
|
fi
|
||||||
|
|
||||||
# Eternal bash history.
|
# Eternal bash history.
|
||||||
# ---------------------
|
# ---------------------
|
||||||
# Undocumented feature which sets the size to "unlimited".
|
# Undocumented feature which sets the size to "unlimited".
|
||||||
|
Loading…
x
Reference in New Issue
Block a user