<div dir="ltr"><div dir="ltr">Hello,<br>Do a SEGMENT seek to 0.0 when you receive Gst.MessageType.SEGMENT_DONE.<br></div><div><br></div><div><br></div>\o<div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Mar 29, 2020 at 9:45 PM Tyler Compton <<a href="mailto:xaviosx@gmail.com">xaviosx@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi list,<div><br></div><div>I've been trying to create an RTSP stream from a video file source and have the video loop back to the start when it ends. This has ended up being quite tricky and I suspect I'm missing something obvious. My pipeline looks something like this:</div><div><br></div><div>filesrc location=video.mp4 ! parsebin ! rtph264pay name=pay0</div><div><br></div><div>My current solution is to subclass RTSPMedia and override the do_handle_message method. I capture EOS messages and seek the pipeline back to the start. However, this doesn't seem to have any effect. The stream just ends like normal.</div><div><br></div><font face="monospace">class MyRTSPMedia(GstRtspServer.RTSPMedia):<br>    def do_handle_message(self, message):<br>        print("Got message:", message.type)<br>        if message.type == Gst.MessageType.EOS:<br>            pipeline: Gst.Pipeline = self.get_property("element")<br>            seek_result = pipeline.seek(<br>                rate=1.0,<br>                format=Gst.Format.TIME,<br>                flags=Gst.SeekFlags.FLUSH,<br>                start_type=Gst.SeekType.SET,<br>                start=0,<br>                stop_type=Gst.SeekType.NONE,<br>                stop=-1)<br>            if not seek_result:<br>                logging.error(<br>                    f"Failed to seek stream back to start! Seek "<br>                    f"returned {seek_result}")<br>            return True<br>        return GstRtspServer.RTSPMedia.do_handle_message(self, message)<br></font><div><br></div><div>I provide this class to my RTSPMediaFactory with the set_media_gtype method.</div><div><br></div><div>I noticed that gst-rtsp-server reports the video length to the client, so the client expects the stream to only last for as long as the original video. I would like the client to treat the source as a live, unending stream. Is it possible that this inaccurate runtime is the source of my problem?</div></div>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div></div></div>