Module: RFFmpeg
- Defined in:
- lib/rffmpeg.rb
Class Method Summary collapse
- .add_method(name, *args, &block) ⇒ Object
-
.run ⇒ Object
Execute ffmpeg command.
Instance Method Summary collapse
- #album(album) ⇒ Object
- #author(author) ⇒ Object
- #capture_stream(*input_streams) {|_self| ... } ⇒ Object
- #comment(comment) ⇒ Object
- #copyright(copyright) ⇒ Object
- #duration(duration) ⇒ Object
- #file_size_limit(limit) ⇒ Object
- #frames_to_record(frames) ⇒ Object
- #logging_verbosity_level(verbosity) ⇒ Object
- #offset(offset) ⇒ Object
- #output_to(*output_streams) {|_self| ... } ⇒ Object
-
#overwrite_existing(overwrite) ⇒ Object
Main options.
-
#resolution(resolution) ⇒ Object
Video options.
- #seek(position) ⇒ Object
- #subtitle_codec(codec) ⇒ Object
- #target(target) ⇒ Object
- #timestamp(timestamp) ⇒ Object
- #title(title) ⇒ Object
- #track(track) ⇒ Object
- #year(year) ⇒ Object
Class Method Details
.add_method(name, *args, &block) ⇒ Object
21 22 23 24 25 |
# File 'lib/rffmpeg.rb', line 21 def self.add_method(name, *args, &block) define_method name do |args| yield args end end |
.run ⇒ Object
Execute ffmpeg command
104 105 106 107 |
# File 'lib/rffmpeg.rb', line 104 def self.run puts "Executing: " + FFMpegCommand.run system FFMpegCommand.run end |
Instance Method Details
#album(album) ⇒ Object
69 70 71 |
# File 'lib/rffmpeg.rb', line 69 def album(album) FFMpegCommand.add "-album '#{album}'" end |
#author(author) ⇒ Object
57 58 59 |
# File 'lib/rffmpeg.rb', line 57 def () FFMpegCommand.add "-author '#{}'" end |
#capture_stream(*input_streams) {|_self| ... } ⇒ Object
7 8 9 10 11 12 |
# File 'lib/rffmpeg.rb', line 7 def capture_stream(*input_streams, &block) yield self if block_given? input_streams.each do |input_stream| FFMpegCommand.add "-i #{input_stream}" end end |
#comment(comment) ⇒ Object
65 66 67 |
# File 'lib/rffmpeg.rb', line 65 def comment(comment) FFMpegCommand.add "-comment '#{comment}'" end |
#copyright(copyright) ⇒ Object
61 62 63 |
# File 'lib/rffmpeg.rb', line 61 def copyright(copyright) FFMpegCommand.add "-copyright '#{copyright}'" end |
#duration(duration) ⇒ Object
33 34 35 |
# File 'lib/rffmpeg.rb', line 33 def duration(duration) FFMpegCommand.add "-t #{duration}" end |
#file_size_limit(limit) ⇒ Object
37 38 39 |
# File 'lib/rffmpeg.rb', line 37 def file_size_limit(limit) FFMpegCommand.add "-fs #{limit}" end |
#frames_to_record(frames) ⇒ Object
89 90 91 |
# File 'lib/rffmpeg.rb', line 89 def frames_to_record(frames) FFMpegCommand.add "-dframes #{frames}" end |
#logging_verbosity_level(verbosity) ⇒ Object
81 82 83 |
# File 'lib/rffmpeg.rb', line 81 def logging_verbosity_level(verbosity) FFMpegCommand.add "-v #{verbosity}" end |
#offset(offset) ⇒ Object
45 46 47 |
# File 'lib/rffmpeg.rb', line 45 def offset(offset) FFMpegCommand.add "-itsoffset #{offset}" end |
#output_to(*output_streams) {|_self| ... } ⇒ Object
14 15 16 17 18 19 |
# File 'lib/rffmpeg.rb', line 14 def output_to(*output_streams, &block) yield self if block_given? output_streams.each do |output_stream| FFMpegCommand.add "#{output_stream}" end end |
#overwrite_existing(overwrite) ⇒ Object
Main options
29 30 31 |
# File 'lib/rffmpeg.rb', line 29 def overwrite_existing(overwrite) FFMpegCommand.add_at("-y", 0) if overwrite end |
#resolution(resolution) ⇒ Object
Video options
98 99 100 |
# File 'lib/rffmpeg.rb', line 98 def resolution(resolution) FFMpegCommand.add "-s #{resolution}" end |
#seek(position) ⇒ Object
41 42 43 |
# File 'lib/rffmpeg.rb', line 41 def seek(position) FFMpegCommand.add "-ss #{position}" end |
#subtitle_codec(codec) ⇒ Object
93 94 95 |
# File 'lib/rffmpeg.rb', line 93 def subtitle_codec(codec) FFMpegCommand.add "-scodec #{codec}" end |
#target(target) ⇒ Object
85 86 87 |
# File 'lib/rffmpeg.rb', line 85 def target(target) FFMpegCommand.add "-target #{target}" end |
#timestamp(timestamp) ⇒ Object
53 54 55 |
# File 'lib/rffmpeg.rb', line 53 def () FFMpegCommand.add "-timestamp #{}" end |
#title(title) ⇒ Object
49 50 51 |
# File 'lib/rffmpeg.rb', line 49 def title(title) FFMpegCommand.add "-title '#{title}'" end |
#track(track) ⇒ Object
73 74 75 |
# File 'lib/rffmpeg.rb', line 73 def track(track) FFMpegCommand.add "-track #{track}" end |
#year(year) ⇒ Object
77 78 79 |
# File 'lib/rffmpeg.rb', line 77 def year(year) FFMpegCommand.add "-year #{year}" end |