首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >菜单编码:java.io.IOException: error=2,没有这样的文件或目录

菜单编码:java.io.IOException: error=2,没有这样的文件或目录
EN

Stack Overflow用户
提问于 2015-03-03 06:56:16
回答 1查看 402关注 0票数 0

我想把1.rmvb转换成avi,用mencoder;

/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代码

代码语言:javascript
复制
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;
}

它给了我以下错误:

代码语言:javascript
复制
[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]

有人能帮我解决这个问题吗。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-03-03 08:40:59

代码语言:javascript
复制
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;
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28825820

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档