-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsplit.sh
36 lines (35 loc) · 913 Bytes
/
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
chk=0
while read line
do
if [ "$line" = "---" ]; then
ffmpeg -y -i $infile -vcodec copy -acodec copy $starttime $endtime $outfile &
chk=0
elif [ $chk -eq 4 ];then
ffmpeg -y -i $infile -vcodec copy -acodec copy $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