Meaningless Drivel is fun!*
The moose likes Java in General and the fly likes FFmpeg has stopped working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "FFmpeg has stopped working" Watch "FFmpeg has stopped working" New topic
Author

FFmpeg has stopped working

Nina Anderson
Ranch Hand

Joined: Jul 18, 2006
Posts: 148
Hi,

I'm trying to convert a .mov video file to a .flv format using FFMPEG. When I execute it on command line, it works. However, when I invoke it from my java code, a Windows Vista dialog window pops up saying "FFMpeg has Stopped working". I don't idea what the problem is.

Here's my code:

String destinationPath = "C:\\6268\\videos\\fullJavaExprt.flv";

String filePath = "C:\\6268\\videos\\fullJavaExprt.MOV";
\
String flags = " -ar 22050 -ab 32 -f flv -s 320x240 ";
String command="C:\\Program Files\\Apache Software Foundation\\Tomcat 6.0\\webapps\\ROOT\\ffmpeg.exe -i " + filePath + flags + destinationPath;

System.out.println(command);
try {

Process process = Runtime.getRuntime().exec(command);
InputStreamHandler errorHandler = new InputStreamHandler(process.getErrorStream(), "Error Stream");
errorHandler.start();
InputStreamHandler inputHandler = new InputStreamHandler(process.getInputStream(), "Output Stream");
inputHandler.start();

process.waitFor();

if (process.exitValue() == 0) {
// do something;
System.out.println("completed");
}
System.out.println("exit code: " + process.exitValue());

}catch(Exception e){

System.out.println(e);
}


Pls...Help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: FFmpeg has stopped working
 
Similar Threads
calling a perl script from java program
Opening a File at client
Flvtool2: problem convert videos to flv format
Process hanging
struts video file upload