-
Notifications
You must be signed in to change notification settings - Fork 9
/
main.py
50 lines (40 loc) · 987 Bytes
/
main.py
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
41
42
43
44
45
46
47
48
49
50
# -*- coding: utf-8 -*-
import logging
import audio_processing
from utils import delete_temp_files
from cli import parse_args
from silence_detection import (
identify_silence_clips,
remove_silence_intervals
)
from video_processing import (
convert_output_video
)
def main():
delete_temp_files()
logging.basicConfig(filename='debug.log', level=logging.DEBUG)
args = parse_args()
try:
with open(args.file):
pass
except FileNotFoundError:
print(f'{args.file} not found')
return
identify_silence_clips(
args.file,
args.silence_sensitivity,
args.time_of_silence_in_seconds,
is_debug_mode=args.is_debug_mode,
)
remove_silence_intervals(
args.file,
'silence_to_remove.txt',
is_debug_mode=args.is_debug_mode
)
convert_output_video(
"output.mp4",
"final.mov"
)
logging.shutdown()
if __name__ == '__main__':
main()