gpt4 book ai didi

linux - mencoder :java. io.IOException : error=2, 没有这样的文件或目录

转载 作者:太空宇宙 更新时间:2023-11-04 03:44:02 27 4
gpt4 key购买 nike

我想用mencoder将1.rmvb转换为avi;

和文件夹/app/tongweb02/部署/模块/cms-web/static/upload/video/origin/2015/03/03/和/app/tongweb02/部署/模块/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;

关于linux - mencoder :java. io.IOException : error=2, 没有这样的文件或目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28825820/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com