-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_rounds
40 lines (33 loc) · 1.32 KB
/
get_rounds
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
38
39
40
#!/bin/bash
get_rounds() {
echo "
__ .___ ._.
____ ____ _/ |_ _______ ____ __ __ ____ __| _/ ______ | |
/ ___\ _/ __ \ \ __\ \_ __ \ / _ \ | | \ / \ / __ | / ___/ | |
/ /_/ >\ ___/ | | | | \/( <_> )| | /| | \/ /_/ | \___ \ \|
\___ / \___ > |__| ______ |__| \____/ |____/ |___| /\____ | /____ > __
/_____/ \/ /_____/ \/ \/ \/ \/"
read -p "Enter the clip's name: " clip_name
read -p "How many clips?: " num_clips
for ((i = 1; i <= $num_clips; i++)); do
read -p "Enter start time (hhmmss): " start_time
read -p "Enter end time (hhmmss): " end_time
start_t="${start_time:0:2}:${start_time:2:2}:${start_time:4:2}"
if [[ -z $end_time ]]; then
end_t="-t 180"
else
end_t="-to ${end_time:0:2}:${end_time:2:2}:${end_time:4:2}"
fi
ffmpeg -loglevel error -i ${rip_name} -ss $start_t $end_t -c copy "${clip_name}_${i}.mp4"
echo "Clip #${i} done!"
done
}
check_source() {
if [[ -z $rip_name ]]; then
echo "Error: No input file specified. Usage: ./get_rounds.sh sourcefilename.mp4"
exit
fi
}
rip_name=$1
check_source
get_rounds