Skip to content

Commit

Permalink
use video FPS if subtitle has no FPS defined
Browse files Browse the repository at this point in the history
  • Loading branch information
getzze committed Feb 14, 2025
1 parent cfd7782 commit 51b4de0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/subliminal/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,9 @@ def save_subtitles(

# convert subtitle to a new format
if subtitle_format:
subtitle.convert(subtitle_format, output_encoding=encoding)
# Use the video FPS if the FPS of the subtitle is not defined
fps = video.frame_rate if subtitle.fps is None else None
subtitle.convert(subtitle_format, output_encoding=encoding, fps=fps)

# create subtitle path
subtitle_path = subtitle.get_path(
Expand Down

0 comments on commit 51b4de0

Please sign in to comment.