【问题标题】:Xuggler issue with MAC OSMAC OS 的 Xuggler 问题
【发布时间】:2014-08-11 17:47:31
【问题描述】:

我使用 Xuggler 5.4 制作了屏幕录像机和播放器应用程序。我是在 Windows 8 64 位环境下开发的。我已经让它作为 WebStart 项目工作并在 MAC 10.8 64 位中启动 (.jnlp)。当我运行它时,记录器工作正常,但是当我在我的播放器中打开它时,它会抛出异常

Exception in thread "stopThread" java.lang.RuntimeException : Unhandled and unknown native exception
at com.xuggle.xuggler.XugglerJNI.IContainer_open__SWIG_0( Native Method )
at com.xuggle.xuggler.IContainer.open(IContainer.java:597 )

就 Windows 而言,情况并非如此...... 我对 Xuggler 非常陌生。我不知道这个异常是什么意思。这是我得到这个异常的代码行。

if (container1.open( fileName, IContainer.Type.READ, container1.getContainerFormat()) < 0) {
            throw new IllegalArgumentException("could not open file: " + fileName);
        } 

提前致谢。

P.S : 我只使用了相同版本的 Java (1.7.0_65) 和 Oracle。

【问题讨论】:

    标签: java macos xuggler


    【解决方案1】:

    我得到了解决方案..

    我改变了打开容器的方法。

    以前的方法:

    if (container1.open( fileName, IContainer.Type.READ, container1.getContainerFormat()) < 0) {
                throw new IllegalArgumentException("could not open file: " + fileName);
            } 
    

    新方法:

    InputStream inputStream = null ;
            try {
            inputStream = new FileInputStream(new File("fileName"));
            } catch (FileNotFoundException e2) {
                logger.error("File not found ");
            }
    
            IContainerFormat format = IContainerFormat.make();
            format.setInputFormat("flv");
    
    
            container1 = IContainer.make();
    
    
            if (container1.open( inputStream , format) < 0) {
                throw new IllegalArgumentException("could not open file: " + fileName);
            }
    

    这适用于 MAC OS..

    奇怪但真实

    【讨论】:

      猜你喜欢
      • 2020-02-11
      • 1970-01-01
      • 2022-11-23
      • 2011-08-19
      • 2012-08-15
      • 2016-09-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多