File size: 885 Bytes
c7cbbf8 b6093b0 c564fad c7cbbf8 fc6dd1b 4a21148 c7cbbf8 c564fad 228a3b1 fc6dd1b 0cb486a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import logging, os
from utils.subtitler import subtitler
def process_video(invideo_file: str,
srt_string:str,
srt_json: str,
fontsize:str,
font:str,
bg_color:str,
text_color:str,
highlight_mode: bool,
highlight_color: str,
device_type:str,
temp_dir: 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, srt_json, OUTVIDEO_PATH, fontsize, font, bg_color, text_color, highlight_mode, highlight_color, device_type, temp_dir)
return OUTVIDEO_PATH
|