artificialguybr commited on
Commit
7117787
·
1 Parent(s): 787cfe2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -100,6 +100,7 @@ def process_video(Video, target_language):
100
  # Debugging: Validate FFmpeg command for subtitle embedding
101
  print("Validating FFmpeg command for subtitle embedding...")
102
  print(f"Translated SRT file: {transcript_file}")
 
103
  with open(transcript_file, 'r', encoding='utf-8') as f:
104
  print(f"First few lines of translated SRT: {f.readlines()[:10]}")
105
  if os.path.exists(transcript_file):
@@ -108,7 +109,7 @@ def process_video(Video, target_language):
108
  print(f"{transcript_file} does not exist.")
109
  #transcript_file_abs_path = os.path.abspath(transcript_file)
110
  try:
111
- result = subprocess.run(["ffmpeg", "-i", Video, "-vf", f"subtitles={transcript_file}", output_video], capture_output=True, text=True)
112
  if result.returncode == 0:
113
  print("FFmpeg executado com sucesso.")
114
  else:
 
100
  # Debugging: Validate FFmpeg command for subtitle embedding
101
  print("Validating FFmpeg command for subtitle embedding...")
102
  print(f"Translated SRT file: {transcript_file}")
103
+
104
  with open(transcript_file, 'r', encoding='utf-8') as f:
105
  print(f"First few lines of translated SRT: {f.readlines()[:10]}")
106
  if os.path.exists(transcript_file):
 
109
  print(f"{transcript_file} does not exist.")
110
  #transcript_file_abs_path = os.path.abspath(transcript_file)
111
  try:
112
+ result = subprocess.run(["ffmpeg", "-i", Video, "-vf", f"subtitles={transcript_file}:force_style='FontName=Arial Unicode MS'", output_video], capture_output=True, text=True)
113
  if result.returncode == 0:
114
  print("FFmpeg executado com sucesso.")
115
  else: