Project

mkv

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Simple wrapper around MKVToolNix's mkvinfo utility to get data from MKV movies, and mkvextract to extract subtitles.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 0.9.2
~> 2.7
 Project Readme

MKV

Simple wrapper around MKVToolNix's mkvinfo utility to get data from MKV movies, and mkvextract to extract subtitles.

Installation

(sudo) gem install mkv

This version is tested against MKVToolNix 5.8.0 build 2012-09-02-6920. So no guarantees with earlier versions.

Usage

Require the gem

require 'rubygems'
require 'mkv'

Reading Metadata

movie = MKV::Movie.new("path/to/movie.mkv")

track = movie.tracks.first # Contains all streams

track.type # video, audio, or subtitles
track.uid 
track.number
track.mkv_info_id
track.lacing 
track.codec_id

# For video tracks
track.width 
track.height

# For audio
track.sampling_frequency
track.channels

# For subtitle & audio tracks
track.language # ISO 639-3
track.enabled
track.default
track.forced

Specify the path to mkvinfo and mkvextract

By default, streamio assumes that the mkvinfo and mkvextract binaries are available in the default installation paths:

On Mac OSX:

MKV.mkvinfo_binary = "/Applications/Mkvtoolnix.app/Contents/MacOS/mkvinfo"
MKV.mkvextrack_binary = "/Applications/Mkvtoolnix.app/Contents/MacOS/mkvextract"

On Windows: TODO!

Copyright

Copyright (c) 2012 Pedro Rodrigues. See LICENSE for details.