Problems with Gst in python program
Asked Answered
R

3

9

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

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

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

but the result was

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.

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.

Thanks in advance.

Rumba answered 25/10, 2016 at 17:47 Comment(0)
R
21

I have just found a solution of this problem.

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.

Rumba answered 25/10, 2016 at 23:9 Comment(1)
I believe the command is missing the -f. It should be: sudo apt-get -f install gstreamer-1.0Epicanthus
E
13

I used this solution for installing the GStreamer Python bindings, which worked for Python 3:

sudo apt install python3-gst-1.0
Epicanthus answered 7/9, 2020 at 20:57 Comment(0)
S
0

For Windows 64bit users:

  1. Open msys2 mingw64 and run the following command

    pacman -Syu

  2. Close the window and reopen it again and run the following command

    pacman -S mingw-w64-x86_64-gstreamer mingw-w64-x86_64-gst-devtools mingw-w64-x86_64-gst-plugins-{base,good,bad,ugly} mingw-w64-x86_64-python3 mingw-w64-x86_64-python3-gobject

  3. Keep your python files in "C:\msys64\home\USER_NAME" and run the python file from msys2 mingw64 by typing "python filename.py".

  4. Otherwise If you are using any code editors, change the python interpreter path to "C:\msys64\mingw64\bin\python3.exe"

Scholl answered 25/8, 2024 at 5:7 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.