-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2ogg.sh
More file actions
28 lines (26 loc) · 692 Bytes
/
2ogg.sh
File metadata and controls
28 lines (26 loc) · 692 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
#read -p "enter file name to convert:" filename
if [ "$#" -lt 1 ]
then
echo "pass filenames with extension as parameters or continue to convert all found video files of formats mp4, avi and mts"
read -p "[c]ontinue / [A]bort:" choice
if [ "${choice^^}" == "C" ]
then
shopt -s nocaseglob
filenames=$(ls *.mp4 *.avi *.mts)
shopt -u nocaseglob
else
exit 1
fi
else filenames=$@
fi
for filename in $filenames
do
if [ -f "$filename" ]
then
echo "converting $filename"
ffmpeg -i $filename -c:v libtheora -qscale:v 6 -c:a libvorbis -qscale:a 5 ${filename%.*}.ogv
else
echo "$filename not found"
fi
done