lib/vnctools/recorder.rb in vnctools-0.0.1 vs lib/vnctools/recorder.rb in vnctools-0.0.2
- old
+ new
@@ -17,15 +17,21 @@
"-y", # overwrite output files
"-r", @options[:frame_rate] || "5", # frame rate
"-s", @options[:frame_size] || "1024x768", # frame size
"-i", "#{display}.0+0,0", # display :1
"-vcodec", @options[:codec] || "mpeg4", # video codec
- "-sameq", output # output
+ "-sameq", output # output
)
- @process.io.inherit! if $DEBUG
+ if $DEBUG
+ @process.io.inherit!
+ else
+ @process.io.stdout = @process.io.stderr = "/dev/null"
+ end
+
@process.start
+ # TODO: this may be too quick to actually catch the failure
if @process.crashed?
raise Error, "ffmpeg failed, run with $DEBUG = true for full output"
end
end