rtsp-media.c:2730:gst_rtsp_media_get_rates: assertion failed: (FALSE)
This is working:
import sys
import gi
gi.require_version('Gst', '1.0')
gi.require_version('GstRtspServer', '1.0')
from gi.repository import Gst, GstRtspServer, GLib
loop = GLib.MainLoop()
Gst.init(None)
class MyFactory(GstRtspServer.RTSPMediaFactory):
def __init__(self, **properties):
super(MyFactory, self).__init__(**properties)
self.launch_string = "( videotestsrc is-live=1 ! x264enc ! rtph264pay name=pay0 pt=96 )"
def do_create_element(self, url):
return Gst.parse_launch(self.launch_string)
class GstServer(GstRtspServer.RTSPServer):
def __init__(self, **properties):
super(GstServer, self).__init__(**properties)
self.factory = MyFactory()
self.factory.set_shared(True)
self.get_mount_points().add_factory("/test", self.factory)
self.attach(None)
server = GstServer()
loop.run()
vlc rtsp://127.0.0.1/8554
This crashes the python script:
import sys
import gi
gi.require_version('Gst', '1.0')
gi.require_version('GstRtspServer', '1.0')
from gi.repository import Gst, GstRtspServer, GLib
loop = GLib.MainLoop()
Gst.init(None)
class MyFactory(GstRtspServer.RTSPMediaFactory):
def __init__(self, **properties):
super(MyFactory, self).__init__(**properties)
permissions = GstRtspServer.RTSPPermissions()
permissions.add_permission_for_role("user", "media.factory.access", True)
permissions.add_permission_for_role("user", "media.factory.construct", True)
self.set_permissions(permissions)
self.launch_string = "( videotestsrc is-live=1 ! x264enc ! rtph264pay name=pay0 pt=96 )"
def do_create_element(self, url):
return Gst.parse_launch(self.launch_string)
class GstServer(GstRtspServer.RTSPServer):
def __init__(self, **properties):
super(GstServer, self).__init__(**properties)
self.factory = MyFactory()
self.factory.set_shared(True)
self.get_mount_points().add_factory("/test", self.factory)
self.attach(None)
server = GstServer()
auth = GstRtspServer.RTSPAuth()
token = GstRtspServer.RTSPToken()
token.set_string('media.factory.role', "user")
basic = GstRtspServer.RTSPAuth.make_basic("user", "password")
auth.add_basic(basic, token)
server.set_auth(auth)
loop.run()
vlc rtsp://user:password@127.0.0.1:8554
ERROR:../gst-rtsp-server-1.18.5/gst/rtsp-server/rtsp-media.c:2730:gst_rtsp_media_get_rates: assertion failed: (FALSE)
But this is working:
vlc rtsp://127.0.0.1:8554
Enter username and password in the login window from vlc