Release 2.13.1

This commit is contained in:
TheCaptain989
2025-04-16 18:52:51 +00:00
parent 40743247fc
commit 53bec57fb1
3 changed files with 102 additions and 41 deletions
+33 -2
View File
@@ -219,7 +219,7 @@ Option|Argument|Description
---|---|---
`-a`, `--audio`|`<audio_languages>`|Audio languages to keep<br/>ISO 639-2 code(s) prefixed with a colon (`:`)<br/>Each code may optionally be followed by a plus (`+`) and one or more [modifiers](#language-code-modifiers).
`-s`, `--subs`|`<subtitle_languages>`|Subtitle languages to keep<br/>ISO 639-2 code(s) prefixed with a colon (`:`)<br/>Each code may optionally be followed by a plus (`+`) and one or more modifiers.
`--reorder`| |Reorder audio and subtitles tracks to match the language code order specified in the `<audio_languages>` and `<subtitle_languages>` arguments.<br/>This is skipped if no tracks are removed.
`--reorder`| |Reorder audio and subtitles tracks to match the language code order specified in the `<audio_languages>` and `<subtitle_languages>` arguments.
`-f`, `--file`|`<video_file>`|If included, the script enters **[Batch Mode](#batch-mode)** and converts the specified video file.<br/>Requires the `--audio` option.<br/>![notes] **Do not** use this argument when called from Radarr or Sonarr!
`-l`, `--log`|`<log_file>`|The log filename<br/>Default is `/config/log/striptracks.txt`
`-c`, `--config`|`<config_file>`|Radarr/Sonarr XML configuration file<br/>Default is `/config/config.xml`
@@ -238,7 +238,7 @@ For example:
...etc.
Multiple codes may be concatenated, such as `:eng:spa` for both English and Spanish. Order is unimportant, unless the `--reorder` option is also specified.
Multiple codes may be concatenated, such as `:eng:spa` for both English and Spanish. Order is unimportant, unless the `--reorder` option is specified.
> [!WARNING]
> If no subtitle language is detected via Radarr/Sonarr configuration or specified on the command-line, all subtitles are removed.
@@ -280,6 +280,37 @@ The `:und` language code is a special code. When used, the script will match on
> [!TIP]
> It is common for M2TS and AVI files to have tracks with unknown languages! It is recommended to include `:und` in most instances unless you know exactly what you're doing.
### Reorder Option
The `--reorder` option uses the order the language codes are specified to re-order the tracks in the output MKV video file. Video tracks are always first, followed by audio tracks, and then subtitles. Track removals and preservations occur the way they normally would.
<details>
<summary>Reorder Example</summary>
For example, given a source video (w/original language of English) that has the following track order:
> Track ID:0 Type:video Name:null Lang:und Codec:AVC/H.264/MPEG-4p10 Default:true Forced:false
> Track ID:1 Type:audio Name:French Lang:fre Codec:E-AC-3 Default:true Forced:false
> Track ID:2 Type:audio Name:German Lang:deu Codec:AC-3 Default:false Forced:false
> Track ID:3 Type:audio Name:English Lang:eng Codec:AC-3 Default:false Forced:false
> Track ID:4 Type:subtitles Name:French Lang:fre Codec:SubRip/SRT Default:false Forced:false
> Track ID:5 Type:subtitles Name:English Lang:eng Codec:SubRip/SRT Default:false Forced:false
And using the command line:
```shell
/usr/local/bin/striptracks.sh --audio :org+1:eng+1:fre+1:und+1 --subs :eng+1:fre+1:spa+1 --reorder
```
Will create an MKV file with tracks:
> Track ID:0 Type:video Name:null Lang:und Codec:AVC/H.264/MPEG-4p10 Default:true Forced:false
> Track ID:1 Type:audio Name:English Lang:eng Codec:AC-3 Default:false Forced:false
> Track ID:2 Type:audio Name:French Lang:fre Codec:E-AC-3 Default:true Forced:false
> Track ID:3 Type:subtitles Name:English Lang:eng Codec:SubRip/SRT Default:false Forced:false
> Track ID:4 Type:subtitles Name:French Lang:fre Codec:SubRip/SRT Default:false Forced:false
</details>
## Special Handling of Audio
The script is smart enough to not remove the last audio track. There is in fact no way to force the script to remove all audio. This way you don't have to specify every possible language if you are importing a foreign film, for example.