【问题标题】:VLC is unable to open th MRL when using vlcj in Java在 Java 中使用 vlc 时,VLC 无法打开 MRL
【发布时间】:2021-02-03 23:59:30
【问题描述】:

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

[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

这是适用于这款新采集设备(美乐威 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 上运行所有这些。

感谢您的帮助!

【问题讨论】:

    标签: java javafx vlcj


    【解决方案1】:

    MRL 应该是v4l2://

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

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

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

    【讨论】:

    • 我凭记忆回答,我已经有一段时间没有使用视频捕获设备了。
    猜你喜欢
    • 2018-11-22
    • 2015-11-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-02-22
    • 2014-12-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多