D
dtown22
I am trying to run a command line utility which converts a wma file to
a mp3 (i want to be able to do this for batch files) using FFMpeg &
LAME. I am trying to run the following command from ruby:
"C:\Documents and Settings\dt\Desktop\my stuff\songs\wma\ffmpeg.exe" -
i "C:\Documents and Settings\dt\Desktop\my stuff\songs\Who The
\Quadrophenia\07-0 - Who The - Love Reign O'er Me.wma" -vn -f wav - |
"C:\Documents and Settings\dt\Desktop\my stuff\songs\wma\lame.exe" -V
6 - "C:\Documents and Settings\dt\Desktop\my stuff\songs\\Who The
\Quadrophenia\07-0 - Who The - Love Reign O'er Me.mp3"
It works perfect from the command line, but no matter how i try it
(with double quotes, single quotes, backticks, etc) it doesnt seem to
want to work from ruby
Here is an example of the code I have
ffmpeg = '"C:\\Documents and Settings\\dt\\Desktop\\my stuff\\songs\
\wma\\ffmpeg.exe"'
lame = '"C:\\Documents and Settings\\dt\\Desktop\\my stuff\\songs\
\wma\\lame.exe"'
newFile = child.sub('wma', 'mp3')
#cmd = ffmpeg + " -i " + child + " -vn -f wav - | " + lame + " -V 6 -
" + newFile
cmd1 = "#{ffmpeg} -i #{child} -vn -f wav - | #{lame} -V 6 -
#{newFile}"
puts cmd1
system(cmd1)
NOTE: child points to the same file wma file as above.
If i copy and paste the output of the puts command above into a
command window, it works fine...but from ruby, it seems to ignore the
pipe (|) command. I dont know if this is a windows issue, or if i am
missing something obvious. Any help is greatly appreciated.
a mp3 (i want to be able to do this for batch files) using FFMpeg &
LAME. I am trying to run the following command from ruby:
"C:\Documents and Settings\dt\Desktop\my stuff\songs\wma\ffmpeg.exe" -
i "C:\Documents and Settings\dt\Desktop\my stuff\songs\Who The
\Quadrophenia\07-0 - Who The - Love Reign O'er Me.wma" -vn -f wav - |
"C:\Documents and Settings\dt\Desktop\my stuff\songs\wma\lame.exe" -V
6 - "C:\Documents and Settings\dt\Desktop\my stuff\songs\\Who The
\Quadrophenia\07-0 - Who The - Love Reign O'er Me.mp3"
It works perfect from the command line, but no matter how i try it
(with double quotes, single quotes, backticks, etc) it doesnt seem to
want to work from ruby
Here is an example of the code I have
ffmpeg = '"C:\\Documents and Settings\\dt\\Desktop\\my stuff\\songs\
\wma\\ffmpeg.exe"'
lame = '"C:\\Documents and Settings\\dt\\Desktop\\my stuff\\songs\
\wma\\lame.exe"'
newFile = child.sub('wma', 'mp3')
#cmd = ffmpeg + " -i " + child + " -vn -f wav - | " + lame + " -V 6 -
" + newFile
cmd1 = "#{ffmpeg} -i #{child} -vn -f wav - | #{lame} -V 6 -
#{newFile}"
puts cmd1
system(cmd1)
NOTE: child points to the same file wma file as above.
If i copy and paste the output of the puts command above into a
command window, it works fine...but from ruby, it seems to ignore the
pipe (|) command. I dont know if this is a windows issue, or if i am
missing something obvious. Any help is greatly appreciated.