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.
Nicolas
>
> Thanks,
> Ilya
> _______________________________________________
> gstreamer-devel mailing list
>
[hidden email]
>
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel