Skip to content

Examples Metadata

simonefil edited this page Jul 30, 2026 · 1 revision

Examples: Metadata

Worked preset rules, plus a set of bulk rename recipes at the end. Each rule is written the way the preset editor presents it: scope, IF conditions, THEN operations.

Read Metadata Presets first. Field and token names are catalogued in Metadata Reference.

Remember two things throughout:

  • Rules run in order and each sees the previous rules' output. Where order matters below, it is called out.
  • Always analyze and read the Simulation detail before applying.

1. Container title from the filename

Give every file a container title matching its name.

Description: Container title from filename
Apply to:    Container
IF:          (no conditions, always true)
THEN:        Set container_title = [file_stem]

[file_stem] is the filename without its extension. To strip the extension explicitly instead:

Set container_title = {[file_name]:TrimEnd(4)}

Expect: Bleach - 001 - S01E01.mkv → container title Bleach - 001 - S01E01. Execution stays PropEdit, headers only, seconds per file.


2. Descriptive titles on lossless audio tracks

Turn bare or missing titles into something informative.

Description: Lossless audio title
Apply to:    Audio
IF:          audio_quality Equals lossless
THEN:        Set audio_title =
             [audio_language] - [audio_format] [audio_channels_label] [audio_bitdepth]bit/[audio_sampling_rate_khz]kHz

Expect: a Japanese FLAC 2.0 16-bit 48 kHz track becomes ja - FLAC 2.0 16bit/48kHz.

audio_quality is derived from the format and compression mode, and reports lossless or lossy when it can be determined. A condition on it matches every format the detector recognises, without listing each codec by name.


3. Exactly one default audio per language

Matroska's default flag is meant to be unique, and players behave unpredictably when several tracks claim it. Mark the largest lossless track per language as default and clear the flag on the others.

Description: Default largest lossless audio per language
Apply to:    Audio
IF:          audio_quality Equals lossless
             Track comparison: audio_stream_size Largest in group, group = Same language
THEN:        Set exclusive flag audio_default = true, group = Same language

Expect: for each language, one default audio track and no others. This is what Set exclusive flag exists for. A plain Set field would set the flag without clearing it anywhere else, leaving you with two defaults.

Add audio_language Equals ita to the IF if you only want to fix one language.


4. Forced flag on signs and songs subtitles

Description: Forced signs subtitles
Apply to:    Subtitles
IF:          subtitle_title Contains Signs
THEN:        Set subtitle_forced = true

Expect: any subtitle whose title mentions "Signs" is flagged forced, so players show it automatically alongside the original audio.

This depends on the titles already being meaningful. If they are not, recipe 5 sets them first. Put that rule above this one so this rule sees the titles it created.


5. Distinguish full subtitles from signs by size

Two Italian PGS tracks and no useful titles. The full subtitle track is always substantially larger than a signs-and-songs track, so size tells you which is which.

Rule 1, the larger one:

Description: Italian PGS full subtitle
Apply to:    Subtitles
IF:          subtitle_language Equals ita
             subtitle_format Equals PGS
             subtitle_stream_size Greater than 1, unit = MB
             Track comparison: subtitle_stream_size Largest in group,
                               group = Same language and format
THEN:        Set subtitle_title = ita - Full

Rule 2, the smaller one:

Description: Italian PGS signs subtitle
Apply to:    Subtitles
IF:          subtitle_language Equals ita
             subtitle_format Equals PGS
             Track comparison: subtitle_stream_size Smallest in group,
                               group = Same language and format
THEN:        Set subtitle_title = ita - Signs

Expect: the two tracks get distinct, meaningful titles without you knowing any absolute sizes.

The Greater than 1 MB guard on rule 1 matters: with only one Italian PGS track, that track is simultaneously the largest and the smallest in its group, so both rules would fire. The size floor stops a lone signs track being labelled Full. Note the Unit field, 1 with unit MB rather than a raw byte count.


6. Remove a duplicate lossy audio track

Two Italian audio tracks, one lossless and one a smaller lossy compatibility track you do not want.

Description: Remove smaller Italian lossy duplicate
Apply to:    Audio
IF:          audio_language Equals ita
             audio_quality Equals lossy
             Track comparison: audio_stream_size Smallest in group, group = Same language
THEN:        Remove track

Expect, and this is the important part, the Execution column changes to MkvMerge. Removing a track cannot be done with mkvpropedit, so the whole file is remuxed: minutes per file instead of seconds, and free disk space required.

Put removal rules last in the preset so earlier rules are not carefully setting metadata on a track that is about to disappear.

Analyze and check the Simulation detail before applying this one. Removed tracks are marked with the rule that removed them, so you can confirm it is taking the track you meant.


7. Clear a messy title, then rebuild it

Rules are cumulative, which lets you normalise in two passes. Existing titles are inconsistent junk and you want a uniform scheme.

Rule 1:

Description: Clear messy audio titles
Apply to:    Audio
IF:          audio_title Not empty
THEN:        Clear field audio_title

Rule 2:

Description: Rebuild audio titles
Apply to:    Audio
IF:          audio_format Not empty
THEN:        Set audio_title =
             {[audio_language]:ToUpper()} - {[audio_format]:NormalizeSpaces()} [audio_channels_label]

Expect: ITA - DTS 5.1, consistently, whatever was there before.

Rule 2 conditions on audio_format rather than audio_title because rule 1 has already emptied the titles, so a title-based condition would never match. See rule order.


8. Keep part of the old title

Prefix a title while preserving what it originally said, even if an earlier rule has already changed it.

