This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Credit: https://www.github.com/jwallet | |
function mkv-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)\MKVToolNix\mkvpropedit.exe' --tags all:'' --delete title --edit track:v1 --set language=$lang --edit track:a1 --set language=$lang "$_" } | |
} | |
function to-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)\MKVToolNix\mkvmerge.exe' -o $output --default-language $lang "$_" }; mkv-set-language $lang; | |
} |