<div class="gmail_quote">Instead of first encoding yuv to jpeg and again decoding back it to yuv, its better to encode it just before pushing to udpsink. And this would maintain your final goal also. </div>
<div class="gmail_quote"> </div>
<div class="gmail_quote">                                    -queue  -- &gt; jpecgenc-&gt;udpsink</div>
<div class="gmail_quote">src ---&gt; caps filter -&gt; tee </div>
<div class="gmail_quote">                                   -queue --- &gt; ffmpegcolorspace ! xvimagesink </div>
<div class="gmail_quote"> </div>
<div class="gmail_quote"> gst-launch v4l2src ! &#39;video/x-raw-yuv,width=320,height=240,format=(fourcc)I420,framerate=(fraction)20/1&#39; ! tee name=t  ! queue  ! jpegenc !  udpsink host=127.0.0.1 port=5000   t. ! queue ! ffmpegcolorspace ! xvimagesink</div>

<div class="gmail_quote"><br>
</div>
<div class="gmail_quote"> </div>
<div class="gmail_quote">On Wed, Dec 22, 2010 at 4:27 AM, sfaizanh <span dir="ltr">&lt;<a href="mailto:sfaizanh@yahoo.com" target="_blank">sfaizanh@yahoo.com</a>&gt;</span> wrote:<br>
<blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;" class="gmail_quote"><br>hi i have just found out a bug in my program, when i was coding on my pc i<br>got different camera, now when i switched my application to laptop it dosent<br>

run because of camera<br><br>here is my code and gst command line:<br><br>Command Line:<br>gst-launch v4l2src !<br>image/jpeg,width=320,height=240,framerate=\(fraction\)20/1 !<br>ffmpegcolorspace ! tee name=t ! udpsink host=127.0.0.1 port=5000 t. ! queue<br>

! jpegdec ! xvimagesink<br><br>C code<br><br>       GstCaps *caps;<br>       // Outgoing Pipelines<br>       videoPipeline = gst_pipeline_new(&quot;videoPipeline&quot;);<br>       audioPipeline = gst_pipeline_new(&quot;audioPipeline&quot;);<br>

       /* create video elements */<br><br>       src = gst_element_factory_make(&quot;v4l2src&quot;, &quot;video-src&quot;);<br>       splitter = gst_element_factory_make(&quot;tee&quot;, &quot;video-splitter&quot;);<br>
       sink = gst_element_factory_make(&quot;xvimagesink&quot;, &quot;video-localsink&quot;);<br>
       videoStream = gst_element_factory_make(&quot;udpsink&quot;, &quot;video-transmitter&quot;);<br>       queue1 = gst_element_factory_make(&quot;queue&quot;,&quot;queue1&quot;);<br>       queue2 = gst_element_factory_make(&quot;queue&quot;,&quot;queue2&quot;);<br>

<br>       videoDec = gst_element_factory_make(&quot;jpegdec&quot;, &quot;decoder&quot;);<br>       videoFilter = gst_element_factory_make (&quot;ffmpegcolorspace&quot;, &quot;filter&quot;);<br><br>       if (!videoPipeline)<br>

       {<br>               printf(&quot;GStreamer Error: Could not create pipeline\n&quot;);<br>       }<br><br>       if(!src || !videoStream || !sink || !videoDec || !videoFilter)<br>       {<br><br>               printf(&quot;GStreamer Error: Video Elements: Could not create element\n&quot;);<br>

       }<br><br>       if (!splitter)<br>       {<br><br>               printf(&quot;GStreamer Error: Splitter Element: Could not create video<br>splitter\n&quot;);<br>       }<br><br>       if (!videoStream)<br>       {<br>

               printf(&quot;Stream Creation failure.\n&quot;);<br>       }<br><br>       g_object_set(G_OBJECT(src),&quot;device&quot;,&quot;/dev/video0&quot;,NULL);<br><br>       caps = gst_caps_new_simple (&quot;image/jpeg&quot;,<br>

                       &quot;width&quot;, G_TYPE_INT, 320,<br>                       &quot;height&quot;, G_TYPE_INT, 240,<br>                       &quot;framerate&quot;,GST_TYPE_FRACTION,100,1,<br>                       NULL);<br>

<br>       // UDP Connection<br>       g_object_set(G_OBJECT(videoStream),&quot;host&quot;,ipaddr, &quot;port&quot;, outputPort,<br>NULL);<br><br>       gst_bin_add_many(GST_BIN(videoPipeline),src, splitter, sink, videoDec,<br>

videoFilter, videoStream, queue1, queue2, NULL);<br><br>       if(!gst_element_link_many(src, splitter, NULL))<br>       {<br>               printf(&quot;Source -&gt; Splitter Link failure\n&quot;);<br>       }<br><br><br>

       pad1 = gst_element_get_request_pad(splitter, &quot;src%d&quot;);<br>       pad2 = gst_element_get_request_pad(splitter, &quot;src%d&quot;);<br><br>       gst_element_link(splitter, queue1);<br>       gst_element_link(splitter, queue2);<br>

<br>       if(!gst_element_link_filtered (queue1, videoStream, caps)) {<br>               printf(&quot;Link between queue and stream failed.\n&quot;);<br>       }<br><br>       if (!gst_element_link_many(queue2, videoDec, videoFilter, sink, NULL))<br>

       {<br>               printf(&quot;queue -&gt; Local Src link failed\n&quot;);<br>       }<br><br><br>now i want to encode it to jpep because my camera dosent support image/jpeg<br>but it supports video/x-raw-yuv, so i figured out the command line<br>

<br>gst-launch v4l2src !<br>video/x-raw-yuv,width=320,height=240,framerate=\(fraction\)5/1 !<br>ffmpegcolorspace ! jpegenc ! tee name=t ! udpsink host=127.0.0.1 port=5000<br>t. ! queue ! jpegdec ! xvimagesink<br><br>now can any body explain me how to enccode it :S<br>

im stuck in code :S<br><br>                                                        -queue -&gt; updsink<br>Source -&gt; encode.to.jpeg -&gt; filter -&gt; tee<br>                                                        -queue -&gt;<br>

decode.jpeg &gt; xvimagesink<br><br>--<br>View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/how-to-encode-to-jpeg-plz-help-tp3159848p3159848.html" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/how-to-encode-to-jpeg-plz-help-tp3159848p3159848.html</a><br>

Sent from the GStreamer-devel mailing list archive at Nabble.com.<br><br>------------------------------------------------------------------------------<br>Gaining the trust of online customers is vital for the success of any company<br>

that requires sensitive data to be transmitted over the Web.   Learn how to<br>best implement a security strategy that keeps consumers&#39; information secure<br>and instills the confidence they need to proceed with transactions.<br>

<a href="http://p.sf.net/sfu/oracle-sfdevnl" target="_blank">http://p.sf.net/sfu/oracle-sfdevnl</a><br>_______________________________________________<br>gstreamer-devel mailing list<br><a href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank">gstreamer-devel@lists.sourceforge.net</a><br>

<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br><br>

Sudarshan Bisht<br>