Opening a webcam which is already in use by a gst-launch

Yasushi SHOJI yasushi.shoji at gmail.com
Wed Aug 30 06:08:03 UTC 2017


Hi,

On Tue, Aug 29, 2017 at 11:07 PM, Arjen Veenhuizen
<arjen at moonlightmedia.nl> wrote:
> What one typically would do is write a little app and use a combination of
> tee and appsink:
>
> gst-launch-1.0 -e v4l2src device=/dev/webcam ! videoconvert !
> video/x-raw,width=544,height=288,framerate=10/1 ! v4l2h264enc ! h264parse !
> tee name=t ! mp4mux ! filesink location=video.mp4 t. ! decodebin !
> videoconvert ! "video/x-raw,format=I420" ! appsink

Wouldn't it be better to tee right before v4l2h264enc, so that you don't have to
decode the frames you just encoded?

Unfortunately, the current tee[1] implementation do memcpy(), so if you don't
need every single frame, I'd suggest using the "handoff" signal from the
identity element or pad probes[2] to get the frame you want, copy it
when you need it.
If you have plenty of CPU time and memory memory bandwidth, don't
worry about the above.

[1]: http://gstreamer-devel.966125.n4.nabble.com/Multiple-sink-usage-in-im6x-td4683174.html
[2]: https://gstreamer.freedesktop.org/documentation/design/probes.html
-- 
               yashi


More information about the gstreamer-devel mailing list