Module: FFMpeg::MainOptions
- Included in:
- FFMpeg
- Defined in:
- lib/ffmpeg/main_options.rb
Instance Method Summary collapse
-
#album(album) ⇒ Object
Set the album.
-
#author(author) ⇒ Object
Set the author.
-
#comment(comment) ⇒ Object
Set the comment.
-
#copyright(copyright) ⇒ Object
Set the copyright.
-
#duration(duration) ⇒ Object
Set the duration specified in seconds.
-
#file_size_limit(limit) ⇒ Object
Set a file size limit in bytes.
-
#frames_to_record(frames) ⇒ Object
Set the number of frames to record.
-
#offset(offset) ⇒ Object
Set the input time offset in seconds.
-
#overwrite_existing_file ⇒ Object
Overwrite output file if it already exists.
-
#seek(position) ⇒ Object
Seek to given time position in seconds.
- #source(*filename) ⇒ Object
-
#subtitle_codec(codec) ⇒ Object
Force subtitle codec (‘copy’ to copy stream).
-
#target(target) ⇒ Object
Specify target file type (“vcd”, “svcd”, “dvd”, “dv”, “dv50”, “pal-vcd”, “ntsc-svcd”, … ).
-
#title(title) ⇒ Object
Set the title.
-
#track(track) ⇒ Object
Set the track number:.
-
#year(year) ⇒ Object
Set the year.
Instance Method Details
#album(album) ⇒ Object
Set the album.
album "An awesome album"
115 116 117 |
# File 'lib/ffmpeg/main_options.rb', line 115 def album(album) FFMpegCommand << "-album '#{album}'" end |
#author(author) ⇒ Object
Set the author.
"PMH"
88 89 90 |
# File 'lib/ffmpeg/main_options.rb', line 88 def () FFMpegCommand << "-author '#{}'" end |
#comment(comment) ⇒ Object
Set the comment.
comment "Some comment"
106 107 108 |
# File 'lib/ffmpeg/main_options.rb', line 106 def comment(comment) FFMpegCommand << "-comment '#{comment}'" end |
#copyright(copyright) ⇒ Object
Set the copyright.
copyright "(c) Patrik Hedman 2009"
97 98 99 |
# File 'lib/ffmpeg/main_options.rb', line 97 def copyright(copyright) FFMpegCommand << "-copyright '#{copyright}'" end |
#duration(duration) ⇒ Object
Set the duration specified in seconds. hh:mm:ss syntax is also supported
duration "600"
or
duration "00:10:00"
29 30 31 |
# File 'lib/ffmpeg/main_options.rb', line 29 def duration(duration) FFMpegCommand << "-t #{duration}" end |
#file_size_limit(limit) ⇒ Object
Set a file size limit in bytes
file_size_limit 104_857_600
38 39 40 |
# File 'lib/ffmpeg/main_options.rb', line 38 def file_size_limit(limit) FFMpegCommand << "-fs #{limit.to_s}" end |
#frames_to_record(frames) ⇒ Object
Set the number of frames to record.
frames_to_record 50
154 155 156 |
# File 'lib/ffmpeg/main_options.rb', line 154 def frames_to_record(frames) FFMpegCommand << "-dframes #{frames}" end |
#offset(offset) ⇒ Object
Set the input time offset in seconds.
- -]hh:mm:ss[.xxx
-
syntax is also supported.
This option affects all the input files that follow it. The offset is added to the timestamps of the input files. Specifying a positive offset means that the corresponding streams are delayed by ‘offset’ seconds.
offset "600"
or
offset "00:10:00"
70 71 72 |
# File 'lib/ffmpeg/main_options.rb', line 70 def offset(offset) FFMpegCommand << "-itsoffset #{offset}" end |
#overwrite_existing_file ⇒ Object
Overwrite output file if it already exists
15 16 17 |
# File 'lib/ffmpeg/main_options.rb', line 15 def overwrite_existing_file FFMpegCommand.add_at("-y", 0) end |
#seek(position) ⇒ Object
Seek to given time position in seconds. hh:mm:ss syntax is also supported.
seek "600"
or
seek "00:10:00"
52 53 54 |
# File 'lib/ffmpeg/main_options.rb', line 52 def seek(position) FFMpegCommand << "-ss #{position}" end |
#source(*filename) ⇒ Object
4 5 6 |
# File 'lib/ffmpeg/main_options.rb', line 4 def source(*filename) FFMpegCommand << "-i #{filename}" end |
#subtitle_codec(codec) ⇒ Object
Force subtitle codec (‘copy’ to copy stream)
161 162 163 |
# File 'lib/ffmpeg/main_options.rb', line 161 def subtitle_codec(codec) FFMpegCommand << "-scodec #{codec}" end |
#target(target) ⇒ Object
Specify target file type (“vcd”, “svcd”, “dvd”, “dv”, “dv50”, “pal-vcd”, “ntsc-svcd”, … ). All the format options (bitrate, codecs, buffer sizes) are then set automatically. Nevertheless you can specify additional options as long as you know they do not conflict with the standard.
target "vcd"
145 146 147 |
# File 'lib/ffmpeg/main_options.rb', line 145 def target(target) FFMpegCommand << "#{target}" end |
#title(title) ⇒ Object
Set the title.
title "Some Title"
79 80 81 |
# File 'lib/ffmpeg/main_options.rb', line 79 def title(title) FFMpegCommand << "-title '#{title}'" end |
#track(track) ⇒ Object
Set the track number:
track 1
124 125 126 |
# File 'lib/ffmpeg/main_options.rb', line 124 def track(track) FFMpegCommand << "-track #{track}" end |
#year(year) ⇒ Object
Set the year.
year 1985
133 134 135 |
# File 'lib/ffmpeg/main_options.rb', line 133 def year(year) FFMpegCommand << "-year #{year}" end |