Display with recording

Nicolas Dufresne nicolas at ndufresne.ca
Thu Nov 1 17:38:11 UTC 2018

Le jeudi 01 novembre 2018 à 19:48 +0300, Ilya Aleshkov a écrit :
> Hi,
> I'm using a pipeline like this
> gst-launch-1.0 videotestsrc ! tee name=t t. ! queue ! glimagesink t.
> ! queue ! x264enc tune=zerolatency ! filesink location=video.h264
> Everything works. I'm able to display and record at the same time.
> Now I'd like to start/stop recording at any time. What is the best
> strategy to achieve this?
> I know that it's a pretty common question. I have already read a lot
> of materials. But this situation still isn't clear for me.

First, you'll need an app, since that's the limit of what gst-launch-
1.0 tool can handle. To me, the simple strategy is to keep the
recording pipeline separate. So you'd have:

  videotestsrc ! tee name=t
    t. ! queue ! glimagesaink
    t. ! queue ! appsink

  appsrc ! x264enc tune=zerolatency ! video/x-h264,stream-format=byte-stream ! filesink location=video.h264

And then your app will pass the samples from appsink to appsrc. You'll
have the option to make this callback based, blocking loop or a mix.
When you want to stop the recording you'd do:

  - gst_app_src_end_of_stream (appsrc)
  - wait for eos message and reset that pipeline
  - stop further samples.

And then to start again, you simply stop dropping samples.


> Thanks,
> Ilya
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20181101/cb4c9973/attachment.sig>

More information about the gstreamer-devel mailing list