<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi Simon,<br>
</p>
<p><br>
</p>
<p>You can do something like:<br>
</p>
<p><br>
</p>
<p><strong>gst-launch-1.0 -e v4l2src device=/dev/webcam ! videoconvert ! video/x-raw,width=544,height=288,framerate=10/1</strong> ! tee name=tee0 ! <strong>queue ! v4l2h264enc ! h264parse ! mp4mux ! filesink location=video.mp4</strong> tee0. ! queue ! appsink<br>
</p>
<p><br>
</p>
<p>Note</p>
<p>1) the use of the "tee" element to split the pipeline in two branches<br>
</p>
<p>2) appsink will let you get data out of the pipeline as a (gchar *) C-array every time a new frame arrives (see the "new-sample" signal)<br>
</p>
<p><br>
</p>
<p>Hope that helps<br>
</p>
<p>​Martin<br>
</p>
<p><br>
</p>
<p><br>
</p>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> gstreamer-devel <gstreamer-devel-bounces@lists.freedesktop.org> on behalf of simo zz <simon.zz@yahoo.com><br>
<b>Sent:</b> Thursday, September 7, 2017 10:26 AM<br>
<b>To:</b> Discussion of the Development of and With GStreamer<br>
<b>Subject:</b> Accessing raw data from v4lsrc</font>
<div> <br>
</div>
</div>
<div>
<div style="color:#000; background-color:#fff; font-family:Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size:13px">
<div id="yui_3_16_0_ym19_1_1504775505361_2383">Hello,</div>
<div id="yui_3_16_0_ym19_1_1504775505361_2399">I need to generate a video from a USB webcam and, at the same time, access to the non encoded raw data of the webcam.</div>
<div id="yui_3_16_0_ym19_1_1504775505361_3892">The following pipe works for me to record a video:</div>
<div id="yui_3_16_0_ym19_1_1504775505361_3894"><br>
</div>
<div id="yui_3_16_0_ym19_1_1504775505361_3890" dir="ltr"><b id="yui_3_16_0_ym19_1_1504775505361_3891">gst-launch-1.0 -e v4l2src device=/dev/webcam ! videoconvert ! video/x-raw,width=544,height=288,framerate=10/1 ! v4l2h264enc ! h264parse ! mp4mux ! filesink
 location=video.mp4 <br>
</b></div>
<div id="yui_3_16_0_ym19_1_1504775505361_3902" dir="ltr"><br>
</div>
<div id="yui_3_16_0_ym19_1_1504775505361_3903" dir="ltr">But how do I get the raw data from webcam with gstreamer ?</div>
<div id="yui_3_16_0_ym19_1_1504775505361_6684" dir="ltr">Thank you.</div>
<div id="yui_3_16_0_ym19_1_1504775505361_6683" dir="ltr">Simon<br>
</div>
</div>
</div>
</body>
</html>