lib/ffmprb/process/input/looping.rb in ffmprb-0.11.3 vs lib/ffmprb/process/input/looping.rb in ffmprb-0.11.4

- old
+ new

@@ -58,55 +58,50 @@ end end end cpy_io = File.temp_fifo(src_io.extname) - Ffmprb.logger.debug "(L2) Temporising the raw input (#{src_io.path}) and creating copy (#{cpy_io.path})" + Ffmprb.logger.debug{"(L2) Temporising the raw input (#{src_io.path}) and creating copy (#{cpy_io.path})"} src_io.threaded_buffered_copy_to @raw.io, cpy_io # NOTE (3) # NOTE preprocessed and filtered fifo dst_io = File.temp_fifo(intermediate_extname) @raw.process.proc_vis_node dst_io Util::Thread.new "looping input processor" do - # Ffmprb.logger.debug "Processing before looping" + Ffmprb.logger.debug{"(L3) Pre-processing into (#{dst_io.path})"} - Ffmprb.logger.debug "(L3) Pre-processing into (#{dst_io.path})" Ffmprb.process @_unfiltered, parent: @raw.process do |unfiltered| # TODO limit: inp = input(cpy_io) output(dst_io, video: video, audio: audio) do lay inp.copy(unfiltered) end end end - # Ffmprb.logger.debug "Preprocessed (from #{src_io.path}) looping input: #{dst_io.path}, output: #{io.io.path}, and raw input copy will go through #{buff_raw_io.path} to #{@raw.io.path}..." - buff_ios = (1..times).map{File.temp_fifo intermediate_extname} - Ffmprb.logger.debug "Preprocessed #{dst_io.path} will be teed to #{buff_ios.map(&:path).join '; '}" + Ffmprb.logger.debug{"Preprocessed #{dst_io.path} will be teed to #{buff_ios.map(&:path).join '; '}"} Util::Thread.new "cloning buffer watcher" do dst_io.threaded_buffered_copy_to(*buff_ios).tap do |io_buff| Util::Thread.join_children! Ffmprb.logger.warn "Looping ~from #{src_io.path} finished before its consumer: if you just wanted to loop input #{Util.ffmpeg_inputs_max} times, that's fine, but if you expected it to loop indefinitely... #{Util.ffmpeg_inputs_max} is the maximum #loop can do at the moment, and it may just not be enough in this case (workaround by concatting or file a complaint at #{Ffmprb::GEM_GITHUB_URL}/issues please)." if times == Util.ffmpeg_inputs_max && io_buff.stats.blocks_buff == 0 end end - # Ffmprb.logger.debug "Concatenation of #{buff_ios.map(&:path).join '; '} will go to #{@io.io.path} to be fed to this process" - # NOTE additional (filtered, processed and looped) input io aux_io = File.temp_fifo(intermediate_extname) # NOTE (4) Util::Thread.new "looper" do - Ffmprb.logger.debug "Looping #{buff_ios.size} times" + Ffmprb.logger.debug{"Looping #{buff_ios.size} times"} - Ffmprb.logger.debug "(L4) Looping (#{buff_ios.map &:path}) into (#{aux_io.path})" + Ffmprb.logger.debug{"(L4) Looping (#{buff_ios.map &:path}) into (#{aux_io.path})"} begin # NOTE may not write its entire output, it's ok Ffmprb.process parent: @raw.process, ignore_broken_pipes: false do ins = buff_ios.map{ |i| input i } output(aux_io, video: nil, audio: nil) do @@ -119,10 +114,10 @@ end end # NOTE (1) - Ffmprb.logger.debug "(L1) Creating a new input (#{aux_io.path}) to the process" + Ffmprb.logger.debug{"(L1) Creating a new input (#{aux_io.path}) to the process"} @raw.process.input(aux_io) end end