mencoder :java.io.IOException: error=2, 没有那个文件或目录
mencoder :java.io.IOException: error=2, No such file or directory
我想用 mencoder 将 1.rmvb 转换为 avi;
和文件夹
/app/tongweb02/deployment/modules/cms-web/static/upload/video/origin/2015/03/03/
和
/app/tongweb02/deployment/modules/cms-web/static/upload/video/flv/2015/03/03/
已经退出,
java代码
String getter = null;
String toAvi = "mencoder "
+ originPath
+ " -o "
+ aviPath
+ " -vf scale=320:240 -oac pcm -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=500";
try{
ProcessBuilder builder = new ProcessBuilder();
builder.command(toAvi);
builder.redirectErrorStream(true);
Process proc = builder.start();
BufferedReader stdout = new BufferedReader(
new InputStreamReader(proc.getInputStream()));
String line;
while ((line = stdout.readLine()) != null) {
getter += line + ",";
if( getter != null )
System.out.println(line);
}
proc.waitFor();
stdout.close();
}
catch (Exception e) {
e.printStackTrace();
return false;
}
它给我以下错误:
[2015-03-03 15:23:37] [WARNING] [System.out] [java.io.IOException: Cannot run program "mencoder /app/tongweb02/deployment/modules/cms-web/static/upload/video/origin/2015/03/03/1.rmvb -o /app/tongweb02/deployment/modules/cms-web/static/upload/video/videoTemp/1425367417356.avi -vf scale=320:240 -oac pcm -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=500": java.io.IOException: error=2, No such file or directory]
谁能帮我解决这个问题。
String getter = null;
String toAvi = "mencoder "
+ originPath
+ " -o "
+ aviPath
+ " -vf scale=320:240 -oac pcm -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=500";
try{
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(toAvi);
BufferedReader stdout = new BufferedReader(
new InputStreamReader(proc.getInputStream()));
String line;
while ((line = stdout.readLine()) != null) {
getter += line + ",";
if( getter != null )
System.out.println(line);
}
proc.waitFor();
stdout.close();
}
catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
我想用 mencoder 将 1.rmvb 转换为 avi;
和文件夹 /app/tongweb02/deployment/modules/cms-web/static/upload/video/origin/2015/03/03/ 和 /app/tongweb02/deployment/modules/cms-web/static/upload/video/flv/2015/03/03/ 已经退出,
java代码
String getter = null;
String toAvi = "mencoder "
+ originPath
+ " -o "
+ aviPath
+ " -vf scale=320:240 -oac pcm -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=500";
try{
ProcessBuilder builder = new ProcessBuilder();
builder.command(toAvi);
builder.redirectErrorStream(true);
Process proc = builder.start();
BufferedReader stdout = new BufferedReader(
new InputStreamReader(proc.getInputStream()));
String line;
while ((line = stdout.readLine()) != null) {
getter += line + ",";
if( getter != null )
System.out.println(line);
}
proc.waitFor();
stdout.close();
}
catch (Exception e) {
e.printStackTrace();
return false;
}
它给我以下错误:
[2015-03-03 15:23:37] [WARNING] [System.out] [java.io.IOException: Cannot run program "mencoder /app/tongweb02/deployment/modules/cms-web/static/upload/video/origin/2015/03/03/1.rmvb -o /app/tongweb02/deployment/modules/cms-web/static/upload/video/videoTemp/1425367417356.avi -vf scale=320:240 -oac pcm -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=500": java.io.IOException: error=2, No such file or directory]
谁能帮我解决这个问题。
String getter = null;
String toAvi = "mencoder "
+ originPath
+ " -o "
+ aviPath
+ " -vf scale=320:240 -oac pcm -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=500";
try{
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(toAvi);
BufferedReader stdout = new BufferedReader(
new InputStreamReader(proc.getInputStream()));
String line;
while ((line = stdout.readLine()) != null) {
getter += line + ",";
if( getter != null )
System.out.println(line);
}
proc.waitFor();
stdout.close();
}
catch (Exception e) {
e.printStackTrace();
return false;
}
return true;