forked from chenliTW/video-auto-merge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsplit.sh
38 lines (37 loc) · 1.07 KB
/
split.sh
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
29
30
31
32
33
34
35
36
37
chk=0
while read line
do
if [ "$line" = "---" ]; then
echo "ffmpeg -loglevel warning -stats -i $infile -y $starttime $endtime $outfile &"
ffmpeg -loglevel warning -stats -i $infile -y $starttime $endtime $outfile &
chk=0
elif [ $chk -eq 4 ];then
echo "ffmpeg -loglevel warning -stats -i $infile -y $starttime $endtime $outfile &"
ffmpeg -loglevel warning -stats -i $infile -y $starttime $endtime $outfile &
outfile=`echo $line | tr -d '"'`
chk=2
elif [ $chk -eq 0 ];then
infile=`echo $line | tr -d '"'`
chk=1
elif [ $chk -eq 1 ];then
outfile=`echo $line | tr -d '"'`
chk=2
elif [ $chk -eq 2 ];then
if [ `echo $line | tr -d '"'` == "str" ];then
starttime=""
else
starttime=`echo $line | tr -d '"'`
starttime="-ss $starttime"
fi
chk=3
elif [ $chk -eq 3 ];then
if [ `echo $line | tr -d '"'` == "end" ];then
endtime=""
else
endtime=`echo $line | tr -d '"'`
endtime="-to $endtime"
fi
chk=4
fi
done < $1
wait