<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div>
<div id="appendonsend"></div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">Message: 6<br>
Date: Fri, 23 Apr 2021 10:37:29 +0100<br>
From: Philippe Normand <phil@base-art.net><br>
To: gstreamer-devel@lists.freedesktop.org<br>
Subject: Re: Question about pipeline architecture/logic<br>
Message-ID:<br>
<3f702e9543cce8da5d9b8870ff22e1082ea82871.camel@base-art.net><br>
Content-Type: text/plain; charset="UTF-8"<br>
<br>
Hi Alix,<br>
<br>
On Thu, 2021-04-22 at 20:21 +0000, Alix Bott via gstreamer-devel wrote:<br>
> Hi, I am new to GStreamer and I am developing a program with it, and<br>
> I am struggling to translate my logic to the pipeline paradigm.<br>
> My program is a screen recorder that keeps a 30s backlog of video.<br>
> When the user presses a button, the backlog is saved to a file.<br>
> <br>
> My idea to solve this was to have a pipeline like this:<br>
> windowsrc -> videoconvert -> nvenc -> h264parse -> queue -> tee?<br>
> The queue serves as the backlog, and I dynamically attach a<br>
> mp4mux/filesink after the tee when the button is pressed.<br>
> <br>
> This seems to work, however the video takes 30s to save since it has<br>
> to wait until the queue spitted out 30s of video.<br>
<br>
I suspect that's because the sink synchronizes on the clock by default.<br>
Can you set its sync property to FALSE? That should force it to process<br>
buffers as fast as possible.<br>
<br>
Philippe<br>
<br>
> I thought about simply emptying the whole queue at once, but then I<br>
> wouldn't be able to press the button multiple times in less than 30s.<br>
> I looks to me as if I need to somehow copy the queue and its data<br>
> along with it to let the copy empty all at once in the filesink while<br>
> keeping the backlog intact.<br>
> <br>
> Is it possible to do this? Do I need a different pipeline<br>
> architecture? Or will I have to use appsinks and appsrcs and patch<br>
> together my own ring buffer implementation?<br>
> _______________________________________________<br>
> gstreamer-devel mailing list<br>
> gstreamer-devel@lists.freedesktop.org<br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
------------------------------</div>
<div class="PlainText"><br>
</div>
<div class="PlainText">Hi Philippe,</div>
<div class="PlainText">Thank you for your reply.<br>
</div>
<div class="PlainText">I think I can get the queue to process all my buffers instantly and output them all to the filesink as fast as possible,</div>
<div class="PlainText">but then, if I press the button again after 5sec, since the queue has already been emptied into the first filesink, I will only get back 5sec of video in my file (instead of the last 30sec recorded from screen)</div>
<div class="PlainText"><br>
</div>
<div class="PlainText">The more I think about it, the more I believe that I'll just need to do away with the queue entirely and use appsinks and appsrcs to do it manually.<br>
</div>
</span></font></div>
</div>
</body>
</html>