pygobject / pgi-docgen

API Documentation Generator for PyGObject
https://lazka.github.io/pgi-docs/
GNU Lesser General Public License v2.1
127 stars 36 forks source link

I can't initialize Gst with no parameters #161

Closed aliyilmazz closed 6 years ago

aliyilmazz commented 6 years ago

Hello, I needed to use gi libraries in python3.6 and I came across your repository. So here is my code:

import pgi
pgi.install_as_gi()
import gi 
## in order to verify that gi belongs to pgi, here is the testcode:
## >>> print(gi)
## <module 'pgi' from '/usr/local/lib/python3.6/dist-packages/pgi/__init__.py'>
gi.require_version('Gst', '1.0')
gi.require_version('GstController', '1.0')
from gi.repository import Gst
Gst.init(None)
command = "filesrc location=/home/yilmazali/Downloads/video.wmv ! decodebin ! videoscale ! video/x-raw,width=400,height=300 ! x264enc ! queue2 ! mpegtsmux ! filesink location=/home/yilmazali/videoedited.wmv"
pipeline = Gst.parse_launch(command)
print("Starting operation...")
pipeline.set_state(Gst.State.PLAYING)
print("Operation completed!")

I have used this code in a python3.5 environment, using gi libraries. However, I couldn't make gi work on python3.6 so I wanted to use your pgi library. At the code above, Gst.init(None) gives error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 5, in init
TypeError: object of type 'NoneType' has no len()

can you help me with this? I would appreciate any feedback. Thank you for your time.

aliyilmazz commented 6 years ago

sorry, it was misplaced. I moved this issue to pgi repository.