From 6f48e63dddc540c8a895c64c60d24e880b82df3c Mon Sep 17 00:00:00 2001 From: Xpl0itU Date: Wed, 28 Dec 2022 15:19:47 +0100 Subject: [PATCH] Improve bitrate --- video_creation/final_video.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/video_creation/final_video.py b/video_creation/final_video.py index a3cbe9d..d502b2f 100755 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -50,7 +50,7 @@ def name_normalize(name: str) -> str: def prepare_background(reddit_id: str, W: int, H: int) -> str: output_path = f"assets/temp/{reddit_id}/background_noaudio.mp4" - output = ffmpeg.input(f"assets/temp/{reddit_id}/background.mp4").filter('crop', "ih*(9/16)", "ih").output(output_path, an=None, **{"c:v": "h264"}).overwrite_output() + output = ffmpeg.input(f"assets/temp/{reddit_id}/background.mp4").filter('crop', "ih*(9/16)", "ih").output(output_path, an=None, **{"c:v": "h264", "b:v": "5M", "b:a": "192k"}).overwrite_output() output.run() return output_path @@ -159,7 +159,7 @@ def make_final_video( filename = f"{name_normalize(title)[:251]}" subreddit = settings.config["reddit"]["thread"]["subreddit"] - final = ffmpeg.output(video, audio, f"results/{subreddit}/{filename}.mp4", f='mp4', **{"c:v": "h264"}).overwrite_output() + final = ffmpeg.output(video, audio, f"results/{subreddit}/{filename}.mp4", f='mp4', **{"c:v": "h264", "b:v": "5M", "b:a": "192k"}).overwrite_output() if not exists(f"./results/{subreddit}"): print_substep("The results folder didn't exist so I made it")