Update app.py
Browse files
app.py
CHANGED
|
@@ -199,10 +199,11 @@ def add_transcript_to_video(video_path, translated_json, output_path):
|
|
| 199 |
logger.debug("Full translated_json: %s", translated_json)
|
| 200 |
|
| 201 |
# Define relative font size based on video height (adjust this value as necessary)
|
| 202 |
-
|
| 203 |
-
|
|
|
|
| 204 |
# Set maximum width for subtitle wrapping (80% of video width)
|
| 205 |
-
max_subtitle_width = video.w * 0.8 #
|
| 206 |
|
| 207 |
font_path = "./NotoSansSC-Regular.ttf"
|
| 208 |
|
|
|
|
| 199 |
logger.debug("Full translated_json: %s", translated_json)
|
| 200 |
|
| 201 |
# Define relative font size based on video height (adjust this value as necessary)
|
| 202 |
+
# Define relative font size based on video height (adjust this value as necessary)
|
| 203 |
+
subtitle_font_size = int(video.h // 15) # Ensure it's an integer
|
| 204 |
+
|
| 205 |
# Set maximum width for subtitle wrapping (80% of video width)
|
| 206 |
+
max_subtitle_width = int(video.w * 0.8) # Ensure it's an integer
|
| 207 |
|
| 208 |
font_path = "./NotoSansSC-Regular.ttf"
|
| 209 |
|