Spaces:
Paused
Paused
Commit ·
99202f6
1
Parent(s): 640aa41
Update app.py
Browse files
app.py
CHANGED
|
@@ -90,17 +90,17 @@ def process_video(Video, target_language):
|
|
| 90 |
print(f"{transcript_file} exists.")
|
| 91 |
else:
|
| 92 |
print(f"{transcript_file} does not exist.")
|
|
|
|
| 93 |
try:
|
| 94 |
-
transcript_file_abs_path = os.path.abspath(transcript_file)
|
| 95 |
result = subprocess.run(["ffmpeg", "-i", Video, "-vf", f"subtitles={transcript_file_abs_path}", output_video], capture_output=True, text=True)
|
| 96 |
if result.returncode == 0:
|
| 97 |
-
print("FFmpeg
|
| 98 |
else:
|
| 99 |
-
print(f"FFmpeg
|
| 100 |
print("Stdout:", result.stdout)
|
| 101 |
print("Stderr:", result.stderr)
|
| 102 |
except Exception as e:
|
| 103 |
-
print(f"
|
| 104 |
print("process_video concluído com sucesso")
|
| 105 |
os.unlink(audio_file)
|
| 106 |
os.unlink(transcript_file)
|
|
|
|
| 90 |
print(f"{transcript_file} exists.")
|
| 91 |
else:
|
| 92 |
print(f"{transcript_file} does not exist.")
|
| 93 |
+
transcript_file_abs_path = os.path.abspath(transcript_file)
|
| 94 |
try:
|
|
|
|
| 95 |
result = subprocess.run(["ffmpeg", "-i", Video, "-vf", f"subtitles={transcript_file_abs_path}", output_video], capture_output=True, text=True)
|
| 96 |
if result.returncode == 0:
|
| 97 |
+
print("FFmpeg executado com sucesso.")
|
| 98 |
else:
|
| 99 |
+
print(f"FFmpeg falhou com o código de retorno {result.returncode}.")
|
| 100 |
print("Stdout:", result.stdout)
|
| 101 |
print("Stderr:", result.stderr)
|
| 102 |
except Exception as e:
|
| 103 |
+
print(f"Ocorreu uma exceção: {e}")
|
| 104 |
print("process_video concluído com sucesso")
|
| 105 |
os.unlink(audio_file)
|
| 106 |
os.unlink(transcript_file)
|