使用 vlcj 时出现损坏的模块错误

Corrupt module error when using vlcj

过去两个小时我一直在尝试使用 vlcj,但我不知道如何让它工作。我一直在使用 this tutorial。即使按照教程中的方式编写了我的代码,我仍然收到此错误

SLF4J:无法加载 class "org.slf4j.impl.StaticLoggerBinder"。

SLF4J:默认为无操作 (NOP) 记录器实现

SLF4J:请参阅 http://www.slf4j.org/codes.html#StaticLoggerBinder 了解更多详情。

[000000001a8ed480] 核心流错误:损坏的模块:C:\VideoLAN\VLC\plugins\stream_filter\libdash_plugin.dll

[000000001a8d7a30] 核心 demux 元错误:损坏的模块:C:\VideoLAN\VLC\plugins\meta_engine\libtaglib_plugin.dll

[000000001a8acfb0]核心vout显示错误:置顶失败

这是我正在使用的代码,它与教程有点不同,因为我的程序有不同的要求。

public class AVPlayer extends JPanel{

private EmbeddedMediaPlayerComponent mediaPlayer;       
private String vlcPath, mediapath ; //iniitalized in chooseFile()

//constructor
public AVPlayer() {
    chooseFiles();
    NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(), vlcPath);
    mediaPlayer = new EmbeddedMediaPlayerComponent();
    add(mediaPlayer);
    setSize(400,400);


}

// method to explicitly choose the VLC path and the video file I want to play    
private void chooseFiles(){
    JFileChooser ourFileSelector = new JFileChooser();
    File ourfile;

    //choose vlc path
    ourFileSelector.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    ourFileSelector.showSaveDialog(null);
    ourfile = ourFileSelector.getSelectedFile();
    vlcPath = ourfile.getAbsolutePath();

    //choose media path
    ourFileSelector.setFileSelectionMode(JFileChooser.FILES_ONLY);
    ourFileSelector.showSaveDialog(null);
    ourfile = ourFileSelector.getSelectedFile();
    mediapath = ourfile.getAbsolutePath();
}

//called in main to play the video
public void playVideo(){
    mediaPlayer.getMediaPlayer().playMedia(mediapath); 
  }
}

这是主要内容

 public static void main(String[] args) { 
    JFrame frame = new JFrame();
    AVPlayer player = new AVPlayer();
    frame.add(player);               
    frame.setVisible(true);
    frame.validate();
    player.playVideo();
}

这里有三个不同的东西。

第一个只是关于配置 vlcj 现在使用的 SLF4J 日志记录 API 的警告。按照您发布的 link,"fix" 很简单。

关于损坏模块的第二个是 VLC 本身报告的本机错误。这里最多可以说的是 VLC 未能加载和初始化那些插件(libdash 和 libtaglib),但至于失败的确切原因很难说。如果您在 Windows 上使用 64 位 VLC,请尝试使用 32 位 VLC 和 32 位 JVM。

第三个是 "Failed to set on top..." - 这也是 VLC 报告的本机警告,根据我的经验,可以忽略而不会产生不利影响。

这里的 vlcj 中没有任何内容涉及任何这些问题。