mkvtoolnix 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MkvToolNix
4
+ module Types
5
+ module PropEdit
6
+ module CommonProperty
7
+
8
+ TRACK_NUMBER = Property.new('track-number', false)
9
+ UID = Property.new('track-uid', false)
10
+ NAME = Property.new('name')
11
+ CODEC_ID = Property.new('codec-id', false)
12
+ CODEC_NAME = Property.new('codec-name')
13
+ CODEC_INHERENT_DELAY = Property.new('codec-delay')
14
+ FLAG_DEFAULT = Property.new('flag-default')
15
+ FLAG_ENABLED = Property.new('flag-enabled')
16
+ FLAG_COMMENTARY = Property.new('flag-commentary')
17
+ FLAG_HEARING_IMPAIRED = Property.new('flag-hearing-impaired')
18
+ FLAG_ORIGINAL = Property.new('flag-original')
19
+ FLAG_TEXT_DESCRIPTIONS = Property.new('flag-text-descriptions')
20
+ FLAG_VISUAL_IMPAIRED = Property.new('flag-visual-impaired')
21
+ FLAG_FORCED = Property.new('flag-forced')
22
+ LANGUAGE = Property.new('language')
23
+ LANGUAGE_IETF = Property.new('language-ietf')
24
+ end
25
+ end
26
+ end
27
+ end
28
+
29
+
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MkvToolNix
4
+ module Types
5
+ module PropEdit
6
+ module InfoProperty
7
+ extend Extensions::Iterable
8
+
9
+ TITLE = Property.new('title')
10
+ DATE = Property.new('date')
11
+ SEGMENT_UUID = Property.new('segment-uid')
12
+ MUX_APPLICATION = Property.new('muxing-application', false)
13
+ WRITING_APPLICATION = Property.new('writing-application', false)
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MkvToolNix
4
+ module Types
5
+ module PropEdit
6
+ class Property
7
+
8
+ attr_reader :property, :removable
9
+
10
+ def initialize(property, removable = true)
11
+ @property = property
12
+ @removable = removable
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MkvToolNix
4
+ module Types
5
+ module PropEdit
6
+ module SubtitleProperty
7
+ include CommonProperty
8
+ extend Extensions::Iterable
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MkvToolNix
4
+ module Types
5
+ module PropEdit
6
+ module VideoProperty
7
+ include CommonProperty
8
+ extend Extensions::Iterable
9
+
10
+ PIXEL_WIDTH = Property.new('pixel-width', false)
11
+ PIXEL_HEIGHT = Property.new('pixel-height', false)
12
+ DISPLAY_WIDTH = Property.new('display-width')
13
+ DISPLAY_HEIGHT = Property.new('display-height')
14
+ DISPLAY_UNIT = Property.new('display-unit')
15
+ STEREO_MODE = Property.new('stereo-mode')
16
+ end
17
+ end
18
+ end
19
+ end
data/lib/mkvtoolnix.rb ADDED
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'open3'
4
+ require 'json'
5
+
6
+ require 'mkvtoolnix/errors/mkvtoolnix_error'
7
+
8
+ require 'mkvtoolnix/modules/mkv_module'
9
+
10
+ require 'mkvtoolnix/extensions/iterable'
11
+
12
+ require 'mkvtoolnix/propedit_selector'
13
+
14
+ require 'mkvtoolnix/types/propedit/property'
15
+ require 'mkvtoolnix/types/propedit/common_property'
16
+ require 'mkvtoolnix/types/propedit/audio_property'
17
+ require 'mkvtoolnix/types/propedit/video_property'
18
+ require 'mkvtoolnix/types/propedit/info_property'
19
+ require 'mkvtoolnix/types/propedit/subtitle_property'
20
+
21
+ require 'mkvtoolnix/types/extract/track'
22
+ require 'mkvtoolnix/types/extract/attachment'
23
+
24
+ require 'mkvtoolnix/types/info/mkv_container'
25
+ require 'mkvtoolnix/types/info/audio'
26
+ require 'mkvtoolnix/types/info/subtitle'
27
+ require 'mkvtoolnix/types/info/video'
28
+ require 'mkvtoolnix/types/info/attachment'
29
+
30
+ require 'mkvtoolnix/modules/mkvmerge'
31
+ require 'mkvtoolnix/modules/mkvpropedit'
32
+ require 'mkvtoolnix/modules/mkvextract'
33
+
34
+ module MkvToolNix
35
+
36
+ def self.init
37
+ mkv_bin_path('')
38
+ end
39
+
40
+ def self.mkv_bin_path(bin_path)
41
+ bin_path = "#{bin_path}/" if !bin_path.empty? && !bin_path.end_with?('/')
42
+ MkvToolNix.new(bin_path)
43
+ end
44
+
45
+ class MkvToolNix
46
+
47
+ attr_reader :mkvmerge, :mkvpropedit, :mkvextract
48
+
49
+ def initialize(bin_path)
50
+ @mkvmerge = Modules::MkvMerge.new(bin_path)
51
+ @mkvpropedit = Modules::MkvPropEdit.new(bin_path)
52
+ @mkvextract = Modules::MkvExtract.new(bin_path)
53
+ end
54
+
55
+ def info(file)
56
+ @mkvmerge.info(file)
57
+ end
58
+
59
+ def abort_at_warning(abort: true)
60
+ @mkvpropedit.abort_at_warning = abort
61
+ @mkvextract.abort_at_warning = abort
62
+ self
63
+ end
64
+
65
+ def disable_language_ietf(disabled: true)
66
+ @mkvpropedit.disable_language_ietf = disabled
67
+ self
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = 'mkvtoolnix'
5
+ spec.version = '0.7.0'
6
+ spec.authors = ['Christian Feier']
7
+ spec.email = ['Christian.Feier@gmail.com']
8
+
9
+ spec.summary = 'A wrapper for MkvToolNix https://mkvtoolnix.download/ to create, alter and inspect MKV files. For more'\
10
+ ' information, please check the github page: https://github.com/cfe86/RubyMkvToolNix'
11
+ spec.description = 'A wrapper for MkvToolNix https://mkvtoolnix.download/ to create, alter and inspect MKV files.'\
12
+ 'Currently mkvpropedit and mkvextract are fully implemented. mkvmerge is in progress.'
13
+ spec.homepage = 'https://github.com/cfe86/RubyMkvToolNix'
14
+ spec.license = 'MIT'
15
+ spec.required_ruby_version = '>= 2.5.0'
16
+
17
+ spec.metadata['homepage_uri'] = 'https://github.com/cfe86/RubyMkvToolNix'
18
+ spec.metadata['source_code_uri'] = 'https://github.com/cfe86/RubyMkvToolNix'
19
+ spec.metadata['changelog_uri'] = 'https://github.com/cfe86/RubyMkvToolNix'
20
+
21
+ # Specify which files should be added to the gem when it is released.
22
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
24
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
25
+ end
26
+ spec.bindir = 'exe'
27
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ['lib']
29
+
30
+ # Uncomment to register a new dependency of your gem
31
+
32
+ # For more information and examples about making a new gem, checkout our
33
+ # guide at: https://bundler.io/guides/creating_gem.html
34
+ end
metadata ADDED
@@ -0,0 +1,80 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mkvtoolnix
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.7.0
5
+ platform: ruby
6
+ authors:
7
+ - Christian Feier
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2021-11-30 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A wrapper for MkvToolNix https://mkvtoolnix.download/ to create, alter
14
+ and inspect MKV files.Currently mkvpropedit and mkvextract are fully implemented.
15
+ mkvmerge is in progress.
16
+ email:
17
+ - Christian.Feier@gmail.com
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - ".gitignore"
23
+ - ".rubocop.yml"
24
+ - CODE_OF_CONDUCT.md
25
+ - Gemfile
26
+ - LICENSE.txt
27
+ - README.md
28
+ - Rakefile
29
+ - bin/console
30
+ - bin/setup
31
+ - lib/mkvtoolnix.rb
32
+ - lib/mkvtoolnix/errors/mkvtoolnix_error.rb
33
+ - lib/mkvtoolnix/extensions/iterable.rb
34
+ - lib/mkvtoolnix/modules/mkv_module.rb
35
+ - lib/mkvtoolnix/modules/mkvextract.rb
36
+ - lib/mkvtoolnix/modules/mkvmerge.rb
37
+ - lib/mkvtoolnix/modules/mkvpropedit.rb
38
+ - lib/mkvtoolnix/propedit_selector.rb
39
+ - lib/mkvtoolnix/types/extract/attachment.rb
40
+ - lib/mkvtoolnix/types/extract/track.rb
41
+ - lib/mkvtoolnix/types/info/attachment.rb
42
+ - lib/mkvtoolnix/types/info/audio.rb
43
+ - lib/mkvtoolnix/types/info/mkv_container.rb
44
+ - lib/mkvtoolnix/types/info/subtitle.rb
45
+ - lib/mkvtoolnix/types/info/video.rb
46
+ - lib/mkvtoolnix/types/propedit/audio_property.rb
47
+ - lib/mkvtoolnix/types/propedit/common_property.rb
48
+ - lib/mkvtoolnix/types/propedit/info_property.rb
49
+ - lib/mkvtoolnix/types/propedit/property.rb
50
+ - lib/mkvtoolnix/types/propedit/subtitle_property.rb
51
+ - lib/mkvtoolnix/types/propedit/video_property.rb
52
+ - mkvtoolnix.gemspec
53
+ homepage: https://github.com/cfe86/RubyMkvToolNix
54
+ licenses:
55
+ - MIT
56
+ metadata:
57
+ homepage_uri: https://github.com/cfe86/RubyMkvToolNix
58
+ source_code_uri: https://github.com/cfe86/RubyMkvToolNix
59
+ changelog_uri: https://github.com/cfe86/RubyMkvToolNix
60
+ post_install_message:
61
+ rdoc_options: []
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 2.5.0
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ requirements: []
75
+ rubygems_version: 3.2.15
76
+ signing_key:
77
+ specification_version: 4
78
+ summary: 'A wrapper for MkvToolNix https://mkvtoolnix.download/ to create, alter and
79
+ inspect MKV files. For more information, please check the github page: https://github.com/cfe86/RubyMkvToolNix'
80
+ test_files: []