Class: Agqr::Recorder
- Inherits:
-
Object
- Object
- Agqr::Recorder
- Defined in:
- lib/agqr/recorder.rb,
lib/agqr/recorder/job.rb
Defined Under Namespace
Classes: Job
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#jobs ⇒ Object
Returns the value of attribute jobs.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Recorder
constructor
A new instance of Recorder.
- #load_programs ⇒ Object
- #record(job) ⇒ Object
- #reserve(program) ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Recorder
Returns a new instance of Recorder.
10 11 12 13 |
# File 'lib/agqr/recorder.rb', line 10 def initialize(attributes) @attributes = attributes @jobs = [] end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
8 9 10 |
# File 'lib/agqr/recorder.rb', line 8 def attributes @attributes end |
#jobs ⇒ Object
Returns the value of attribute jobs.
7 8 9 |
# File 'lib/agqr/recorder.rb', line 7 def jobs @jobs end |
Instance Method Details
#load_programs ⇒ Object
15 16 17 18 19 20 |
# File 'lib/agqr/recorder.rb', line 15 def load_programs programs.each do |program| reserve(program) end exec end |
#record(job) ⇒ Object
29 30 31 32 |
# File 'lib/agqr/recorder.rb', line 29 def record(job) cmd = "#{rtmpdump} -r #{agqr_stream_url} --live -B #{job.program.length} -o #{save_path}/#{job.program.title}_#{Time.now.strftime('%Y%m%d').gsub(' ', '')}.flv" system cmd end |