Description: Prefix original audio title
Apply to:    Audio
IF:          audio_language Equals ita
THEN:        Set audio_title = ITA - [original.audio_title]

[original.audio_title] reads the value from before any rule ran. Plain [audio_title] would read the current pipeline value, which may already have been rewritten upstream.


9. Stamp an encoder tag on every file

Description: Tag encoder
Apply to:    Container
IF:          (no conditions)
THEN:        Set tag ENCODER on File = RemuxForge

Expect: a container-level ENCODER tag on every file.

ENCODER is an advanced tag, so turn on the Advanced fields toggle in the rule to see it in the dropdown. It is also container-only. It cannot be written on an individual track.


10. Clear managed tags on subtitle tracks

Description: Clear managed subtitle tags
Apply to:    Subtitles
IF:          subtitle_language Equals ita
THEN:        Clear managed tags on Current track
             [X] Confirm tag clearing

The confirmation toggle is mandatory. Without it, validation refuses to save with ClearTags requires explicit confirmation. Clearing tags removes data that cannot be recovered from the file, so the confirmation is required.


11. Refresh or delete track statistics tags

Statistics tags (bitrate, duration, frame count per track) go stale after any remux. Two operations handle them:

Description: Refresh track statistics
Apply to:    Audio
IF:          (no conditions)
THEN:        Add/update statistics
Description: Strip track statistics
Apply to:    Audio
IF:          (no conditions)
THEN:        Delete statistics

Expect: refreshing recalculates the tags from the file's real content; deleting removes them. Refresh after remuxing elsewhere; delete if you prefer clean files or want to shrink the header.


12. Set the language on undefined tracks

Files with und tracks confuse players and media servers.

Description: Undefined audio is Japanese
Apply to:    Audio
IF:          OR alternatives:
               audio_language Equals und
               audio_language Is empty
THEN:        Set audio_language = jpn

Expect: untagged tracks become jpn.

Apply this only where the language is known, for example a folder of Japanese-audio releases. RemuxForge cannot detect a spoken language, so the rule writes whatever value it is given.

The OR alternatives group is needed because und and an outright empty value are two different states and either can occur.

Set the IETF field too if your player uses it:

THEN:        Set audio_language = jpn
             Set audio_language_ietf = ja

13. Normalise with an OR alternative

Set the title ita - Full when either the existing title already says so, or the track is large enough that it must be the full one.

Description: Normalize Italian full subtitle title
Apply to:    Subtitles
IF:          subtitle_language Equals ita
             OR alternatives:
               subtitle_title Contains Full
               subtitle_stream_size Greater than 5, unit = MB
THEN:        Set subtitle_title = ita - Full

Expect: one rule covers both the already-labelled and the unlabelled case. The outer list is an AND, so the language condition still has to hold.


14. Convert a two-letter language into a LANGUAGE tag

MediaInfo often reports track languages as two-letter codes, but the Matroska LANGUAGE tag must be ISO 639-2.

Description: Language tag from track language
Apply to:    Audio
IF:          audio_language Not empty
THEN:        Set tag LANGUAGE on Current track =
             {[audio_language]:ToLower():Replace("en","eng"):Replace("it","ita"):Replace("ja","jpn")}

Expect: itita, jajpn.

Extend the chain with the languages present in the library. If the values are already three-letter codes, use {[audio_language]:ToLower()} on its own.


Bulk rename recipes

These use Bulk Rename (F11 in Metadata mode after a scan), not preset rules. Methods stack, and each operates on what the previous one produced.

Remove release tags

[SubGroup] Bleach - 366 [1080p][x265].mkvBleach - 366.mkv

# Method Settings
1 Remove Mode By pattern, Pattern \[[^\]]*\], Use regex on
2 Trim Chars -_, Location Both, Scope Name only

Step 1 deletes every bracketed group; step 2 cleans up the separators left behind at the ends.

Dots to spaces

Bleach.S12E08.1080p.BluRay.mkvBleach S12E08 1080p BluRay.mkv

# Method Settings
1 Replace Search \.(?=.*\.), Replace , Use regex on

The lookahead is the trick: Replace works on the whole filename including the extension, so a naive . would also eat the dot before mkv. \.(?=.*\.) only matches dots that have another dot after them, leaving the extension separator alone.

Renumber to continue a season

Four files that should be episodes 214–217.

# Method Settings
1 New Name Pattern Bleach.S12E<Inc:214:1:3>.<Ext>

<Inc:start:step:pad>, starting at 214, step 1, padded to 3 digits. Numbering follows the scanned list order, so check the preview before renaming; if the order is wrong, the numbers will be too.

Unify capitalisation

BLEACH.S12E08.MKVBleach.S12e08.mkv

# Method Settings
1 New Case Mode Title Case, Scope Name only
2 New Case Mode lowercase, Scope Extension only

Title Case lowercases the value first, then capitalises each word, so all-caps names are normalised rather than left unchanged.

Add a series prefix

366.mkvBleach - 366.mkv

# Method Settings
1 Add Text Bleach - , Position 0

Add works on the name only, so the extension is untouched.

Fix zero-padding so Remux mode can match

Remux mode compares episode IDs as strings, so S12E8 and S12E08 do not pair. Normalise one side:

# Method Settings
1 Replace Search E(\d)(?!\d), Replace E0$1, Use regex on

E followed by exactly one digit becomes E0<digit>. See Remux Mode.

Trailing text off the end

Bleach - 366 - WEBRip.mkvBleach - 366.mkv

# Method Settings
1 Remove Mode By pattern, Pattern - WEBRip, Use regex off

For a fixed number of characters instead, use Mode By position with From end on.


Next

Clone this wiki locally