Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't call Gst.init with no parameters #44

Closed
aliyilmazz opened this issue Mar 13, 2018 · 3 comments
Closed

Can't call Gst.init with no parameters #44

aliyilmazz opened this issue Mar 13, 2018 · 3 comments

Comments

@aliyilmazz
Copy link

aliyilmazz commented Mar 13, 2018

Hello, I needed to use gi libraries in python3.6 and I came across your library, and I decided to use it. 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.

@lazka
Copy link
Member

lazka commented Mar 13, 2018

Gst.init([]) might work

@aliyilmazz
Copy link
Author

aliyilmazz commented Mar 13, 2018

Thank you for the feedback. I'll test it and edit this message with results once I get home.

Edit: it works, thanks again. However, in my humble opinion, calling Gst.init with args=None should be possible since original gi library accepts it that way.

@lazka
Copy link
Member

lazka commented Mar 15, 2018

@aliyilmazz this library is currently unmaintained, so don't expect any fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants