gpt4 book ai didi

python - python程序中Gst的问题

转载 作者:行者123 更新时间:2023-11-28 22:33:08 29 4
gpt4 key购买 nike

我在制作一个简单的服务器/客户端套接字 python 程序时遇到了麻烦。基本上,我的服务器 (RPi3) 必须将视频(使用 Gstreamer)流式传输到客户端 (Fedora 24)。问题是在我的 Fedora 中,我可以使用 Gstreamer 导入这样的库:

import gi
gi.require_version('Gst', '1.0')
gi.require_version('Gtk', '3.0')
from gi.repository import Gst, GObject, Gtk

但在我的 Raspbian 中我不能,因为:

Traceback (most recent call last):
File "peerMain.py", line 12, in <module>
gi.require_version('Gst', '1.0')
File "/usr/lib/python2.7/dist-packages/gi/__init__.py", line 100, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gst not available

我尝试了很多东西,比如 import gst 或 pygst。我也试过安装一些包,比如

sudo apt-get install libgstreamer1.0-dev libgstreamer1.0-0-dbg libgstreamer1.0-0 gstreamer1.0-tools gstreamer-tools gstreamer1.0-doc gstreamer1.0-x

但是结果是

gstreamer1.0-tools is already the newest version.
gstreamer1.0-x is already the newest version.
libgstreamer1.0-0 is already the newest version.
libgstreamer1.0-0 set to manually installed.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libgstreamer1.0-dev : Depends: libglib2.0-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

当我探索这种依赖性时,它派生于 libglib2.0-0 和 libglib2.0-bin,这些数据包刚刚出现在上一个版本中:

pi@raspberrypi:~ $ sudo apt-get install libglib2.0-0 libglib2.0-bin 
Reading package lists... Done
Building dependency tree
Reading state information... Done
libglib2.0-0 is already the newest version.
libglib2.0-bin is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

我真的需要它,我希望有人能帮助我。

提前致谢。

最佳答案

我刚刚找到了这个问题的解决方案。

基本上,我删除并重新安装所有 gstreamer-1.0,并使用 apt-get 的参数 -f 强制安装依赖项。

sudo apt-get install gstreamer-1.0

我希望这个问题对某人有所帮助。

关于python - python程序中Gst的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40246437/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com