Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > New and alternative a/v containers

Reply
 
Thread Tools Search this Thread Display Modes
Old 18th February 2014, 20:13   #1  |  Link
zero9999
Registered User
 
Join Date: Oct 2011
Posts: 52
MkvTools: CLI scripts for convenient batch-extraction using MKVToolNix

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
MkvTools on GitHub

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:

Code:
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:

Code:
Get-Help Format-MkvInfoTable -detailed
zero9999 is offline   Reply With Quote
Old 19th February 2014, 13:39   #2  |  Link
mastrboy
Registered User
 
Join Date: Sep 2008
Posts: 327
Thanks for this, especially Get-MkvInfo.
__________________
(i have a tendency to drunk post)
mastrboy is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 18:01.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.