0

I am trying to make a simple python program using GTK and gstreamer. For this purpose, I need the GES (Gstreamer Editing Services) but I seem to be unable to correctly install the dependencies I need.

So far, I have installed (sudo apt-get install...) gstreamer1.0 which works fine. I have done the same thing with libges-1.0-dev and libges-1.0-0. However, when I try to import GES (from gi.repository import GES) in my python script, I get the following error:

ImportError: cannot import name GES, introspection typelib not found

I am guessing that I am missing something about how to actually install the package, but it seems that I just don't quite know my way around python and Linux as well as I should.

Alex M
  • 2,756
  • 7
  • 29
  • 35
  • May I see the output of `pip3 show gstreamer`. – stovfl Aug 20 '17 at 14:54
  • Running (`pip3 show gstreamer`) does not output anything. Also, when doing (`pip3 search gstreamer`), the only relevant result seems to be (`gstreamer-player`) – ph.nilsson Aug 22 '17 at 17:54

1 Answers1

0

Run the following to verify all Prerequisites:

def Prerequisites():
    import re
    from subprocess import check_output, CalledProcessError, STDOUT
    Desired = {'u':'Unknow', 'i':'Install', 'r':'Remove', 'h':'Hold'}
    Status  = {'n':'Not', 'i':'Inst', 'c':'Conf-files', 'u':'Unpacked', 'f':'halF-conf', 'h':'Half-inst', 'w':'trig-aWait', 't':'Trig-pend'}

    re_pip3 = re.compile('(.+?): (.*?)\n', re.S + re.MULTILINE)
    re_dpkg = re.compile('(.+?)\n', re.S + re.MULTILINE)

    for n, package in enumerate(["python-gst-1.0", "python-gst-1.0", "gir1.2-gstreamer-1.0", "gir1.2-gst-plugins-base-1.0",
                    "gstreamer1.0-plugins-good", "gstreamer1.0-plugins-ugly", "gstreamer1.0-tools"]):
        try:
            if n in [0]:
                output = check_output("pip3 show {}".format(package), shell=True, stderr=STDOUT).decode()
                print('OK: Name: {s[Name]}, Version: {s[Version]}, Location: {s[Location]}'.
                      format(s=dict(re_pip3.findall(output))))
            else:
                output = check_output("dpkg -l {}".format(package), shell=True, stderr=STDOUT).decode()
                for p in re_dpkg.findall(output)[6:]:
                    if p[0:2] == 'ii':
                        print('OK: {} - Desired:{},\tStatus:{}'.format(p, Desired[p[0]], Status[p[1]]))
                    else:
                        print('[FAIL] {} - Desired:{},\tStatus:{}'.format(p, Desired[p[0]], Status[p[1]]))

        except CalledProcessError as exp:
            print('[FAIL] {} - CalledProcessError: {}'.format(package, exp.output.decode()[:-1] or exp))

Please confirm that you want to do something like this: Simple
Dependencies:
* GStreamer core
* gst-plugins-base

GStreamervModules
Installing from local archives


This should be ok: "the only relevant result seems to be (gstreamer-player)"

Try the following:

from gsp import GstreamerPlayer 
player = GstreamerPlayer(None) 
player.queue("/path/to/audio.mp3")

The project site gives this:

Prerequisites
Debian/Ubuntu/Rasbian:

sudo apt-get install python-gst-1.0 \
gir1.2-gstreamer-1.0 gir1.2-gst-plugins-base-1.0 \
gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly \
gstreamer1.0-tools
stovfl
  • 14,998
  • 7
  • 24
  • 51
  • I should perhaps have been a bit more clear. By "relevant result" I meant that that was the only result relating to gstreamer at all. Installing the prerequisites for GstreamerPlayer did unfortunately not help the problem – ph.nilsson Aug 22 '17 at 19:30
  • Yes, the "simple" example is pretty much along the lines of what I'm trying to do. Doing `from gsp import GstreamerPlayer` works just fine. However, when doing: `import gi gi.require_version('Gst', '1.0') gi.require_version('GES', '1.0')`, I get `File "/usr/lib/python3/dist-packages/gi/__init__.py", line 118, in require_version raise ValueError('Namespace %s not available' % namespace) ValueError: Namespace GES not available`... – ph.nilsson Aug 31 '17 at 19:01
  • @ph.nilsson: What about my Second Question - have you verified **all 6** Prerequisites, what gives? – stovfl Aug 31 '17 at 19:46
  • They all seem fine, the output I get is (not sure how to format it better for SO): `Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-============================-===================-===================-============================================================== ii gstreamer1.0-tools 1.10.4-1 amd64 Tools for use with GStreamer` – ph.nilsson Sep 06 '17 at 19:38
  • @ph.nilsson: Updated my Answert. Run the `Prerequisites` Script. Don't post as **Comment**, [Edit] your Question instead. – stovfl Sep 11 '17 at 16:30