Spaces:
Running
on
T4
Running
on
T4
artificialguybr
commited on
Commit
•
e304087
1
Parent(s):
d544473
Update app.py
Browse files
app.py
CHANGED
@@ -100,9 +100,10 @@ def process_video(Video, target_language, translate_video):
|
|
100 |
#transcript_file_abs_path = os.path.abspath(transcript_file)
|
101 |
try:
|
102 |
if target_language_code == 'ja': # 'ja' é o código de idioma para o japonês
|
103 |
-
|
104 |
else:
|
105 |
-
|
|
|
106 |
if result.returncode == 0:
|
107 |
print("FFmpeg executado com sucesso.")
|
108 |
else:
|
|
|
100 |
#transcript_file_abs_path = os.path.abspath(transcript_file)
|
101 |
try:
|
102 |
if target_language_code == 'ja': # 'ja' é o código de idioma para o japonês
|
103 |
+
subtitle_style = "FontName=Noto Sans CJK JP,PrimaryColour=&H00FFFF,OutlineColour=&H000000,BackColour=&H80000000,BorderStyle=3,Outline=2,Shadow=1"
|
104 |
else:
|
105 |
+
subtitle_style = "FontName=Arial Unicode MS,PrimaryColour=&H00FFFF,OutlineColour=&H000000,BackColour=&H80000000,BorderStyle=3,Outline=2,Shadow=1"
|
106 |
+
result = subprocess.run(["ffmpeg", "-i", Video, "-vf", f"subtitles={transcript_file}:force_style='{subtitle_style}'", output_video], capture_output=True, text=True)
|
107 |
if result.returncode == 0:
|
108 |
print("FFmpeg executado com sucesso.")
|
109 |
else:
|