Merge pull request #1799 from mubarakalmehairbi/develop-1

Better error handling
pull/1808/head
Simon 1 year ago committed by GitHub
commit cb3f6c7f0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -342,23 +342,27 @@ def make_final_video(
path = ( path = (
path[:251] + ".mp4" path[:251] + ".mp4"
) # Prevent a error by limiting the path length, do not change this. ) # Prevent a error by limiting the path length, do not change this.
ffmpeg.output( try:
background_clip, ffmpeg.output(
final_audio, background_clip,
path, final_audio,
f="mp4", path,
**{ f="mp4",
"c:v": "h264", **{
"b:v": "20M", "c:v": "h264",
"b:a": "192k", "b:v": "20M",
"threads": multiprocessing.cpu_count(), "b:a": "192k",
}, "threads": multiprocessing.cpu_count(),
).overwrite_output().global_args("-progress", progress.output_file.name).run( },
quiet=True, ).overwrite_output().global_args("-progress", progress.output_file.name).run(
overwrite_output=True, quiet=True,
capture_stdout=False, overwrite_output=True,
capture_stderr=False, capture_stdout=False,
) capture_stderr=False,
)
except ffmpeg.Error as e:
print(e.stderr.decode("utf8"))
exit(1)
old_percentage = pbar.n old_percentage = pbar.n
pbar.update(100 - old_percentage) pbar.update(100 - old_percentage)
if allowOnlyTTSFolder: if allowOnlyTTSFolder:

Loading…
Cancel
Save