I'm trying to write a utility to run an external process and capture
it's stderr. It seems that IO.popen only lets me read the stdout. Any
tips for how to read stderr?
snippet of code...
@filename = filename
puts "Processing: " + @filename
cmdline = "ffmpeg -i " + @filename
ffmpeg = IO.popen(cmdline, "w+")
result = ffmpeg.gets
result.each do |line|
puts "Line from ffmpeg: " + line
This code does not work because the good stuff I want from ffmpeg went
to stderr and not stdout. Please refrain from commenting on the merits
of ffmpeg. That could go on all day.