Browse Source

initial

master
user 4 years ago
commit
b792785587
  1. 24
      Make telegram sticker
  2. 10
      convert to mp3
  3. 10
      convert to mp4

24
Make telegram sticker

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
#!/bin/bash
## Dependencies
# ImageMagick (convert and identify)
# bc
count=0;
(for name in "$@"; do
geometry=$(identify -verbose "$name" | grep geometry | cut -d' ' -f5 | cut -d'+' -f1)
width=`echo $geometry | cut -d'x' -f1`
height=`echo $geometry | cut -d'x' -f2`
if [ $width -gt $height ]; then
resize="512"
else
resize="x512"
fi
convert "$name" -resize $resize "$name.png"
count=$(echo "($count + 1)" | bc)
percent=$(echo " scale=2; ( 100 * ($count/$#))" | bc )
echo "$percent"
done;
) | zenity --progress --percentage=0 --auto-close --text="Making Stickers"

10
convert to mp3

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
#!/bin/bash
count=0;
( for file in "$@"; do
ffmpeg -nostdin -y -i "$file" "$file.mp3"
count=$(echo "($count + 1)" | bc)
percent=$(echo " scale=2; ( 100 * ($count/$#))" | bc )
echo "$percent"
done ) | zenity --progress --percentage=0 --auto-close --text="Converting files"

10
convert to mp4

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
#!/bin/bash
count=0;
( for file in "$@"; do
ffmpeg -nostdin -y -i "$file" "$file.mp4"
count=$(echo "($count + 1)" | bc)
percent=$(echo " scale=2; ( 100 * ($count/$#))" | bc )
echo "$percent"
done ) | zenity --progress --percentage=0 --auto-close --text="Converting files"
Loading…
Cancel
Save