ImportError: cannot import name GstRtspServer

Giacomo Difruscolo omagico.olo at gmail.com
Sun Jun 7 10:45:33 PDT 2015


Sorry for my bad english!

I'm new to Gstreamer and Python. I'm trying to compile a simple python file
like this and I get this error: ImportError: cannot import name
GstRtspServer
Can someone help me?
Thanks a lot

import sys
import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst, GObject, GstRtspServer

if __name__ == "__main__":
    GObject.threads_init()
    loop = GObject.MainLoop()
    Gst.init(None)

    server = GstRtspServer.RTSPServer()
    server.set_service('554')

    factory = GstRtspServer.RTSPMediaFactory()
    factory.set_launch("( rpicamsrc name=src bitrate=0
quantisation-parameter=24 intra-refresh-type=cyclic
metering-mode=matrix annotation-mode=12 preview=false !
video/x-h264,profile=baseline,width=640,height=480,framerate=30/1 !
h264parse ! rtph264pay pt=96 name=pay0 )")
    factory.set_shared(True)

    server.get_mount_points().add_factory("/video", factory)

    server.attach(None)
    print("stream ready at rtsp://paitu:554/video")

    loop.run()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150607/ccf0033c/attachment.html>


More information about the gstreamer-devel mailing list