Class: FFMPEG::RecorderOptions
- Inherits:
-
Object
- Object
- FFMPEG::RecorderOptions
- Defined in:
- lib/ffmpeg/recorder_options.rb
Overview
Constant Summary collapse
- DEFAULT_LOG_FILE =
'ffmpeg.log'.freeze
- DEFAULT_FPS =
15.0
Instance Method Summary collapse
-
#advanced ⇒ Object
Returns given values that are optional.
-
#all ⇒ Object
Returns all given options.
-
#format ⇒ Object
Returns given recording format.
-
#framerate ⇒ Object
Returns given framerate.
-
#initialize(options) ⇒ RecorderOptions
constructor
A new instance of RecorderOptions.
-
#input ⇒ Object
Returns given input file or input.
-
#log ⇒ Object
Returns given log filename.
-
#log_level ⇒ Object
Returns given log_level.
-
#output ⇒ Object
Returns given output filepath.
-
#parsed ⇒ Object
Returns a String with all options parsed and ready for the ffmpeg process to use.
Constructor Details
#initialize(options) ⇒ RecorderOptions
Returns a new instance of RecorderOptions.
7 8 9 10 11 |
# File 'lib/ffmpeg/recorder_options.rb', line 7 def initialize() TypeChecker.check , Hash TypeChecker.check [:advanced], Hash if [:advanced] @options = end |
Instance Method Details
#advanced ⇒ Object
Returns given values that are optional
44 45 46 |
# File 'lib/ffmpeg/recorder_options.rb', line 44 def advanced @options[:advanced] end |
#all ⇒ Object
Returns all given options
65 66 67 |
# File 'lib/ffmpeg/recorder_options.rb', line 65 def all @options end |
#format ⇒ Object
Returns given recording format
16 17 18 |
# File 'lib/ffmpeg/recorder_options.rb', line 16 def format determine_capture_device end |
#framerate ⇒ Object
Returns given framerate
23 24 25 |
# File 'lib/ffmpeg/recorder_options.rb', line 23 def framerate @options[:framerate] || DEFAULT_FPS end |
#input ⇒ Object
Returns given input file or input
30 31 32 |
# File 'lib/ffmpeg/recorder_options.rb', line 30 def input @options[:input] end |
#log ⇒ Object
Returns given log filename
51 52 53 |
# File 'lib/ffmpeg/recorder_options.rb', line 51 def log @options[:log] || DEFAULT_LOG_FILE end |
#log_level ⇒ Object
Returns given log_level
58 59 60 |
# File 'lib/ffmpeg/recorder_options.rb', line 58 def log_level @options[:log_level] end |
#output ⇒ Object
Returns given output filepath
37 38 39 |
# File 'lib/ffmpeg/recorder_options.rb', line 37 def output @options[:output] end |
#parsed ⇒ Object
Returns a String with all options parsed and ready for the ffmpeg process to use
73 74 75 76 77 78 79 80 |
# File 'lib/ffmpeg/recorder_options.rb', line 73 def parsed vals = "-f #{determine_capture_device} " vals << "-r #{@options[:framerate]} " vals << if @options[:advanced] vals << "-i #{determine_input} " vals << @options[:output] vals << ffmpeg_log_to(@options[:log]) # If provided end |