mediasnacks 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.zsh/completions/_mediasnacks +3 -2
- package/README.md +1 -0
- package/package.json +1 -1
- package/src/cli.js +1 -0
- package/src/gif.sh +35 -0
|
@@ -15,7 +15,8 @@ _mediasnacks_commands=(
|
|
|
15
15
|
'dlvideo: yt-dlp best video',
|
|
16
16
|
'unemoji:Removes emojis from filenames'
|
|
17
17
|
'rmcover:Removes cover art'
|
|
18
|
-
'curltime:Measures request response timings'
|
|
18
|
+
'curltime:Measures request response timings',
|
|
19
|
+
'gif:Video to GIF'
|
|
19
20
|
)
|
|
20
21
|
|
|
21
22
|
_mediasnacks() {
|
|
@@ -26,7 +27,7 @@ _mediasnacks() {
|
|
|
26
27
|
|
|
27
28
|
local cmd="$words[2]"
|
|
28
29
|
case "$cmd" in
|
|
29
|
-
avif|resize|moov2front|dropdups|seqcheck|hev1tohvc1|framediff|videodiff|vconcat|dlaudio|dlvideo|unemoji|rmcover|curltime)
|
|
30
|
+
avif|resize|moov2front|dropdups|seqcheck|hev1tohvc1|framediff|videodiff|vconcat|dlaudio|dlvideo|unemoji|rmcover|curltime|gif)
|
|
30
31
|
_files
|
|
31
32
|
;;
|
|
32
33
|
qdir)
|
package/README.md
CHANGED
package/package.json
CHANGED
package/src/cli.js
CHANGED
package/src/gif.sh
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/bin/zsh
|
|
2
|
+
|
|
3
|
+
# Convert to GIF
|
|
4
|
+
|
|
5
|
+
FPS=10
|
|
6
|
+
WIDTH=600
|
|
7
|
+
|
|
8
|
+
usage() {
|
|
9
|
+
echo "Usage: mediasnacks gif [--fps <number>] [--width <pixels>] <file>"
|
|
10
|
+
exit 1
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
while [[ $# -gt 0 ]]; do
|
|
14
|
+
case "$1" in
|
|
15
|
+
--fps)
|
|
16
|
+
FPS="$2";
|
|
17
|
+
shift 2 ;;
|
|
18
|
+
--width)
|
|
19
|
+
WIDTH="$2"
|
|
20
|
+
shift 2 ;;
|
|
21
|
+
--help|-h)
|
|
22
|
+
usage ;;
|
|
23
|
+
*)
|
|
24
|
+
file="$1"
|
|
25
|
+
shift ;;
|
|
26
|
+
esac
|
|
27
|
+
done
|
|
28
|
+
|
|
29
|
+
[[ -z "$file" ]] && usage
|
|
30
|
+
|
|
31
|
+
outfile="${file:r}.gif"
|
|
32
|
+
|
|
33
|
+
ffmpeg -v error -i "$file" \
|
|
34
|
+
-vf "fps=${FPS},scale=${WIDTH}:-1" \
|
|
35
|
+
"$outfile"
|