Skip to content

Instantly share code, notes, and snippets.

@rytoj
Last active August 29, 2015 14:15
Show Gist options
  • Save rytoj/728120ffff07c25cf54a to your computer and use it in GitHub Desktop.
Save rytoj/728120ffff07c25cf54a to your computer and use it in GitHub Desktop.
Notilus script - WebmPart
#!/bin/bash
# NAME: WebmPart 0.1
# DESCRIPTIOM: Converts video files to .webm
# LICENSE GNU GPL v3 (http://www.gnu.org/licenses/gpl.html)
# DEPENDENCIES: libav-tools, notify-osd
time=$(zenity --forms \
--title="Webm convert" --text="EXAMPLE: start-time-> 00:00:00 Duraction-> 5" \
--add-entry="Start-time" \
--separator="," \
--add-entry="Duration")
atime=$(echo $time | cut -d, -f1)
ztime=$(echo $time | cut -d, -f2)
if [ -z "$atime" -o -z "$ztime" ]
then
zenity --info --title=InfoWindow --text="Empty field"
exit
fi
avconv -y -i "$1" -acodec libvorbis -aq 5 -ac 2 -qmax 25 -threads 2 -ss "$atime" -t "$ztime" converted.webm
case $? in
0)
notify-send -i emblem-default "Video conversion" "completed"
;;
1)
notify-send -i software-update-urgent "Conversion error"
;;
-1)
echo "An unexpected error has occurred."
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment