Installing gstreamer 1.0 on windows for python 2.7.

余生颓废 提交于 2019-12-06 08:33:26

问题


I've been trying to install gstreamer 1.0 on windows to use as a python 2.7 module. I installed the sdk from here http://docs.gstreamer.com/display/GstSDK/Installing+on+Windows which allows me to import pygst, but it only allows me to use gstreamer 0.1 (If I try pygst.require('1.0') I get a pygst.RequiredVersionError only version '0.10' is available).

I looked all over for a gstreamer 1.0 version of the sdk with no luck, so I'm hoping I can maybe alter the 0.1 sdk for my needs.

I've downloaded gstreamer 1.0 from here http://gstreamer.freedesktop.org/data/pkg/windows/1.5.2/ but I'm not actually sure what to do with it after I fix the RequiredVersionError/obtain the proper sdk. Any help is appreciated.


回答1:


With Python 3.4.3 works.

  1. Download from: http://sourceforge.net/projects/pygobjectwin32/files/?source=navbar

  2. Install in Windows pygi-aio-3.14.0_rev22-setup.exe

  3. In the program .py:

    import gi
    
    gi.require_version('Gst', '1.0')
    
    from gi.repository import Gst
    
    pipeline = Gst.Pipeline.new("player")
    
    src = Gst.ElementFactory.make("audiotestsrc", "src")
    
    sink = Gst.ElementFactory.make("autoaudiosink", "output")
    
    pipeline.add(src)
    
    pipeline.add(sink)
    
    src.link(sink)
    
    pipeline.set_state(Gst.State.PLAYING)
    

And enjoy more ..



来源:https://stackoverflow.com/questions/31149041/installing-gstreamer-1-0-on-windows-for-python-2-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!