class MultimediaParadise::CaptureScreen
Constants
- DEFAULT_INPUT
#¶ ↑
DEFAULT_INPUT
¶ ↑#¶ ↑
- DEFAULT_STORE_IN_THIS_DIRECTORY
#¶ ↑
DEFAULT_STORE_IN_THIS_DIRECTORY
¶ ↑This is currently hardcoded to the current working directory, but you could also use another target directory.
#¶ ↑
- USE_THIS_SCREEN_RESOLUTION
#¶ ↑
USE_THIS_SCREEN_RESOLUTION
¶ ↑#¶ ↑
Public Class Methods
new( i = nil, run_already = true )
click to toggle source
#¶ ↑
initialize¶ ↑
#¶ ↑
# File lib/multimedia_paradise/video/capture_screen.rb, line 41 def initialize( i = nil, # This variable is not in use, for now. run_already = true ) register_sigint reset case i # Handle special instructions here. (case i) when :dont_run_yet run_already = false i = nil end run if run_already end
Public Instance Methods
add(i)
click to toggle source
#¶ ↑
add (add tag)¶ ↑
This method will simply add to the main system command that will be run.
#¶ ↑
# File lib/multimedia_paradise/video/capture_screen.rb, line 166 def add(i) i = i.to_s unless i.is_a? String i = i.dup if i.frozen? i.strip! # We don't want leading or trailing ' '. # ======================================================================= # # Always prepend a ' ', unless it is already there. # ======================================================================= # i.prepend ' ' unless i.start_with? ' ' @run_this_command = @run_this_command.dup if @run_this_command.frozen? @run_this_command << i end
Also aliased as: append
add_audio_support()
click to toggle source
add_default_audio()
click to toggle source
add_default_format()
click to toggle source
add_default_framerate()
click to toggle source
add_default_input()
click to toggle source
add_default_video_size()
click to toggle source
build_up_main_string()
click to toggle source
#¶ ↑
build_up_main_string
¶ ↑
#¶ ↑
# File lib/multimedia_paradise/video/capture_screen.rb, line 257 def build_up_main_string add_default_video_size # Add the default screen resolution here. add_default_framerate add_default_format overwrite_if_the_file_already_exists add_default_input add_default_audio end
main_string?()
click to toggle source
#¶ ↑
main_string?¶ ↑
#¶ ↑
# File lib/multimedia_paradise/video/capture_screen.rb, line 86 def main_string? @run_this_command end
Also aliased as: main?
no_threads()
click to toggle source
overwrite_if_the_file_already_exists()
click to toggle source
reset()
click to toggle source
#¶ ↑
reset (reset tag)¶ ↑
#¶ ↑
Calls superclass method
MultimediaParadise::Base#reset
# File lib/multimedia_paradise/video/capture_screen.rb, line 58 def reset super() # ======================================================================= # # === @run_this_command # ======================================================================= # @run_this_command = 'ffmpeg' # This is the base command. set_framerate 25 # These are used for buildup. # add ' g -30' # What is this option? I have no idea. set_store_where DEFAULT_STORE_IN_THIS_DIRECTORY # Where to store the captured dataset. end
resolution?()
click to toggle source
run()
click to toggle source
#¶ ↑
run (run tag)¶ ↑
#¶ ↑
# File lib/multimedia_paradise/video/capture_screen.rb, line 276 def run build_up_main_string run_main_string end
Also aliased as: start
run_main_string()
click to toggle source
#¶ ↑
run_main_string
¶ ↑
#¶ ↑
# File lib/multimedia_paradise/video/capture_screen.rb, line 72 def run_main_string sanitize_main_string # ======================================================================= # # Next, show the command to the user, with some "padding". # ======================================================================= # e e main? e system main? # And run it finally. end
sameq()
click to toggle source
sanitize_main_string()
click to toggle source
set_duration(i)
click to toggle source
set_framerate(i)
click to toggle source
#¶ ↑
set_framerate
¶ ↑
In ffmpeg, “-r” equals the “-framerate” option.
#¶ ↑
# File lib/multimedia_paradise/video/capture_screen.rb, line 231 def set_framerate(i) i = i.to_s @framerate = i end
Also aliased as: framerate=, framerate
size=(i = '1024x768')
click to toggle source
store_here=(i)
click to toggle source
#¶ ↑
store_here=¶ ↑
This determines where to store the captured video.
#¶ ↑
# File lib/multimedia_paradise/video/capture_screen.rb, line 115 def store_here=(i) case i # ======================================================================= # # === :pwd # ======================================================================= # when :pwd i = return_pwd end if i.end_with? '/' i = i.dup if i.frozen? i << 'output.mp4' # Create a .mp4 file by default. end @store_where = i end
Also aliased as: set_store_where
store_where?()
click to toggle source