python - CVLC 无法连接到 D-Bus session

标签 python ubuntu vlc dbus

我在使用 cvlc 流式传输时遇到问题。我目前正在使用 Ubuntu 17.10 和 VLC 2.2.6,如下所示。我通过 python 子进程命令启动流。之后,将以下内容打印到终端。任何帮助表示赞赏。

VLC media player 2.2.6 Umbrella (revision 2.2.6-0-g1aae78981c)
[000055e7514d3d28] dbus interface error: Failed to connect to the D-Bus session daemon: Failed to connect to socket /tmp/dbus-1msq9as6ke: Connection refused
[000055e7514d3d28] core interface error: no suitable interface module
[000055e7513c5a88] core libvlc error: interface "dbus,none" initialization failed
[000055e7514d3d28] dummy interface: using the dummy interface module...
[00007fc8c0006c18] x264 encoder: using cpu capabilities: MMX2 SSE2Fast LZCNT

[00007fc8c0006c18] x264 encoder: profile High, level 3.0

[00007fc8c0006c18] x264 encoder: final ratefactor: 38.84

[00007fc8cc4ffbd8] stream_out_transcode stream out: input interval 33333 (base 1)
[00007fc8cc4ffbd8] stream_out_transcode stream out: output interval 66666 (base 1)
[00007fc8c0006c18] x264 encoder: using SAR=715/714

[00007fc8c0006c18] x264 encoder: using cpu capabilities: MMX2 SSE2Fast LZCNT

[00007fc8c0006c18] x264 encoder: profile High, level 3.0

[00007fc8c8000e08] core input error: ES_OUT_SET_(GROUP_)PCR  is called too late (pts_delay increased to 312 ms)
[00007fc8c8000e08] core input error: ES_OUT_RESET_PCR called
[00007fc8c8000e08] core input error: ES_OUT_SET_(GROUP_)PCR  is called too late (pts_delay increased to 323 ms)
[00007fc8c8000e08] core input error: ES_OUT_RESET_PCR called
...

这是我用来启动子流程的代码。 Opencv 通过管道传输到子进程的标准输入中。
pipe_out = subprocess.Popen([ 'cvlc', "--demux=rawvideo", "--rawvid-fps=30",
                "--rawvid-width=715",
                "--rawvid-height=576",
                "--rawvid-chroma=RV24",
                "-",
                "--sout",
                "#transcode{vcodec=h264,vb=200,fps=15,width=715,height=576}:std{access=http{mime=video/x-flv},mux=ffmpeg{mux=flv},dst=:5052/stream.flv}"],
                stdin = subprocess.PIPE, stdout = subprocess.PIPE) 

最佳答案

通过 sudo chown username.username -R .dbus 添加权限来修复它.
归功于 Harris .

关于python - CVLC 无法连接到 D-Bus session ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51117928/

相关文章:

android - 签名发布 apk 时无法将我的应用程序安装到我的手机

python - 在 Jupyter 笔记本中运行 Dash 时出现问题

python - BLE 使用 gatttool 或 bluepy 订阅通知

python - 如何动态构建 JSON 对象?

javascript - 创建一个 html 表单并使用 javascript 访问其中的 python 脚本?

ubuntu - 通过用户类分配 ISC-DHCP-Server IP 池

ubuntu - 尝试建立第二个站点

ubuntu - 如何让 cron 在 ubuntu 上每 2 小时 11 分钟运行一次?

ios - 如何在 iOS 中以编程方式切换到 EarSpeaker?

ubuntu - vlc 播放器无法播放 m3u8 播放列表