qqwjq1981 commited on
Commit
c63dd84
·
verified ·
1 Parent(s): 80bf303

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
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
- subtitle_font_size = video.h // 15 # 1/15th of video height (you can tweak this for better results)
203
-
 
204
  # Set maximum width for subtitle wrapping (80% of video width)
205
- max_subtitle_width = video.w * 0.8 # Adjust this value as needed for wrapping
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