Class: MkvToolNix::Modules::MkvExtract
- Inherits:
-
Object
- Object
- MkvToolNix::Modules::MkvExtract
- Includes:
- MkvModule
- Defined in:
- lib/mkvtoolnix/modules/mkvextract.rb
Overview
Instance Attribute Summary collapse
-
#abort_at_warning ⇒ Object
Returns the value of attribute abort_at_warning.
Instance Method Summary collapse
-
#extract_attachments(file, attachments, full_parse_mode: false) ⇒ Object
extracts the selected attachments.
-
#extract_chapters(file, out_file, simple: false, simple_language: nil, full_parse_mode: false) ⇒ Object
extracts the chapter xml file.
-
#extract_cue_sheet(file, out_file, full_parse_mode: false) ⇒ Object
extracts the cue sheet.
-
#extract_cues(file, tracks, full_parse_mode: false) ⇒ Object
extracts the cues of the selected tracks.
-
#extract_tags(file, out_file, full_parse_mode: false) ⇒ Object
extracts the tags xml file.
-
#extract_timestamps(file, tracks, full_parse_mode: false) ⇒ Object
extracts the timestamps of the selected tracks.
-
#extract_tracks(file, tracks, extract_cuesheet: false, raw: false, full_raw: false, full_parse_mode: false) ⇒ Object
extracts the selected tracks.
-
#initialize(bin_path) ⇒ MkvExtract
constructor
A new instance of MkvExtract.
-
#version ⇒ Object
returns the mkvextract version.
Methods included from MkvModule
Constructor Details
#initialize(bin_path) ⇒ MkvExtract
Returns a new instance of MkvExtract.
11 12 13 14 |
# File 'lib/mkvtoolnix/modules/mkvextract.rb', line 11 def initialize(bin_path) @bin_path = "#{bin_path}mkvextract" @abort_at_warning = false end |
Instance Attribute Details
#abort_at_warning ⇒ Object
Returns the value of attribute abort_at_warning.
9 10 11 |
# File 'lib/mkvtoolnix/modules/mkvextract.rb', line 9 def abort_at_warning @abort_at_warning end |
Instance Method Details
#extract_attachments(file, attachments, full_parse_mode: false) ⇒ Object
extracts the selected attachments
52 53 54 55 56 57 58 59 |
# File 'lib/mkvtoolnix/modules/mkvextract.rb', line 52 def (file, , full_parse_mode: false) cmd = [@bin_path, file, 'attachments'] (cmd, full_parse_mode) add_id_file_list(cmd, ) call_cmd(cmd) end |
#extract_chapters(file, out_file, simple: false, simple_language: nil, full_parse_mode: false) ⇒ Object
extracts the chapter xml file
66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/mkvtoolnix/modules/mkvextract.rb', line 66 def extract_chapters(file, out_file, simple: false, simple_language: nil, full_parse_mode: false) cmd = [@bin_path, file, 'chapters'] (cmd, full_parse_mode) cmd << '--simple' if simple cmd << '--simple-language' << simple_language unless simple_language.nil? cmd << out_file call_cmd(cmd) end |
#extract_cue_sheet(file, out_file, full_parse_mode: false) ⇒ Object
extracts the cue sheet
97 98 99 100 101 102 103 104 |
# File 'lib/mkvtoolnix/modules/mkvextract.rb', line 97 def extract_cue_sheet(file, out_file, full_parse_mode: false) cmd = [@bin_path, file, 'cuesheet'] (cmd, full_parse_mode) cmd << out_file call_cmd(cmd) end |
#extract_cues(file, tracks, full_parse_mode: false) ⇒ Object
extracts the cues of the selected tracks
125 126 127 128 129 130 131 132 |
# File 'lib/mkvtoolnix/modules/mkvextract.rb', line 125 def extract_cues(file, tracks, full_parse_mode: false) cmd = [@bin_path, file, 'cues'] (cmd, full_parse_mode) add_id_file_list(cmd, tracks) call_cmd(cmd) end |
#extract_tags(file, out_file, full_parse_mode: false) ⇒ Object
extracts the tags xml file
83 84 85 86 87 88 89 90 |
# File 'lib/mkvtoolnix/modules/mkvextract.rb', line 83 def (file, out_file, full_parse_mode: false) cmd = [@bin_path, file, 'tags'] (cmd, full_parse_mode) cmd << out_file call_cmd(cmd) end |
#extract_timestamps(file, tracks, full_parse_mode: false) ⇒ Object
extracts the timestamps of the selected tracks
111 112 113 114 115 116 117 118 |
# File 'lib/mkvtoolnix/modules/mkvextract.rb', line 111 def (file, tracks, full_parse_mode: false) cmd = [@bin_path, file, 'timestamps_v2'] (cmd, full_parse_mode) add_id_file_list(cmd, tracks) call_cmd(cmd) end |
#extract_tracks(file, tracks, extract_cuesheet: false, raw: false, full_raw: false, full_parse_mode: false) ⇒ Object
extracts the selected tracks
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/mkvtoolnix/modules/mkvextract.rb', line 35 def extract_tracks(file, tracks, extract_cuesheet: false, raw: false, full_raw: false, full_parse_mode: false) cmd = [@bin_path, file, 'tracks'] (cmd, full_parse_mode) cmd << '--cuesheet' if extract_cuesheet cmd << '--raw' if raw cmd << '--fullraw' if full_raw add_id_file_list(cmd, tracks) call_cmd(cmd) end |
#version ⇒ Object
returns the mkvextract version
return [String] the version string
19 20 21 22 23 24 25 |
# File 'lib/mkvtoolnix/modules/mkvextract.rb', line 19 def version cmd = [@bin_path, '-V'] result = call_cmd(cmd) result.stdout.strip end |