【问题标题】:Xuggler generates error messageXuggler 生成错误消息
【发布时间】:2013-04-05 20:56:35
【问题描述】:

我正在创建我的第一个 Xuggler 媒体应用程序。我通过观看他们关于如何创建第一个媒体应用程序的视频进行编码。

代码

package demo;

import com.xuggle.xuggler.IContainer;

public class GetContainerInfo {
    public static void main(String[] args) {
        if(args.length!=1){
            throw new IllegalArgumentException("no file");
        }
        IContainer container = IContainer.make();
        if(container.open(args[0],IContainer.Type.READ,null)<0){
            throw new IllegalArgumentException("could not open");
        }
    }
}

错误

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.  

我有依赖关系吗?

是的,我愿意!我有所有的依赖项。我在创建项目时导入了它们。
图片:

是什么导致了该错误,我该如何解决?

【问题讨论】:

    标签: java eclipse dependencies xuggle xuggler


    【解决方案1】:

    来自SLF4J manual

    > SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    > SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J:
    > See http://www.slf4j.org/codes.html#StaticLoggerBinder for further
    > details.
    

    打印此警告是因为找不到 slf4j 绑定 你的班级路径。添加后警告将消失 绑定到您的类路径。假设您添加 slf4j-simple-1.7.2.jar 所以 你的类路径包含:slf4j-api-1.7.2.jar slf4j-simple-1.7.2.jar ...

    【讨论】:

    • 所有这些依赖项都存储在 E:\xuggler-and-dependencies 中,所以这将是类路径?
    • SLF4J 这个名字代表 Java 的简单日志记录 Facade。 IE。它假定您的应用程序中已经有一个日志记录实现。您的类路径中应该有 slf4j-simple-1.7.2.jar、slf4j-log4j12-1.7.2.jar 或其他文件以启用日志记录。请检查我在答案中提供的链接。
    • 好吧,Xuggler 不要求simple 文件。我仍然会将它添加到类路径中
    【解决方案2】:

    原因可能是依赖 jar 不可用或版本冲突。

    在类路径中添加以下 jar 对我来说效果很好:

    xuggle-xuggler-5.4.jar
    slf4j-api-1.6.4.jar
    logback-core-1.0.0.jar
    logback-classic-1.0.0.jar

    【讨论】:

      猜你喜欢
      • 2013-06-30
      • 2015-09-01
      • 2020-05-04
      • 2019-11-21
      • 1970-01-01
      • 2015-11-28
      • 1970-01-01
      • 2020-03-23
      • 2020-01-26
      相关资源
      最近更新 更多