Commit
·
9e23844
1
Parent(s):
2ebc61b
fixed os path split issue.
Browse files- utils/process_video.py +4 -2
utils/process_video.py
CHANGED
|
@@ -19,8 +19,10 @@ def process_video(invideo_filename:str,
|
|
| 19 |
bg_color:str,
|
| 20 |
text_color:str
|
| 21 |
):
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
| 24 |
if srt_path:
|
| 25 |
subtitler(invideo_filename, srt_path, OUTVIDEO_PATH, fontsize, font, bg_color, text_color)
|
| 26 |
return OUTVIDEO_PATH
|
|
|
|
| 19 |
bg_color:str,
|
| 20 |
text_color:str
|
| 21 |
):
|
| 22 |
+
invideo_filename = os.path.normpath(invideo_filename)
|
| 23 |
+
invideo_path_parts = invideo_filename.split(os.path.sep)
|
| 24 |
+
VIDEO_NAME = invideo_path_parts[-1]
|
| 25 |
+
OUTVIDEO_PATH = os.path.join(invideo_path_parts[-3], invideo_path_parts[-2], f"result_{VIDEO_NAME}")
|
| 26 |
if srt_path:
|
| 27 |
subtitler(invideo_filename, srt_path, OUTVIDEO_PATH, fontsize, font, bg_color, text_color)
|
| 28 |
return OUTVIDEO_PATH
|