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

simo zz simon.zz at yahoo.com
Thu Aug 31 13:26:50 UTC 2017


Hello @Arjen and @Yasushi,
Thank you for your suggestions.I successfully implemented the initial pipeline in C, and now I need to use pads to monitor the data stream.Question: 
Do I need tee and queue even if I want to be able to monitor when each frame as been read ?

@Arjen wrote:
"Alternatively, to get things running quick and dirty from the command line, have it write the decoded output to a file / named pipe by replacing the appsink element by a filesink element"
I tried to execute the following pipe from command line:
gst-launch-1.0 -e v4l2src device=/dev/webcam ! videoconvert ! video/x-raw,width=544,height=288,framerate=10/1 ! v4l2h264enc ! tee name=t ! h264parse ! mp4mux ! filesink location=video.mp4  ! decodebin ! videoconvert ! video/x-raw,format=I420 ! filesink location="file.png"

but gst-launch claims he cannot link filesink0 to decodebin0. It's seems to me that the tee element is not take into account, but I am noob with gst so I can't say a lot..
However I am trying to implement the option #3. Seems to best fit my needs.

Thank you.Regards,Simon
 

    El Miércoles 30 de agosto de 2017 10:41, Arjen Veenhuizen <arjen at moonlightmedia.nl> escribió:
 

 Yasushi SHOJI-2 wrote
> Hi,
> 
> On Tue, Aug 29, 2017 at 11:07 PM, Arjen Veenhuizen
> <

> arjen@

> > 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

Ah, yes, off course, put tee before the encoder. Your suggestion to use the
hand-off signal is also a very good one.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170831/8d1d6828/attachment-0001.html>


More information about the gstreamer-devel mailing list