Commit ·
e93bb43
1
Parent(s): af49b9c
feat: Ultrafast preset for all modules, Text Story margin fix, Quiz Explain box improvements
Browse files
modules/fact_image/services/fact_creator.py
CHANGED
|
@@ -300,7 +300,7 @@ class FactCreator:
|
|
| 300 |
fps=self.FPS,
|
| 301 |
codec='libx264',
|
| 302 |
audio=False, # No audio for fact videos
|
| 303 |
-
preset='
|
| 304 |
ffmpeg_params=[
|
| 305 |
'-pix_fmt', 'yuv420p',
|
| 306 |
'-movflags', '+faststart',
|
|
|
|
| 300 |
fps=self.FPS,
|
| 301 |
codec='libx264',
|
| 302 |
audio=False, # No audio for fact videos
|
| 303 |
+
preset='ultrafast', # Fast export (3-5x faster)
|
| 304 |
ffmpeg_params=[
|
| 305 |
'-pix_fmt', 'yuv420p',
|
| 306 |
'-movflags', '+faststart',
|
modules/quiz_reel/services/quiz_composer.py
CHANGED
|
@@ -208,7 +208,7 @@ class QuizComposer:
|
|
| 208 |
fps=self.FPS,
|
| 209 |
codec="libx264",
|
| 210 |
audio_codec="aac",
|
| 211 |
-
preset="
|
| 212 |
threads=4,
|
| 213 |
logger=None
|
| 214 |
)
|
|
|
|
| 208 |
fps=self.FPS,
|
| 209 |
codec="libx264",
|
| 210 |
audio_codec="aac",
|
| 211 |
+
preset="ultrafast", # Fast export (3-5x faster)
|
| 212 |
threads=4,
|
| 213 |
logger=None
|
| 214 |
)
|
modules/quiz_reel/services/quiz_frame.py
CHANGED
|
@@ -622,7 +622,7 @@ class QuizFrameGenerator:
|
|
| 622 |
box_x1 = (self.WIDTH - box_width) // 2
|
| 623 |
box_x2 = box_x1 + box_width
|
| 624 |
box_y1 = heading_y - 20 # Above heading
|
| 625 |
-
box_y2 = explain_text_y + 30 + explain_height + box_padding_y +
|
| 626 |
|
| 627 |
# Draw white rounded rectangle background
|
| 628 |
self._draw_rounded_rect(draw, (box_x1, box_y1, box_x2, box_y2),
|
|
@@ -637,6 +637,15 @@ class QuizFrameGenerator:
|
|
| 637 |
text_x = (self.WIDTH - explain_width) // 2
|
| 638 |
draw.multiline_text((text_x, explain_text_y + 30), wrapped_explain,
|
| 639 |
fill=explain_text_color, font=explain_font, align="center")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 640 |
|
| 641 |
# Bottom right removed (was sparkle icon)
|
| 642 |
|
|
|
|
| 622 |
box_x1 = (self.WIDTH - box_width) // 2
|
| 623 |
box_x2 = box_x1 + box_width
|
| 624 |
box_y1 = heading_y - 20 # Above heading
|
| 625 |
+
box_y2 = explain_text_y + 30 + explain_height + box_padding_y + 70 # +50px more at bottom
|
| 626 |
|
| 627 |
# Draw white rounded rectangle background
|
| 628 |
self._draw_rounded_rect(draw, (box_x1, box_y1, box_x2, box_y2),
|
|
|
|
| 637 |
text_x = (self.WIDTH - explain_width) // 2
|
| 638 |
draw.multiline_text((text_x, explain_text_y + 30), wrapped_explain,
|
| 639 |
fill=explain_text_color, font=explain_font, align="center")
|
| 640 |
+
|
| 641 |
+
# Draw colored underline below explain text
|
| 642 |
+
underline_y = explain_text_y + 30 + explain_height + 15
|
| 643 |
+
underline_width = min(explain_width + 40, int(self.WIDTH * 0.7))
|
| 644 |
+
underline_x1 = (self.WIDTH - underline_width) // 2
|
| 645 |
+
underline_x2 = underline_x1 + underline_width
|
| 646 |
+
underline_color = (56, 189, 248) # Cyan/teal color
|
| 647 |
+
draw.line([(underline_x1, underline_y), (underline_x2, underline_y)],
|
| 648 |
+
fill=underline_color, width=4)
|
| 649 |
|
| 650 |
# Bottom right removed (was sparkle icon)
|
| 651 |
|
modules/story_reels/services/story_creator.py
CHANGED
|
@@ -686,7 +686,7 @@ class StoryCreator:
|
|
| 686 |
codec='libx264',
|
| 687 |
audio_codec='aac',
|
| 688 |
threads=4,
|
| 689 |
-
preset='
|
| 690 |
ffmpeg_params=[
|
| 691 |
'-pix_fmt', 'yuv420p', # Browser compatible pixel format
|
| 692 |
'-movflags', '+faststart', # Enable streaming/progressive download
|
|
|
|
| 686 |
codec='libx264',
|
| 687 |
audio_codec='aac',
|
| 688 |
threads=4,
|
| 689 |
+
preset='ultrafast', # Fast export (3-5x faster)
|
| 690 |
ffmpeg_params=[
|
| 691 |
'-pix_fmt', 'yuv420p', # Browser compatible pixel format
|
| 692 |
'-movflags', '+faststart', # Enable streaming/progressive download
|
modules/text_story/services/renderer.py
CHANGED
|
@@ -27,8 +27,8 @@ CANVAS_HEIGHT = 1920
|
|
| 27 |
|
| 28 |
LAYOUT = {
|
| 29 |
"top_margin": 500, # 26% from top (moved up 8-10% from original 35%)
|
| 30 |
-
"side_margin":
|
| 31 |
-
"chat_box_width":
|
| 32 |
"chat_box_radius": 35, # Rounded corners
|
| 33 |
"header_height": 100, # Header with avatar + name + status
|
| 34 |
"max_chat_height": 1100, # Maximum height of chat box
|
|
|
|
| 27 |
|
| 28 |
LAYOUT = {
|
| 29 |
"top_margin": 500, # 26% from top (moved up 8-10% from original 35%)
|
| 30 |
+
"side_margin": 53, # +3 pixel more side margin (left/right)
|
| 31 |
+
"chat_box_width": 974, # Slightly narrower card (1080 - 53*2)
|
| 32 |
"chat_box_radius": 35, # Rounded corners
|
| 33 |
"header_height": 100, # Header with avatar + name + status
|
| 34 |
"max_chat_height": 1100, # Maximum height of chat box
|
modules/text_story/services/video_composer.py
CHANGED
|
@@ -187,7 +187,7 @@ class VideoComposer:
|
|
| 187 |
fps=30,
|
| 188 |
codec="libx264",
|
| 189 |
audio_codec="aac",
|
| 190 |
-
preset="
|
| 191 |
threads=4,
|
| 192 |
logger=None # Suppress MoviePy logs
|
| 193 |
)
|
|
|
|
| 187 |
fps=30,
|
| 188 |
codec="libx264",
|
| 189 |
audio_codec="aac",
|
| 190 |
+
preset="ultrafast", # Fast export (3-5x faster)
|
| 191 |
threads=4,
|
| 192 |
logger=None # Suppress MoviePy logs
|
| 193 |
)
|