Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nikolay Nikolov
video-converter
Commits
779bb2b6
Commit
779bb2b6
authored
Jun 12, 2015
by
Nikolay Nikolov
Browse files
first release of video-converter.sh - read README.md
parent
29d65ff6
Changes
1
Hide whitespace changes
Inline
Side-by-side
video-converter.sh
0 → 100755
View file @
779bb2b6
#!/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
"
\0
33[35;1m Please define an action: install | convert
\0
33[0m"
echo
-e
"
\0
33[35;1m For example: ./video-converter.sh install
\0
33[0m"
echo
""
;;
esac
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment