Skip to main content

Track Sorter

FFmpeg Builder: Track Sorter

This flow element will sort the audio and subtitles tracks given the parameters and update the order in FFmpeg Builder.

When FFmpeg Builder: Executor is run the tracks will be written in the order specified.

Deleted Tracks

Deleted tracks are always sorted after non-deleted tracks. This is the very first sort done.

Type

The type of tracks that should be reordered

Set Default

When this is enabled, the first track (audio or subtitle) will be set as the default track of its type.
Even if the the tracks do not get re-ordered, the first track will be now marked as default.

Sorters

SorterTypeSubtitleAudio
BitrateNumeric
ChannelsNumeric
CodecString
LanguageString
TitleString
tip

The Reversed variant of each sorter just reverses the order the sorter would usually sort the values in. For example, Bitrate Reversed with no sort value would sort the bitrates greatest to smallest.

No Value

If no value is entered for the sorter, then the sorting is based on the value

Numeric values (Bitrate, Channels) will be sorted by their respective values

Strings (Codec, Language) will be sorted alphabetically.

Value

If a sorter has a value set, then the sorting is done as matching vs not matching.

So if the track matches the sorter, it will be sorted before a track that does not match the sorter.

String Sorting

String values are sorting using String Operations

Numeric Operations

Numeric values are sorting using Math

Languages

Languages are sorted using Language Comparison


Outputs

  1. Tracks have been reordered in FFmpeg Builder
  2. Tracks have NOT been reordered

Examples

FieldValueDescription
Channels>=5.1First sort the tracks so any that have channels greater or equal to 5.1 are first
LanguageorigNext move order by original langauge
Bitrate ReversedNo value set, so order the bitrate in descending order

So this example could produce, if the original language was German

ChannelsLanguageBitrateReason
5.1deu100000Greater than/equal 5.1, is German
7.1fre10000Greater than/equal 5.1
4.0ger100000is German
2.0jpn10000000Highest bitrate of remaining tracks
5.0eng100000