Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ flowchart TD

The remux steps rewrite the container and set `ReMuxed`. `RemoveTags()` and `RemoveAttachments()` edit the file in place with MkvPropEdit.

Every step that rewrites the file writes its output through MkvMerge, the lossless timestamp repair excepted. That MkvMerge pass uses `MkvMergeBuilder.InputOptions.Default()`, which drops global tags, track tags, attachments, and buttons. That covers remux, track removal, re-encode, deinterlace, closed caption removal, repair by re-encode, and the cover art remux, the FfMpeg remux fallback included. The pass drops them whatever `RemoveTags` says, so an FfMpeg or HandBrake rewrite does not add tags to the output. The lossless timestamp repair moves the FfMpeg `setts` output over the original with no MkvMerge pass. So it keeps the file's tags and attachments, and can add the tags FfMpeg writes. `RemoveTags` is the explicit removal, and it clears tags and attachments in place with MkvPropEdit. With it off, a file keeps its tags only while no MkvMerge pass rewrites it. The FfProbe and MediaInfo cover art paths clear attachments in place whatever `RemoveTags` says. The FfProbe path also forces `RemoveTags()`, as the cover art flow below shows.

`Convert.ReMuxToMkv()` remuxes the whole file to the `.mkv` name, and a node that names it without a track selection runs this flow. With a track selection, it remuxes once with MkvMerge to `.tmp3`, with no FfMpeg fallback, then moves the output the same way.

```mermaid
Expand Down
2 changes: 2 additions & 0 deletions PlexCleaner/MkvMergeBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public GlobalOptions Add(string option, bool escape)

public class InputOptions(ArgumentsBuilder argumentsBuilder)
{
// Drops tags and attachments whatever RemoveTags says, so a rewrite through MkvMerge never carries tool-added tags.
// ARCHITECTURE.md "Remux and Container Steps" names the rewrite that skips this pass.
public InputOptions Default() => NoGlobalTags().NoTrackTags().NoAttachments().NoButtons();

public InputOptions Identify(string option) => Add("--identify").Add($"\"{option}\"");
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ Refer to [PlexCleaner.defaults.json](PlexCleaner.defaults.json) for complete con

- Re-multiplex non-MKV containers to MKV format.
- `ReMuxExtensions`, `ReMux`
- Remove all tags, titles, thumbnails, cover art, and attachments.
- Remove all tags, titles, thumbnails, cover art, and attachments. A remux or re-encode drops tags and attachments whatever this setting says.
- `RemoveTags`

**3. Track Language and Metadata:**
Expand Down
Loading