Le mardi 05 septembre 2017 à 11:20 +0000, luke a écrit :
> I would like to use gstreamer through the CLI to store a video when
> motion is detected but I don't know how to configure the sink to
> store the images only if a motion is detected. Something like:
> gst-launch-1.0 v4l2src ! videoconvert ! motioncells ! ???
> I don't care about the cells themselves. Actually, I would rather not
> have them rendered on the stored file.
You'll need to program something, gst-launch-1.0 does not have support
for changing the stream upon a message. Programatically, you'll need to
watch for element messages on the bus. The simplest is to use a tee,
when there is activity, create a new branch on the tee. When activity
ends, disconnect the branch, push an EOS and discard.
p.s. An example monitor pipeline, with a statically connect recording
branch for demonstration: