feat: idk

This commit is contained in:
Flinner Yuu 2023-03-31 13:28:16 +03:00
parent cbe9cc8788
commit 51eb11db16
Signed by: flinner
GPG Key ID: 95CE0DA7F0E58CA6
2 changed files with 41 additions and 13 deletions

View File

@ -23,7 +23,6 @@ source ~/.fehbg
#(sleep 1 && keynav)&
# warped > keynav
(sleep 1 && warpd)&
(sleep 0 && ~/bin/keyboard ) &
killall wired
(sleep 1 && wired ) &
#(sleep 3 && optimus-manager-qt) &
@ -33,8 +32,10 @@ killall wired
(sleep 6 && bspc rule -r KeePassXC ) &
(sleep 5 && syncthing -no-browser) &
(sleep 100 && nextcloud --background) &
#(sleep 5 && thunderbird ) &
(sleep 7 && bspc rule -r Thunderbird ) &
#(sleep 7 && bspc rule -r Thunderbird ) &
# Kill all davail instances before launching a single one
kill $(pgrep --full "davmail")
@ -54,9 +55,20 @@ killall goimapnotify
#done
~/bin/run_goimapnotify.sh &
## Keyboard
# ibus-daemon &
# uim-toolbar-gtk3-systray & #uim Japanses Input
# Japanses Input
#(sleep 1 && fcitx -d ) &
(sleep 0 && ~/bin/keyboard ) &
## Audio
(sleep 0 && dbus-run-session pipewire ) &
(sleep 2 && dbus-run-session pipewire-pulse ) &
(sleep 2 && dbus-run-session wireplumber ) &
#(sleep 2 && polkit-dumb-agent) &
#ibus-daemon &
#uim-toolbar-gtk3-systray & #uim Japanses Input
#if bspwm

View File

@ -1,14 +1,35 @@
#!/bin/bash
PYTORCH_NO_CUDA_MEMORY_CACHING=1
[ -z "$2" ] && echo "usage: input.mp4 output.mp4"
[ -z "$2" ] && exit
VIDEO="$1"
VIDEO_OUTPUT="$2"
TMP_RAW_AUDIO=$(mktemp --suffix ".mp3")
TMP_VOCALS_DIR=$(mktemp --directory)
TMP_VOCALS=$(mktemp --suffix ".mp3")
mkdir -p ~/tmp/demusicify
echo "Created ~/tmp/demusicify"
echo "Using ~/tmp/demusicify as a temp directory"
TMP_RAW_AUDIO=$(mktemp -p ~/tmp/demusicify --suffix ".mp3")
TMP_VOCALS_DIR=$(mktemp -p ~/tmp/demusicify --directory)
TMP_VOCALS=$(mktemp -p ~/tmp/demusicify --suffix ".mp3")
function cleanup () {
read -p "Do you want to cleanup? y/n" -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 # handle exits from shell or function but don't exit interactive shell
echo "Cleaning up!"
rm "$TMP_RAW_AUDIO"
rm "$TMP_VOCALS"
rm -rf "$TMP_VOCALS_DIR"
fi
}
trap cleanup EXIT
# Extract Audio from Video
ffmpeg -i "$VIDEO" -vn "$TMP_RAW_AUDIO" -y
@ -16,7 +37,7 @@ ffmpeg -i "$VIDEO" -vn "$TMP_RAW_AUDIO" -y
# move to a tmp file, becuase demucs creates a lot of garbage
pushd "$TMP_VOCALS_DIR" || exit
demucs --two-stems=vocals --segment 10 "$TMP_RAW_AUDIO"
demucs --two-stems=vocals --segment 15 "$TMP_RAW_AUDIO"
cp ./separated/*/*/vocals.wav "$TMP_VOCALS"
@ -29,8 +50,3 @@ ffmpeg \
-c:v copy \
-map 0 -map 1:a \
-y "$VIDEO_OUTPUT"
rm "$TMP_RAW_AUDIO"
rm "$TMP_VOCALS"
rm -rf "$TMP_VOCALS_DIR"