This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

FFmpeg has stopped working  RSS feed

 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!