Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gstreamer gstreamer
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 670
    • Issues 670
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 353
    • Merge requests 353
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GStreamer
  • gstreamergstreamer
  • Issues
  • #929

Closed
Open
Created Dec 16, 2021 by iTux@cubit9-danielpeyer

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

Assignee
Assign to
Time tracking