Question about pipeline architecture/logic

Alix Bott bott.alix at outlook.fr
Fri Apr 23 15:04:21 UTC 2021


Message: 6
Date: Fri, 23 Apr 2021 10:37:29 +0100
From: Philippe Normand <phil at base-art.net>
To: gstreamer-devel at lists.freedesktop.org
Subject: Re: Question about pipeline architecture/logic
Message-ID:
        <3f702e9543cce8da5d9b8870ff22e1082ea82871.camel at base-art.net>
Content-Type: text/plain; charset="UTF-8"

Hi Alix,

On Thu, 2021-04-22 at 20:21 +0000, Alix Bott via gstreamer-devel wrote:
> Hi, I am new to GStreamer and I am developing a program with it, and
> I am struggling to translate my logic to the pipeline paradigm.
> My program is a screen recorder that keeps a 30s backlog of video.
> When the user presses a button, the backlog is saved to a file.
>
> My idea to solve this was to have a pipeline like this:
> windowsrc -> videoconvert -> nvenc -> h264parse -> queue -> tee?
> The queue serves as the backlog, and I dynamically attach a
> mp4mux/filesink after the tee when the button is pressed.
>
> This seems to work, however the video takes 30s to save since it has
> to wait until the queue spitted out 30s of video.

I suspect that's because the sink synchronizes on the clock by default.
Can you set its sync property to FALSE? That should force it to process
buffers as fast as possible.

Philippe

> I thought about simply emptying the whole queue at once, but then I
> wouldn't be able to press the button multiple times in less than 30s.
> I looks to me as if I need to somehow copy the queue and its data
> along with it to let the copy empty all at once in the filesink while
> keeping the backlog intact.
>
> Is it possible to do this? Do I need a different pipeline
> architecture? Or will I have to use appsinks and appsrcs and patch
> together my own ring buffer implementation?
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
------------------------------

Hi Philippe,
Thank you for your reply.
I think I can get the queue to process all my buffers instantly and output them all to the filesink as fast as possible,
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)

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210423/409f592f/attachment.htm>


More information about the gstreamer-devel mailing list