File size: 710 Bytes
c564fad
b6093b0
 
c564fad
0cb486a
b6093b0
8cdcb92
b6093b0
2dcfc88
0cb486a
b6093b0
c564fad
 
 
228a3b1
 
0cb486a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import logging, os
from utils.subtitler import subtitler

def process_video(invideo_file: str,
                  srt_string:str,
                  fontsize:str,
                  font:str,
                  bg_color:str,
                  text_color:str,
                  caption_mode:str
                  ):
    invideo_path_parts = os.path.normpath(invideo_file).split(os.path.sep)
    VIDEO_NAME = os.path.basename(invideo_file)
    OUTVIDEO_PATH = os.path.join(os.path.normpath('/'.join(invideo_path_parts[:-1])), f"result_{VIDEO_NAME}")
    logging.info("Subtitling...")
    subtitler(invideo_file, srt_string, OUTVIDEO_PATH, fontsize, font, bg_color, text_color, caption_mode)
    return OUTVIDEO_PATH