【问题标题】:ffmpeg problems (mpeg1video -> ?)ffmpeg 问题 (mpeg1video -> ?)
【发布时间】:2015-07-03 21:02:19
【问题描述】:

我正在尝试将各种视频文件从 .mpeg 转换为 .ogg theora 视频。当我在自己的程序中对其进行测试时,此命令运行良好,但无法在其预期的程序中正常运行。我不明白这里发生了什么。添加-vcodec 标志会导致其他错误。

这是我用来运行ffmpeg的函数:

 * 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 --enable-libvpx -- enable-libx264 --enable-gpl --yasmexe=/home/user/trunk/cpp_src/ffmpeg-source/yasm/yasm

【问题讨论】:

    标签: java ffmpeg


    【解决方案1】:

    严重: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 --enable-libvpx --enable-libx264 -- enable-gpl --yasmexe=/home/user/trunk/cpp_src/ffmpeg-source/yasm/yasm

    您的 ffmpeg 未使用 libtheora 支持编译,因此您无法编码为 ogg/theora。

    【讨论】:

      猜你喜欢
      • 2015-06-27
      • 1970-01-01
      • 2011-09-19
      • 2018-06-21
      • 2012-01-06
      • 1970-01-01
      • 1970-01-01
      • 2019-07-14
      • 2012-06-17
      相关资源
      最近更新 更多