首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Mpeg1video -> ?)

Mpeg1video -> ?)
EN

Stack Overflow用户
提问于 2015-06-22 14:42:44
回答 1查看 265关注 0票数 0

我正在尝试将各种视频文件从.mpeg转换为.ogg theora视频。当我在它自己的程序中测试它时,这个命令工作得很好,但是在它想要运行的程序中却无法正常运行。我不明白这是怎么回事。添加-vcodec标志会导致其他错误。

下面是我用来运行ffmpeg的函数

代码语言:javascript
运行
复制
 * This method converts a file to Ogg Theora video using ffmpeg.
 * 
 * @param f
 *            The file to encode. (Assumes that the file has a .mpeg
 *            extension. If the file doesn't have this, the method will
 *            fail.) 
 * @param nice The niceness of the created ffmpeg
 *            priority.
 * @return converter The process that represents ffmpeg working on the file.
 */
private Process encodeFileAsTheora(File f, int nice) {
    Process converter = null;
    try {
        String targetFileName = f.getAbsolutePath()
                .replace(".mpeg", ".ogg");
        // mLogger.log(Level.INFO,
        // "Now attempting to convert " + f.getAbsolutePath());
        String[] ffmpegCommand = { "nice", "-n", Integer.toString(nice),
                "ffmpeg", "-i", f.getAbsolutePath(), targetFileName };
        converter = Runtime.getRuntime().exec(ffmpegCommand);
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    return converter;
}

下面是它对记录器的getErrorStream()输出:

删除非相关内容

配置:--extra-ldflags=-L/home/user/trunk/cpp_src/ffmpeg-source/libvpx --extra-ldflags=-L/home/user/trunk/cpp_src/ffmpeg-source/x264 --extra-cflags=-I/home/user/trunk/cpp_src/ffmpeg-source/x264 --extra-cflags=-I/home/user/trunk/cpp_src/ffmpeg-source/libvpx -启用-libvpx-启用-libvpx 264-启用-gpl --yasmexe=/home/user/trunk/cpp_src/ffmpeg-source/yasm/yasm

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-06-22 14:59:55

严重: DDCS -配置:--extra-ldflags=-L/home/user/trunk/cpp_src/ffmpeg-source/libvpx --extra-ldflags=-L/home/user/trunk/cpp_src/ffmpeg-source/x264 --extra-cflags=-I/home/user/trunk/cpp_src/ffmpeg-source/x264 --extra-cflags=-I/home/user/trunk/cpp_src/ffmpeg-source/libvpx -启用-libvpx-启用-libvpx 264-启用-gpl --yasmexe=/home/user/trunk/cpp_src/ffmpeg-source/yasm/yasm

您的ffmpeg不是用libtheora支持编译的,所以您不能编码到ogg/theora。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30982874

复制
相关文章

相似问题

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