zero9999
18th February 2014, 20:13
Seeing as how another GUI for (more or less conveniently) extracting Matroska files has popped up lately while the mkvtoolnix command line tools still appear do be designed to be as confusing and cumbersome as possible, I'd like to offer you a PowerShell module i wrote a while ago to provide a means for batch extracting mkv files.
Download
Latest Release: MkvTools v0.2 (https://github.com/line0/MkvTools/releases/download/0.2/MkvTools-0.2.0.zip)
MkvTools on GitHub (https://github.com/line0/MkvTools)
Requirements
PowerShell 3.0+ (shipped with Windows 7 and up)
MKVToolNix 6.3.0+ (must be available from your PATH environment variable)
Installation
Unpack the MkvTools archive into: %userprofile%\Documents\WindowsPowerShell\Modules.
Usage
Extract-Mkv
Extract-Mkv batch extracts tracks, attachments, chapters and timecodes from Matroska files using the mkvtoolnix command line tools.
Extract-Mkv accepts a comma-delimited list of input files and/or folders (recursing supported) and by default extracts all tracks from each input file using a configurable naming pattern. It also allows you to specify which track types or track IDs to extract and lets you choose a custom output directory if you don't want it to extract into the parent directory of the input files.
Extract-Mkv can extract tracks, attachments, chapters and timecodes in one go, will indicate progress using status bars where possible and returns track/attachment tables that highlight what is being extracted.
For examples and information on command line parameters, run:
Get-Help Extract-Mkv -detailed
Get-MkvInfo
Get-MkvInfo runs mkvinfo to get information about the contents of a Matroska file and formats it into an object for further processing.
Get-MkvInfo takes a Matroska (*.mkv, *.mka, *.mks) as an input and returns a custom object containing general information about the file as well as a list of tracks and a list of attachments. The returned object also exposes a number of Methods to filter the track and attachment lists.
Get-MkvInfo uses CodecId.xml and FourCC.xml to provide user friendly video/audio/subtitle codec information.
Format-MkvInfoTable
Format-MkvInfoTable outputs a formatted table with important information about the tracks and attachments of a Matroska file.
Format-MkvInfoTable takes objects returned by Get-MkvInfo and lets you outputs a configurable set of tables. Being a filter it is designed to receive objects from the pipe and will stream formatted tables as the objects are coming in.
Setting _ExtractStateTracks (tracks) or _ExtractState (attachments) to [int]1 will set the EX flag which highlights the row of the flagged track. Type "Get-Help Extract-Mkv -full" and refer to the -ReturnMkvInfo parameter for more information on extraction flags.
For examples and information on command line parameters, run:
Get-Help Format-MkvInfoTable -detailed
Download
Latest Release: MkvTools v0.2 (https://github.com/line0/MkvTools/releases/download/0.2/MkvTools-0.2.0.zip)
MkvTools on GitHub (https://github.com/line0/MkvTools)
Requirements
PowerShell 3.0+ (shipped with Windows 7 and up)
MKVToolNix 6.3.0+ (must be available from your PATH environment variable)
Installation
Unpack the MkvTools archive into: %userprofile%\Documents\WindowsPowerShell\Modules.
Usage
Extract-Mkv
Extract-Mkv batch extracts tracks, attachments, chapters and timecodes from Matroska files using the mkvtoolnix command line tools.
Extract-Mkv accepts a comma-delimited list of input files and/or folders (recursing supported) and by default extracts all tracks from each input file using a configurable naming pattern. It also allows you to specify which track types or track IDs to extract and lets you choose a custom output directory if you don't want it to extract into the parent directory of the input files.
Extract-Mkv can extract tracks, attachments, chapters and timecodes in one go, will indicate progress using status bars where possible and returns track/attachment tables that highlight what is being extracted.
For examples and information on command line parameters, run:
Get-Help Extract-Mkv -detailed
Get-MkvInfo
Get-MkvInfo runs mkvinfo to get information about the contents of a Matroska file and formats it into an object for further processing.
Get-MkvInfo takes a Matroska (*.mkv, *.mka, *.mks) as an input and returns a custom object containing general information about the file as well as a list of tracks and a list of attachments. The returned object also exposes a number of Methods to filter the track and attachment lists.
Get-MkvInfo uses CodecId.xml and FourCC.xml to provide user friendly video/audio/subtitle codec information.
Format-MkvInfoTable
Format-MkvInfoTable outputs a formatted table with important information about the tracks and attachments of a Matroska file.
Format-MkvInfoTable takes objects returned by Get-MkvInfo and lets you outputs a configurable set of tables. Being a filter it is designed to receive objects from the pipe and will stream formatted tables as the objects are coming in.
Setting _ExtractStateTracks (tracks) or _ExtractState (attachments) to [int]1 will set the EX flag which highlights the row of the flagged track. Type "Get-Help Extract-Mkv -full" and refer to the -ReturnMkvInfo parameter for more information on extraction flags.
For examples and information on command line parameters, run:
Get-Help Format-MkvInfoTable -detailed