python程序中的Gst问题 [英] Problems with Gst in python program

查看:856
本文介绍了python程序中的Gst问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm in trouble making a simple server/client socket python program. Basically, my server (RPi3) has to stream a video (with Gstreamer) to the client (Fedora 24). The problem is that in my Fedora, I can use Gstreamer importing the libs like this:

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

但是在我的Raspbian中,我做不到,因为:

But in my Raspbian I can't, because:

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.我也尝试安装一些数据包,例如

I have tried so many things, like import gst or pygst. I also tried install some packets like

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,这些数据包刚出现在最新版本中:

and when I explore that dependence, it derives in libglib2.0-0 and libglib2.0-bin, packets that have just been in the last version:

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.

我真的很需要,希望有人能帮助我.

I really need it, I hope someone can help me.

谢谢.

推荐答案

我刚刚找到了解决此问题的方法.

I have just found a solution of this problem.

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

Basically, I remove and reinstall all gstreamer-1.0 and force to install dependences with the parameter -f of apt-get.

sudo apt-get install gstreamer-1.0

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

I hope that this question will help someone.

这篇关于python程序中的Gst问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