Skip to content

Commit

Permalink
Fixed top padding
Browse files Browse the repository at this point in the history
  • Loading branch information
beveradb committed Jan 10, 2025
1 parent 0cf0688 commit f468a4a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lyrics_transcriber/output/ass/lyrics_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ def _create_line_event(self, line: LyricsLine, y_position: int, style: Style, sc
def _calculate_first_line_position(self) -> int:
"""Calculate vertical position of first line."""
total_height = len(self.lines) * self.line_height
return (self.video_size[1] - total_height) // 4
top_padding = self.line_height # Add one line height of padding at the top
return top_padding + (self.video_size[1] - total_height - top_padding) // 4

def __str__(self):
return "\n".join([f"{self.start_ts} - {self.end_ts}:", *[f"\t{line}" for line in self.lines]])
4 changes: 2 additions & 2 deletions lyrics_transcriber/output/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ def generate_outputs(
outputs.lrc = self.lyrics_file.generate_lrc(resized_segments, output_prefix)

# Generate ASS
outputs.ass = self.subtitle.generate_ass(resized_segments[:16], output_prefix)
# outputs.ass = self.subtitle.generate_ass(resized_segments, output_prefix)
# outputs.ass = self.subtitle.generate_ass(resized_segments[:16], output_prefix)
outputs.ass = self.subtitle.generate_ass(resized_segments, output_prefix)

# Generate video if requested
if render_video and outputs.ass:
Expand Down

0 comments on commit f468a4a

Please sign in to comment.