From 810ff8f603888683bc8274e862003c3dc0b7f580 Mon Sep 17 00:00:00 2001 From: Jorge Vasquez Perez Date: Tue, 29 Sep 2026 20:45:06 -0700 Subject: [PATCH] added a vp9 cpmverter script that handles alpha channel too --- bash/album_ogg2mp3.sh | 10 ++++++++++ bash/fix_wacom.sh | 5 ++++- bash/get_lrc.sh | 6 ++++++ bash/make_gif.sh | 6 ++++-- bash/make_vp9.sh | 28 ++++++++++++++++++++++++++++ bash/ytdlpl.sh | 7 +++++-- python/g_st_meta.py | 9 +++++++++ 7 files changed, 66 insertions(+), 5 deletions(-) create mode 100755 bash/album_ogg2mp3.sh create mode 100755 bash/get_lrc.sh create mode 100755 bash/make_vp9.sh create mode 100755 python/g_st_meta.py diff --git a/bash/album_ogg2mp3.sh b/bash/album_ogg2mp3.sh new file mode 100755 index 0000000..6fc760f --- /dev/null +++ b/bash/album_ogg2mp3.sh @@ -0,0 +1,10 @@ +export IFS=$'\n'; +for i; +do +newdir="$(basename "$i")" +mkdir ./"$newdir"; + for j in $( find "$i" -iname *ogg -or -iname *m4v -or -iname *flac -or -iname *wav | sort ); + do + ffmpeg -i "$j" -q 0 "$(basename "$i")/"$(basename "${j%.*}").mp3; + done +done \ No newline at end of file diff --git a/bash/fix_wacom.sh b/bash/fix_wacom.sh index 061d29d..8d7e618 100755 --- a/bash/fix_wacom.sh +++ b/bash/fix_wacom.sh @@ -3,6 +3,9 @@ #makine #wacom_id="Wacom Intuos Pro M Pen stylus" #wacom_id=$(xsetwacom --list devices | grep stylus | grep -o [0-9]. | sed 's/\t//') -wacom_id=$(xsetwacom --list devices | grep stylus | grep 'id\: [0-9].' -o | grep [0-9]. -o) +#wacom_id=$(xsetwacom --list devices | grep 'stylus' | grep 'id:.[0-9]' -o | grep '[0-9]' -o) +wacom_id=$(xsetwacom --list devices | grep 'stylus' | grep -E 'id:.[0-9]{1,3}' -o | grep -E '[0-9]{1,3}' -o) + xsetwacom --set "$(($wacom_id + 0))" button 2 3 xsetwacom --set "$(($wacom_id + 0))" button 3 2 +xsetwacom --set "$(($wacom_id + 0))" threshold 50 diff --git a/bash/get_lrc.sh b/bash/get_lrc.sh new file mode 100755 index 0000000..60e7f84 --- /dev/null +++ b/bash/get_lrc.sh @@ -0,0 +1,6 @@ +for i; +do +search=$( exiftool -s3 -artist -title "$i" | xargs ) +echo $search +syncedlyrics "$search" --synced-only -o "${i%.*}.lrc" +done \ No newline at end of file diff --git a/bash/make_gif.sh b/bash/make_gif.sh index 4d7bc8e..1d3ddad 100755 --- a/bash/make_gif.sh +++ b/bash/make_gif.sh @@ -40,14 +40,16 @@ then d=$(ffprobe -v error -select_streams v:0 -show_entries stream=duration -of default=noprint_wrappers=1:nokey=1 "$i"); w=$(ffprobe -v error -select_streams v:0 -show_entries stream=width -of default=noprint_wrappers=1:nokey=1 "$i"); h=$(ffprobe -v error -select_streams v:0 -show_entries stream=height -of default=noprint_wrappers=1:nokey=1 "$i"); - ffmpeg -i "$i" -filter_complex "[0:v] fps=$fps [refpsd]; gradients=size="$w"x"$h":d=$d:c0=$color:c1=$color [box]; [refpsd] split [a][b];[a] palettegen [p];[box][b] overlay [overlayed];[overlayed][p] paletteuse" -q 0 -strict -2 -vb $vb -y ${i%.*}.gif ; + ffmpeg -i "$i" -filter_complex "[0:v] fps=$fps [refpsd];[refpsd] split [a][b];[a] palettegen [p];[borefpsd][b] overlay [overlayed];[overlayed][p] paletteuse" -q 0 -strict -2 -vb $vb -y ${i%.*}.gif ; + #ffmpeg -i "$i" -filter_complex "[0:v] fps=$fps [refpsd]; gradients=size="$w"x"$h":d=$d:c0=$color:c1=$color [box]; [refpsd] split [a][b];[a] palettegen [p];[box][b] overlay [overlayed];[overlayed][p] paletteuse" -q 0 -strict -2 -vb $vb -y ${i%.*}.gif ; done; else for i; do echo $size d=$(ffprobe -v error -select_streams v:0 -show_entries stream=duration -of default=noprint_wrappers=1:nokey=1 "$i"); - ffmpeg -i "$i" -filter_complex "[0:v] scale=$sizealt,fps=$fps [scaled]; gradients=size=$size:d=$d:c0=$color:c1=$color [box],[box][scaled] overlay [overlayed],[overlayed] split [i1][i2];[i1] palettegen [palette];[i2][palette] paletteuse" -q 0 -strict -2 -vb $vb -y ${i%.*}_$size.gif ; + ffmpeg -i "$i" -filter_complex "[0:v] scale=$sizealt,fps=$fps [scaled]; [scaled] split [i1][i2];[i1] palettegen [palette];[i2][palette] paletteuse" -q 0 -strict -2 -vb $vb -y ${i%.*}_$size.gif ; + #ffmpeg -i "$i" -filter_complex "[0:v] scale=$sizealt,fps=$fps [scaled]; gradients=size=$size:d=$d:c0=$color:c1=$color [box],[box][scaled] overlay [overlayed],[overlayed] split [i1][i2];[i1] palettegen [palette];[i2][palette] paletteuse" -q 0 -strict -2 -vb $vb -y ${i%.*}_$size.gif ; done; fi diff --git a/bash/make_vp9.sh b/bash/make_vp9.sh new file mode 100755 index 0000000..9d2bb15 --- /dev/null +++ b/bash/make_vp9.sh @@ -0,0 +1,28 @@ +alpha="false" + +while getopts "a" opt; do + case ${opt} in + a ) + alpha="true" + ;; + esac +done + +shift "$(($OPTIND -1))" + +for i; +do + echo $alpha + new_name=$(echo $i | sed -Er 's/\_(NL|PR)([_-])/\_VP9\2/'); + if [ "$alpha" = "true" ] + then + + ffmpeg -i "$i" -c:v libvpx-vp9 -pix_fmt yuva420p -b:v 0 -colorspace bt709 -color_trc bt709 -color_primaries bt709 -crf 10 -auto-alt-ref 0 "${new_name%.*}.webm" ##-vf "alphaextract" -c:v libvpx-vp9 -pix_fmt yuva420p -b:v 0 -colorspace bt709 -color_trc bt709 -color_primaries bt709 -crf 5 "${new_name%.*}_ALPHA.webm"; + echo $new_name "w alpha" + else + ffmpeg -i "$i" -c:v libvpx-vp9 -pix_fmt yuv420p -b:v 0 -colorspace bt709 -color_trc bt709 -color_primaries bt709 -crf 10 "${new_name%.*}.webm"; + echo $new_name + echo $new_name "no alpha" + fi + +done; diff --git a/bash/ytdlpl.sh b/bash/ytdlpl.sh index 8898fde..a991d81 100755 --- a/bash/ytdlpl.sh +++ b/bash/ytdlpl.sh @@ -11,16 +11,19 @@ while getopts ":a" opt; do esac done +format=bestvideo+bestaudio + export IFS=$'\n'; for i; do #Audio--> - youtube-dl -x --audio-format vorbis --add-metadata --xattrs --embed-subs --embed-thumbnail --all-subs -o "%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" -i -f bestaudio --audio-quality 192k "$i" + #yt-dlp -x --audio-format vorbis --add-metadata --xattrs --embed-subs --embed-thumbnail --all-subs -o "%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" -i -f bestaudio --audio-quality 192k "$i" #youtube-dl --xattrs --embed-subs --embed-thumbnail --all-subs -o "%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" -i -f bestaudio "$i" #youtube-dl -o "%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" -f $a "$i" #youtube-dl --add-metadata --xattrs --embed-subs --embed-thumbnail --all-subs -o "%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" -i -f bestvideo+bestaudio "$i" #youtube-dl --add-metadata --xattrs --embed-subs --all-subs -o "%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" -f bestvideo+bestaudio "$i" #VIDEO--> - #youtube-dl --add-metadata --xattrs --embed-subs --all-subs -o "%(playlist)s/%(playlist_index)s - %(title)s - %(format)s.%(ext)s" -i -f $format "$i" + #yt-dlp --add-metadata --xattrs --embed-subs --all-subs -o "%(playlist)s/%(playlist_index)s - %(title)s - %(format)s.%(ext)s" -i -f $format "$i" + yt-dlp --add-metadata --xattrs --embed-subs --all-subs -o "%(playlist)s/%(playlist_index)s - %(title)s - %(format)s.%(ext)s" -i "$i" done; diff --git a/python/g_st_meta.py b/python/g_st_meta.py new file mode 100755 index 0000000..6bc88e5 --- /dev/null +++ b/python/g_st_meta.py @@ -0,0 +1,9 @@ +import json +import struct + +with open("/yorchnet-guindos/ai/models/Lora/drawix8.safetensors", "rb") as f: + length_of_header = struct.unpack('