Skip to content

External subtitles are not embedded into MKV when transcoding #16403

@LTe

Description

@LTe

Description of the bug

When transcoding to MKV with a device profile that includes SubtitleDeliveryMethod.Embed for MKV containers, external subtitle files (e.g., .srt, .ass) are never embedded into the output MKV. Instead, they are always delivered as external streams regardless of the subtitle profile configuration.

This happens because GetSubtitleProfile() in StreamBuilder excludes external subtitles from Embed consideration entirely due to the !subtitleStream.IsExternal guard. As a result, even when the device profile explicitly requests embedding subtitles into MKV, external subtitle files always fall through to External or Encode delivery.

This is problematic for offline/download playback scenarios where internet access is unavailable — the external subtitle file won't be accessible, leaving the user without subtitles.

Note: embedded (non-external) subtitles are correctly embedded into MKV during transcoding. The issue only affects external subtitle files.

Reproduction steps

  1. Have a media file (e.g., MP4) with an external .srt subtitle file alongside it.
  2. Configure a device profile with subtitle profiles that include Embed method for MKV container (e.g., { Format: "srt", Method: Embed, Container: "mkv" }).
  3. Trigger a transcode to MKV for that media item.
  4. Observe the resulting stream info / ffmpeg command.

What is the current bug behavior?

External subtitles are delivered via SubtitleDeliveryMethod.External even when the device profile specifies SubtitleDeliveryMethod.Embed with an MKV container. The subtitle file is not muxed into the output MKV stream.

What is the expected correct behavior?

When transcoding to MKV and the device profile includes an Embed subtitle profile matching the subtitle format and MKV container, external subtitle files should be embedded (muxed) into the output MKV container. This would make subtitles available for offline playback without needing a separate external file.

DirectPlay and HLS/TS/MP4 transcoding should remain unaffected — embedding external subs should only apply when the output container supports it (MKV/Matroska).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions