首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Xuggler for MXF to FLV

使用Xuggler for MXF to FLV
EN

Stack Overflow用户
提问于 2011-09-23 19:12:18
回答 1查看 724关注 0票数 2

我正在尝试转码一个mxf文件到flv类型使用Xuggler。

但我得到了一个例外-

代码语言:javascript
复制
2011-09-23 11:48:06,328 [main] WARN  com.xuggle.xuggler - Got error: picture is not of the same PixelType as this Coder expected (../../../../../../../csrc/com/xuggle/xuggler/StreamCoder.cpp:1204)

我的代码非常简单,看起来像这样-

代码语言:javascript
复制
public static void main(String[] args) {

    // create a media reader
    IMediaReader mediaReader = ToolFactory.makeReader(inputFilename);

    // create a media writer
    IMediaWriter mediaWriter = ToolFactory.makeWriter(outputFilename,
            mediaReader);

    // add a writer to the reader, to create the output file
    mediaReader.addListener(mediaWriter);

    // create a media viewer with stats enabled
    // IMediaViewer mediaViewer = ToolFactory.makeViewer(true);

    // add a viewer to the reader, to see the decoded media
    // mediaReader.addListener(mediaViewer);

    // read and decode packets from the source file and
    // and dispatch decoded audio and video to the writer
    while (mediaReader.readPacket() == null)
        ;

}

它适用于MP4和MOV类型的文件。

有什么建议请告诉我。

由于没有人回复,我也找不到任何解决方案,所以我决定使用Java中的命令参数。

我试过了,但我收到了错误-

代码语言:javascript
复制
public class FfmpegCommandTest {

public static void main(String args[]) {

    String commandStr[] = { "ffmpeg -f dv -i \"C:\temp\0001NY.MXF\" -ar 44100 -v codec libx264 -maxrate 2000k -bufsize 2000k -vf scale=\"iw/2:ih/2\" -strict experimental -vstats_file \"C:\nasir\progress.txt\" \"C:\temp\0001NYoutput-short1.mov\"" };
    // print the command to execute
    for (String x : commandStr) {
        System.out.print(x + " ");
    }

    // execute ffmpeg with the command generated by the previous segment
    try {
        ProcessBuilder proc =  new ProcessBuilder(commandStr);
        proc.directory(new File("C:\temp"));
        //proc.command(commandStr);
        proc.start();

    } catch (IOException ex) {          
        ex.getMessage();
        ex.printStackTrace();
    }
}
}

错误是

代码语言:javascript
复制
    The system cannot find the file specified
    at java.lang.ProcessBuilder.start(Unknown Source)
    at com.xuggle.xuggler.demos.FfmpegCommandTest.main(FfmpegCommandTest.java:21)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(Unknown Source)
    at java.lang.ProcessImpl.start(Unknown Source)
EN

回答 1

Stack Overflow用户

发布于 2011-09-30 01:30:04

对于命令内容:使用\"C:\\temp\\0001NY.MXF\"代替\"C:\temp\0001NY.MXF\“。

请参见双反斜杠。

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

https://stackoverflow.com/questions/7528089

复制
相关文章

相似问题

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