在Java中使用vlcj时,VLC无法打开th MRL

在Java中使用vlcj时,VLC无法打开th MRL,java,javafx,vlcj,Java,Javafx,Vlcj,我试图让应用程序运行,但遇到了以下问题: [00007f9884007300] v4l2 demux error: cannot open device '/dev/video0 ': No such file or directory [00007f9884007300] v4l2 demux error: cannot open device '/dev/video0 ': No such file or directory [00007f9884007300] v4l2 demux err

我试图让应用程序运行,但遇到了以下问题:

[00007f9884007300] v4l2 demux error: cannot open device '/dev/video0 ': No such file or directory
[00007f9884007300] v4l2 demux error: cannot open device '/dev/video0 ': No such file or directory
[00007f9884007300] v4l2 demux error: cannot open device '/dev/video0 ': No such file or directory
[00007f9884007300] v4l2 demux error: cannot open device '/dev/video0 ': No such file or directory
[00007f9884013920] v4l2 stream error: cannot open device '/dev/video0 ': No such file or directory
[00007f9884013920] v4l2 stream error: cannot open device '/dev/video0 ': No such file or directory
[00007f989820af20] main input error: Your input can't be opened
[00007f989820af20] main input error: VLC is unable to open the MRL 'v4l2:///dev/video0 :v4l2-width=3840 :v4l2-height=2160'. Check the log for details.
当我从命令行发出以下命令时,它可以完美地工作:

vlc v4l2:///dev/video0 :v4l2-width=3840 :v4l2-height=2160
这是与此新捕获设备(Magewell Eco capture HDMI 4K M2.2)配合使用的最低MRL。我一直在使用Bytedeco的FfmpegFrameGrabber和OpenCV库,但如果我能让它工作起来,我希望能提高这个库的性能

至于“查看日志了解详细信息”,据我所知,任何地方都没有记录任何信息。我将VLC设置为登录到文件和系统日志,而这个演示应用程序没有生成任何内容

我确实将我的用户添加到视频组中,即使VLC命令行在我不在组中的情况下工作,但没有任何效果

在Ubuntu 20.04、JavaSE 14/JavaFX14.0.2.1、vlcj 4.7.0、vlcj JavaFX 1.0.2、VLC 3.0.9.2、Eclipse 2020-06上运行所有这些


谢谢你的帮助

MRL应该是
v4l2://

然后使用媒体选项或MediaPlayerFactory参数:

String[] args = {
    "--v4l2-dev", "/dev/video0",
    "--v4l2-width", "3840",
    "--v4l2-height", "2160"
}

使用这些参数创建MediaPlayerFactory,或者在使用play()时将它们作为媒体选项传递。

我是从内存中回答的,我已经有一段时间没有使用视频捕获设备了。