Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EXEC & FFMPEG

 
Vu Pham
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm using the Tomcat as Web Server. In my JSP file, I write as following

...
String command = "cmd.exe /C ffmpeg -i ....";
Process p = Runtime.getRuntime().exec(command);
p.waitFor();
...


Then it hangs (I have waited for 10 minutes but that process seems never stop). When I look at the converted file, it just about 200KB (actually it must be 800KB). Then I stop the Tomcat, that file is immediately 800KB???

Do you know this problem? Thanks
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The usual reason for this sort of failure has to do with consuming the std out and std err output of the Process. See the Javadocs for java.lang.Process.

This problem comes up frequently and is not Tomcat specific - try searching in the Intermediate forum.

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic