Commit 779bb2b6 authored by Nikolay Nikolov's avatar Nikolay Nikolov
Browse files

first release of video-converter.sh - read README.md

parent 29d65ff6
#!/bin/bash
# Version 0.1
# Package video-converter
# Author Nikolay Nikolov
# Copyright root.bg All rights reserved.
# License GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
############################# HELPER FUCTIONS [start] #############################
function install_deps {
echo ""
echo "Installing ffmpeg and its deps"
echo "for ubuntu 14.04 users, use : sudo apt-add-repository ppa:samrog131/ppa, and then install fmpeg-real"
sudo apt-get update
sudo apt-get install libx264-dev libx264-142 libogg-dev libvorbis-dev libfaac-dev libtheora-dev libtheora0 faac ffmpeg -y
mkdir $PWD/videoz
}
function convert_videos {
echo ""
echo "=== Starting ffmpeg to convert this video to mp4,ogg, format ==="
ffmpeg -i $2 -c:v libx264 -preset ultrafast videoz/$2.mp4
ffmpeg -i $2 -acodec libvorbis -ac 2 -ab 96k -ar 44100 videoz/$2.ogv
ffmpeg -i $2 -acodec libvorbis -ac 2 -ab 96k -ar 44100 videoz/$2.webm
echo ""
echo "=== Now will create screenshot from the movie and will save it in videoz directory"
ffmpeg -ss 00:00:15 -i videoz/$2.mp4 -vf scale=800:-1 -vframes 1 videoz/$2.jpg
}
############################# HELPER FUCTIONS [end] #############################
### Define actions ###
case $1 in
install)
echo ""
echo " ****************************************************"
echo " * Installing required software *"
echo " ****************************************************"
install_deps
echo " ****************************************************"
echo " * Installing Complete *"
echo " ****************************************************"
echo ""
;;
convert)
echo ""
echo " ****************************************************"
echo " * Converting %2 *"
echo " ****************************************************"
convert_videos
echo " ****************************************************"
echo " * Installation Complete *"
echo " ****************************************************"
echo ""
;;
*)
echo ""
echo -e "\033[35;1m Please define an action: install | convert \033[0m"
echo -e "\033[35;1m For example: ./video-converter.sh install \033[0m"
echo ""
;;
esac
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment