Class: Ffmprb::Process::Input::Paced
- Inherits:
-
ChainBase
- Object
- Ffmprb::Process::Input
- ChainBase
- Ffmprb::Process::Input::Paced
- Defined in:
- lib/ffmprb/process/input/paced.rb
Instance Attribute Summary collapse
-
#ratio ⇒ Object
readonly
Returns the value of attribute ratio.
Attributes inherited from Ffmprb::Process::Input
Instance Method Summary collapse
- #filters_for(lbl, video:, audio:) ⇒ Object
-
#initialize(unfiltered, pace:) ⇒ Paced
constructor
A new instance of Paced.
Methods inherited from ChainBase
#chain_copy, #unfiltered, #unfiltered=
Methods inherited from Ffmprb::Process::Input
#args, #audio, audio_args, #chain_copy, #channel, #channel?, #copy, #crop, #cut, #loop, #mute, #pace, #pp, resolve, #reverse, #temporise_io!, #video, video_args, #volume
Constructor Details
#initialize(unfiltered, pace:) ⇒ Paced
16 17 18 19 |
# File 'lib/ffmprb/process/input/paced.rb', line 16 def initialize(unfiltered, pace:) super unfiltered @ratio = pace end |
Instance Attribute Details
#ratio ⇒ Object (readonly)
Returns the value of attribute ratio.
14 15 16 |
# File 'lib/ffmprb/process/input/paced.rb', line 14 def ratio @ratio end |
Instance Method Details
#filters_for(lbl, video:, audio:) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/ffmprb/process/input/paced.rb', line 21 def filters_for(lbl, video:, audio:) fail Error, "pacing requires fps" unless video.fps # Pacing lbl_aux = "pc#{lbl}" super(lbl_aux, video: video, audio: audio) + [ *((video && channel?(:video))? Filter.setpts_framerate(@ratio, video.fps, "#{lbl_aux}:v", "#{lbl}:v"): nil), *((audio && channel?(:audio))? Filter.atempo(@ratio, "#{lbl_aux}:a", "#{lbl}:a"): nil) ] end |