Hello-
I'm using the backtick notation to drive FFmpeg from Ruby. When FFmpeg
runs, it outputs a fair amount of informational text to the console. I'm
unable to read that data from my script. Here is my code:
result = `ffmpeg -i test.avi -f flv -acodec mp3 output.flv`
puts "HERE IS THE RESULT\n"
puts result
puts "\nRESULT COMPLETE"
Here is the result when I run it:
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et
al.
configuration: --enable-gpl --enable-pp --enable-swscaler
--enable-pthreads --enable-libvorbis --enable-libtheora --enable-libogg
--enable-libgsm --enable-dc1394 --disable-debug --enable-shared
--prefix=/usr
libavutil version: 1d.49.3.0
libavcodec version: 1d.51.38.0
libavformat version: 1d.51.10.0
built on Jun 3 2007 20:59:25, gcc: 4.1.3 20070528 (prerelease)
(Ubuntu 4.1.2-9ubuntu2)
Input #0, avi, from 'test.avi':
Duration: 00:00:01.8, start: 0.000000, bitrate: 6571 kb/s
Stream #0.0: Video: cinepak, yuv420p, 640x480, 25.00 fps(r)
Output #0, flv, to 'output.flv':
Stream #0.0: Video: flv, yuv420p, 640x480, q=2-31, 200 kb/s, 25.00
fps(c)
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
frame= 45 q=31.0 Lsize= 436kB time=1.8 bitrate=1985.8kbits/s
video:435kB audio:0kB global headers:0kB muxing overhead 0.203409%
HERE IS THE RESULT
RESULT COMPLETE
I was expecting the output to be bracketed by the text "HERE IS THE
RESULT" and "RESULT COMPLETE", but it looks like the infomation isn't
being put into the variable.
I'm running this using Ruby 1.8.6 on Ubuntu 7.10. I'm connecting to the
machine using PuTTY from my Windows XP machine.
Does anyone know what might be going on?
Regards-
Eric
···
--
Posted via http://www.ruby-forum.com/.