# Credit: https://www.github.com/jwallet |
functionmkv-set-language([string]$lang='eng') { |
Get-ChildItem-Path '.'-Name -Recurse -File -Include *.mkv |ForEach { echo '>>> Getting file: $_'; Set-ItemProperty$_-name IsReadOnly -value $false|&'C:Program Files (x86)MKVToolNixmkvpropedit.exe'--tags all:''--delete title --edit track:v1 --set language=$lang--edit track:a1 --set language=$lang'$_' } |
} |
functionto-mkv([string]$lang='eng') { |
Get-ChildItem-Path '.'-Name -Recurse -File -Include *.avi,*.mp4 |ForEach { echo '>>> Getting file: $_'; $_-match'(?<filename>.*)[.]'; $output=$matches['filename'] +'.mkv'; Set-ItemProperty$_-name IsReadOnly -value $false|&'C:Program Files (x86)MKVToolNixmkvmerge.exe'-o $output--default-language $lang'$_' }; mkv-set-language$lang; |
} |
Functions that collect recursively all videos in a folder to set them to mkv with a new language (default track (first track) only)PLEXUse it for your PLEX server too, so all your tv shows and movies will have more data Requirements
Set the script file
Functions
Before using itChange in the functions the paths related to mkvtoolnix tools to yours Warnings
Troubleshoothing
Know which plex files that don't have the language set yetFeel free to edit the functions as you wish |