Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/burn/render_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,21 @@ def render_video(video_path):
srt_path = original_video_path[:-4] + ".srt"
jsonl_path = original_video_path[:-4] + ".jsonl"

# Recoginze the resolution of video
resolution_x, resolution_y = get_resolution(original_video_path)
try:
# Recoginze the resolution of video
resolution_x, resolution_y = get_resolution(original_video_path)
# Process the danmakus to ass and remove emojis
subtitle_font_size, subtitle_margin_v = process_danmakus(
xml_path, resolution_x, resolution_y
)
except TypeError as e:
scan_log.error(f"TypeError: {e} - Check the return value of process_danmakus")
except FileNotFoundError as e:
scan_log.error(f"FileNotFoundError: {e} - Check if the file exists")
# except TypeError as e:
# scan_log.error(f"TypeError: {e} - Check the return value of process_danmakus")
# except FileNotFoundError as e:
# scan_log.error(f"FileNotFoundError: {e} - Check if the file exists")
except Exception as e:
scan_log.error(f"Error in process_danmakus: {e}")
subtitle_font_size = "16"
subtitle_margin_v = "60"

# Generate the srt file via whisper model
if MODEL_TYPE != "pipeline":
Expand Down