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 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
Sorter | Type | Subtitle | Audio |
---|---|---|---|
Bitrate | Numeric | ✅ | |
Channels | Numeric | ✅ | |
Codec | String | ✅ | ✅ |
Language | String | ✅ | ✅ |
Title | String | ✅ | ✅ |
Default | Boolean | ✅ | ✅ |
Forced | Boolean | ✅ |
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
Boolean Sorters
For Default
and Forced
properties, use true
(or 1
) to prioritize tracks where the flag is enabled. Use false
(or 0
) to push those tracks lower in the sort order.
Default = true
→ Tracks marked as default will be sorted firstDefault = false
→ Tracks marked as default will be sorted lastForced = true
→ Forced subtitle tracks will be sorted firstForced = false
→ Forced subtitle tracks will be sorted last
Audio tracks do not support the Forced
flag.
Including Forced
in a sort will not affect the sort order of audio tracks.
Languages
Languages are sorted using Language Comparison
Outputs
- Tracks have been reordered in
FFmpeg Builder
- Tracks have NOT been reordered
Examples
Field | Value | Description |
---|---|---|
Channels | >=5.1 | First sort the tracks so any that have channels greater or equal to 5.1 are first |
Language | orig | Next move order by original langauge |
Bitrate Reversed | No value set, so order the bitrate in descending order |
So this example could produce, if the original language was German
Channels | Language | Bitrate | Reason |
---|---|---|---|
5.1 | deu | 100000 | Greater than/equal 5.1 , is German |
7.1 | fre | 10000 | Greater than/equal 5.1 |
4.0 | ger | 100000 | is German |
2.0 | jpn | 10000000 | Highest bitrate of remaining tracks |
5.0 | eng | 100000 |