Class: Mkv2m4v::File
- Inherits:
-
Object
- Object
- Mkv2m4v::File
- Extended by:
- Forwardable
- Defined in:
- lib/mkv2m4v/file.rb
Instance Attribute Summary collapse
-
#audio_tracks ⇒ Object
readonly
Returns the value of attribute audio_tracks.
-
#filtered_audio_tracks ⇒ Object
readonly
Returns the value of attribute filtered_audio_tracks.
-
#filtered_text_tracks ⇒ Object
readonly
Returns the value of attribute filtered_text_tracks.
-
#filtered_video_tracks ⇒ Object
readonly
Returns the value of attribute filtered_video_tracks.
-
#ideal_audio_track ⇒ Object
readonly
Returns the value of attribute ideal_audio_track.
-
#ideal_text_track ⇒ Object
readonly
Returns the value of attribute ideal_text_track.
-
#ideal_video_track ⇒ Object
readonly
Returns the value of attribute ideal_video_track.
-
#info ⇒ Object
readonly
Returns the value of attribute info.
-
#text_tracks ⇒ Object
readonly
Returns the value of attribute text_tracks.
-
#video_tracks ⇒ Object
readonly
Returns the value of attribute video_tracks.
Class Method Summary collapse
Instance Method Summary collapse
- #format ⇒ Object
-
#initialize(filename, options = {}) ⇒ File
constructor
A new instance of File.
- #print_info ⇒ Object
- #transcode ⇒ Object
Constructor Details
#initialize(filename, options = {}) ⇒ File
Returns a new instance of File.
19 20 21 22 23 24 |
# File 'lib/mkv2m4v/file.rb', line 19 def initialize(filename, = {}) @info = Mediainfo.new(filename) @options = @languages = @options[:languages] init_tracks end |
Instance Attribute Details
#audio_tracks ⇒ Object (readonly)
Returns the value of attribute audio_tracks.
13 14 15 |
# File 'lib/mkv2m4v/file.rb', line 13 def audio_tracks @audio_tracks end |
#filtered_audio_tracks ⇒ Object (readonly)
Returns the value of attribute filtered_audio_tracks.
14 15 16 |
# File 'lib/mkv2m4v/file.rb', line 14 def filtered_audio_tracks @filtered_audio_tracks end |
#filtered_text_tracks ⇒ Object (readonly)
Returns the value of attribute filtered_text_tracks.
14 15 16 |
# File 'lib/mkv2m4v/file.rb', line 14 def filtered_text_tracks @filtered_text_tracks end |
#filtered_video_tracks ⇒ Object (readonly)
Returns the value of attribute filtered_video_tracks.
14 15 16 |
# File 'lib/mkv2m4v/file.rb', line 14 def filtered_video_tracks @filtered_video_tracks end |
#ideal_audio_track ⇒ Object (readonly)
Returns the value of attribute ideal_audio_track.
15 16 17 |
# File 'lib/mkv2m4v/file.rb', line 15 def ideal_audio_track @ideal_audio_track end |
#ideal_text_track ⇒ Object (readonly)
Returns the value of attribute ideal_text_track.
15 16 17 |
# File 'lib/mkv2m4v/file.rb', line 15 def ideal_text_track @ideal_text_track end |
#ideal_video_track ⇒ Object (readonly)
Returns the value of attribute ideal_video_track.
15 16 17 |
# File 'lib/mkv2m4v/file.rb', line 15 def ideal_video_track @ideal_video_track end |
#info ⇒ Object (readonly)
Returns the value of attribute info.
13 14 15 |
# File 'lib/mkv2m4v/file.rb', line 13 def info @info end |
#text_tracks ⇒ Object (readonly)
Returns the value of attribute text_tracks.
13 14 15 |
# File 'lib/mkv2m4v/file.rb', line 13 def text_tracks @text_tracks end |
#video_tracks ⇒ Object (readonly)
Returns the value of attribute video_tracks.
13 14 15 |
# File 'lib/mkv2m4v/file.rb', line 13 def video_tracks @video_tracks end |
Class Method Details
.each(filenames, options = {}) ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'lib/mkv2m4v/file.rb', line 43 def self.each(filenames, = {}) filenames.each do |filename| if ::File.exists?(filename) yield new(filename, ) else $stderr.puts "#{filename} does not exist." end end end |
Instance Method Details
#format ⇒ Object
26 27 28 |
# File 'lib/mkv2m4v/file.rb', line 26 def format info.general.format end |
#print_info ⇒ Object
30 31 32 33 34 |
# File 'lib/mkv2m4v/file.rb', line 30 def print_info process do print_filtered_tracks end end |
#transcode ⇒ Object
36 37 38 39 40 41 |
# File 'lib/mkv2m4v/file.rb', line 36 def transcode process do print_ideal_tracks Transcoder.new(self, @options).run end end |