I am trying to convert a flv file to mp3 using ffmpeg from java.
I am running the following command
cmd.exe /C start /BELOWNORMAL /WAIT /B /ffmpeg -i “C:\Documents and Settings\user\My Documents\Bob Dylan – Spanish Harlem Incident(LD).flv” “C:\Documents and Settings\user\My Documents\Bob Dylan – Spanish Harlem Incident(LD).mp3”
I am getting this error “The system cannot find the file and.”
I am using the following code to execute commands http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html?page=4
When i run it outside of java, from cmd console i have no problems
Any ideas would be appreciated.
Are you escaping the special characters properly? It should be like this if you’re just pasting it into the code as a String:
If you are but it’s still not working, I’d recommend separating out the commands, like this:
Which will eliminate the need to quote the filename.
Alternatively, to increase the readability and rule out problems with your file system, you could use the File class to wrap the location, thusly: