R
R
Rienopely2015-10-18 23:45:30
Java
Rienopely, 2015-10-18 23:45:30

Why does java not allow the process to run?

There is a process running through java that processes files and videos. Works great, as long as you don't know the state of the process with while(p.isAlive()) or wait for it to finish with p.waitFor(). In such cases, the task manager says that it consumes 0 processor time. And the work ends in the middle. + The process is still in the task manager. Without state recognition, it works as it should. FFMPEG.EXE Process

Runtime runtime = Runtime.getRuntime();
        Process p = null;
        try{

        p = runtime.exec(new CommandGenerator(new File("C:\\Users\\Denis\\Desktop\\sx\\ffmpeg.exe"), 
                new File("C:\\Users\\Denis\\Desktop\\sx\\Wildlife.wmv"), new File("c:\\Users\\Denis\\Desktop\\output"), 100).generateParam());
        p.waitFor(); или while(p.isAlive()){};
        }catch(Exception e){
            e.printStackTrace();
        }
        
        System.out.println("УРА!!!");

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question