jackersson / gstreamer-python

165 stars 51 forks source link

OSError: dlopen(libgstreamer-1.0.so.0, 6): image not found #1

Closed bdhammel closed 4 years ago

bdhammel commented 5 years ago

gst_hack.py was throwing this error, when running on a mac:

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
~/Documents/mythic-projects/OKR_2019Q2/gstreamer_tutorials/test_gst_pipeline.py in <module>
      6 import os
      7 import logging
----> 8 from pygst_utils import utils
      9 logging.basicConfig(level=logging.DEBUG)
     10

~/Documents/mythic-projects/OKR_2019Q2/venv/lib/python3.6/site-packages/pygst_utils/__init__.py in <module>
      4 from gi.repository import Gst, GstBase, GObject, GLib
      5
----> 6 from .gst_hacks import map_gst_buffer, get_buffer_size
      7 from .gst_hacks import map_gst_memory
      8

~/Documents/mythic-projects/OKR_2019Q2/venv/lib/python3.6/site-packages/pygst_utils/gst_hacks.py in <module>
     25 _GST_MAP_INFO_POINTER = POINTER(_GstMapInfo)
     26
---> 27 _libgst = CDLL("libgstreamer-1.0.so.0")
     28 _libgst.gst_buffer_map.argtypes = [c_void_p, _GST_MAP_INFO_POINTER, c_int]
     29 _libgst.gst_buffer_map.restype = c_int

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ctypes/__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
    346
    347         if handle is None:
--> 348             self._handle = _dlopen(self._name, mode)
    349         else:
    350             self._handle = handle

OSError: dlopen(libgstreamer-1.0.so.0, 6): image not found

I was able to get around it by setting https://github.com/jackersson/pygst-utils/blob/master/pygst_utils/gst_hacks.py#L27 to the .dylib path

for my machine, it was this:

libgst = CDLL("/usr/local/lib/libgstreamer-1.0.dylib")

jackersson commented 4 years ago

Fixed here: https://github.com/jackersson/gstreamer-python#setup