Element as togglerecord to take pictures
GStreamer has gst_video_convert_sample
to convert a raw video buffer into an image. This logic is used by the convert-sample
action of the playsink
element.
It's very useful, but it depends on a video sink with raw video and last-sample
enabled.
One of the first GStreamer elements I did was a takepicsink
that mimics the same logic using a property instead of an element action. It was a very simple sink with two properties: the image filepath string and a takepic boolean.
Inspired by togglerecord
, I want to contribute a new version of my original element to this repository. In Rust, for sure. But my first implementation enhanced to a filter with only a boolean property to chain only one buffer when changing the value.
...tee name=t ! queue ! xvimagesink t. ! queue ! takepic ! jpegenc ! filesink
I prefer this new version because it can be used for other use cases. Also, it supports not only raw video, hardware memories with hardware JPEG encoders like vaapijpegenc
can be used.
The current implementation is very similar to togglerecord
. It can be updated to add this functionality. I already did. I implemented a num-buffers
property to stop recording when reached.
My questions before the contribution:
- A new element or update
togglerecord
withnum-buffers
property? - If a new element,
takepic
is a good name? Should it keep simple or also addnum-buffers
property.