如何在更改的目录上运行cd命令(在Linux Ubuntu中)和ffmpeg。以下jsp程序对我不起作用。
String cmd = "cd "+getServletContext().getRealPath("/")+"Files/videos/";
out.println(cmd);
ProcessBuilder pb = new ProcessBuilder(
"/bin/sh", "-c",
cmd + "&& ffmpeg -i nature.MP4");
Process p = pb.start();
BufferedReader in = new BufferedReader(
new InputStreamReader(p.getInputStream()) );
String line;
out.println("Meta-data...");
while ((line = in.readLine()) != null) {
out.println(line);
}
in.close();
提前致谢...