Skip to content

v1.4.1 — Playback synchronization & subtitle reliability

Latest

Choose a tag to compare

@vitobotta vitobotta released this 09 Jul 22:56
62a2945

Summary

This patch release fixes two recurring streaming problems: audio gradually moving out of sync with video, and subtitles frequently failing to load or appear after resuming, seeking, reconnecting, or changing playback paths.

Audio/video synchronization

  • Re-encodes video after a non-zero seek instead of copying from the preceding keyframe. This keeps video aligned with accurately trimmed audio during resume, seek, and recovery operations.
  • Normalizes all audio to AAC and continuously reconciles samples with source timestamps using asynchronous resampling.
  • Pads or trims the beginning of audio onto the same zero-based timeline as video.
  • Generates missing presentation timestamps at the input so both HLS and fragmented MP4 output receive consistent timing.

Subtitle reliability

  • Uses the browser's absolute media time during native direct play, preventing resume offsets from being added twice to subtitle requests, progress, and seek calculations.
  • Loads track metadata before starting iOS HLS playback so subtitle controls and burn-in choices are available.
  • Passes selected bitmap subtitle tracks to HLS and switches native direct play to the transcode path when image-based subtitles need to be burned into the video.
  • Keeps text subtitles in the HTML overlay path and reloads them after seeks, reconnects, and stream restarts.
  • Cancels stale subtitle requests and invalidates cleared cue windows so an empty overlay cannot incorrectly be treated as already loaded.
  • Extends packet extraction time for slower remote files and reports extraction timeouts as retryable errors instead of treating them as genuinely empty subtitle windows.
  • Preserves the absolute playhead when direct play falls back to transcoding.

Verification

  • 365 Rails examples passing
  • 6 JavaScript controller regression tests passing
  • RuboCop clean

Full changelog: v1.4.0...v1.4.1