add:media

This commit is contained in:
kokopi-dev
2026-04-05 00:36:32 +09:00
parent 04ab0cd4e9
commit 9141f3bc0a
5 changed files with 19 additions and 1 deletions

4
media/README.md Normal file
View File

@@ -0,0 +1,4 @@
playlist.sh: runs mpv with a folder of music as a playlist
video-compress.sh: compresses and or convert a video with ffmpeg
webpconvert.sh: converts an image to webp
- need convert to rust/go

2
media/video-compress.sh Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
ffmpeg -i "$1" -c:v libx265 -crf 24 -preset medium -c:a aac -b:a 128k "$2"

13
media/webpconvert.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
# TODO add resource options like ogcard, yt-thumbnail, etc
# convert to golang or rust probably for better ux on cli
DEFAULT_WIDTH=1200
if [ "$#" -lt 2 ] || [ "$#" -gt 3 ]; then
echo "Usage: $0 <input> <output> [width]"
exit 1
fi
WIDTH="${3:-$DEFAULT_WIDTH}"
magick "$1" -resize "${WIDTH}x>" -quality 85 "$2"

View File

@@ -1 +0,0 @@
playlist.sh: runs mpv with a folder of music as a playlist