VLC无法在Java中使用vlcj打开MRL。

huangapple go评论103阅读模式
英文:

VLC is unable to open th MRL when using vlcj in Java

问题

我正在尝试运行vljc-javafx-demo应用程序,但遇到了以下问题:

[00007f9884007300] v4l2分流器错误:无法打开设备'/dev/video0':没有该文件或目录
[00007f9884007300] v4l2分流器错误:无法打开设备'/dev/video0':没有该文件或目录
[00007f9884007300] v4l2分流器错误:无法打开设备'/dev/video0':没有该文件或目录
[00007f9884007300] v4l2分流器错误:无法打开设备'/dev/video0':没有该文件或目录
[00007f9884013920] v4l2流错误:无法打开设备'/dev/video0':没有该文件或目录
[00007f9884013920] v4l2流错误:无法打开设备'/dev/video0':没有该文件或目录
[00007f989820af20] 主输入错误:无法打开您的输入
[00007f989820af20] 主输入错误:VLC无法打开MRL 'v4l2:///dev/video0 :v4l2-width=3840 :v4l2-height=2160'。有关详细信息,请检查日志。

当我从命令行执行以下命令时,它可以完美运行:

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/JavaFX 14.0.2.1、vlcj 4.7.0 vlcj-javafx 1.0.2、VLC 3.0.9.2、Eclipse 2020-06上运行所有这些内容。

感谢任何帮助!

英文:

I'm trying to get the vljc-javafx-demo application running and I'm running in to the following problem:

[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.

When I issue the following from the command line it works perfectly:

vlc v4l2:///dev/video0 :v4l2-width=3840 :v4l2-height=2160

This is the minimum MRL that will work with this new capture device (Magewell Eco Capture HDMI 4K M2.2). I've been using FfmpegFrameGrabber and OpenCV libraries from Bytedeco but I'm hoping to improve performance with this library if I can get it to work.

As for 'Check the log for details', nothing is logged anywhere as far as I can tell. I set up VLC to log to file and to syslog and there's nothing generated by this demo application.

I did add my user to the video group even though the VLC command line worked without me being in the group, and that had no effect.

Running all this on Ubuntu 20.04, JavaSE 14/JavaFX 14.0.2.1, vlcj 4.7.0 vlcj-javafx 1.0.2, VLC 3.0.9.2, Eclipse 2020-06.

Thanks for any help!

答案1

得分: 1

MRL应为v4l2://

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

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

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

英文:

The MRL should be v4l2://.

Then you use media options or MediaPlayerFactory arguments:

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

Either create the MediaPlayerFactory with those args, or pass them as media options when you use play().

huangapple
  • 本文由 发表于 2020年10月21日 13:43:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/64457326.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定