feat(video-builder): adjust screenshot width scaling and add config option

Co-authored-by: Copilot <copilot@github.com>
pull/2558/head
MinhVu2711 5 months ago
parent 2301f9c3b4
commit 967f86bcc3

@ -170,7 +170,11 @@ class ManualVideoBuilder:
# Step 6: Overlay screenshots # Step 6: Overlay screenshots
print_step("🖼️ Overlaying screenshots...") print_step("🖼️ Overlaying screenshots...")
screenshot_width = int((self.W * 45) // 100) # Scale background to final resolution FIRST to avoid scaling issues
background_clip = background_clip.filter("scale", self.W, self.H)
screenshot_width_percent = self.config.get("screenshot_width_percent", 85)
screenshot_width = int((self.W * screenshot_width_percent) // 100)
current_time = 0 current_time = 0
for s in clips: for s in clips:
@ -185,9 +189,6 @@ class ManualVideoBuilder:
) )
current_time += s["audio_duration"] current_time += s["audio_duration"]
# Scale to final resolution
background_clip = background_clip.filter("scale", self.W, self.H)
# Step 7: Render # Step 7: Render
print_step("🎥 Rendering the video...") print_step("🎥 Rendering the video...")
self.output_dir.mkdir(parents=True, exist_ok=True) self.output_dir.mkdir(parents=True, exist_ok=True)

@ -50,6 +50,7 @@ MANUAL_DEFAULTS = {
"background_audio_dir": "assets/backgrounds/audio", "background_audio_dir": "assets/backgrounds/audio",
"background_audio_volume": 0.1, "background_audio_volume": 0.1,
"max_video_length": 120, "max_video_length": 120,
"screenshot_width_percent": 85
} }
# Full default settings.config that TTS engines and shared modules expect. # Full default settings.config that TTS engines and shared modules expect.

Loading…
Cancel
Save