srt.tools.mux

Merge multiple subtitles with similar start/end times into one.

mux(subs, acceptable_diff, attr, width)

Merges subs with similar start/end times together (in-place). This prevents subtitles from jumping around the screen.

Parameters
  • subsSubtitle objects

  • acceptable_diff (datetime.timedelta) – The amount of milliseconds a subtitle start time must be to shift.

  • attr (str) –

  • width (int) – The amount of subtitles to consider for time matching at once.

Return type

generator of Subtitle objects