<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 -- > jpecgenc->udpsink</div>
<div class="gmail_quote">src ---> caps filter -> tee </div>
<div class="gmail_quote"> -queue --- > ffmpegcolorspace ! xvimagesink </div>
<div class="gmail_quote"> </div>
<div class="gmail_quote"> gst-launch v4l2src ! 'video/x-raw-yuv,width=320,height=240,format=(fourcc)I420,framerate=(fraction)20/1' ! 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"><<a href="mailto:sfaizanh@yahoo.com" target="_blank">sfaizanh@yahoo.com</a>></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("videoPipeline");<br> audioPipeline = gst_pipeline_new("audioPipeline");<br>
/* create video elements */<br><br> src = gst_element_factory_make("v4l2src", "video-src");<br> splitter = gst_element_factory_make("tee", "video-splitter");<br>
sink = gst_element_factory_make("xvimagesink", "video-localsink");<br>
videoStream = gst_element_factory_make("udpsink", "video-transmitter");<br> queue1 = gst_element_factory_make("queue","queue1");<br> queue2 = gst_element_factory_make("queue","queue2");<br>
<br> videoDec = gst_element_factory_make("jpegdec", "decoder");<br> videoFilter = gst_element_factory_make ("ffmpegcolorspace", "filter");<br><br> if (!videoPipeline)<br>
{<br> printf("GStreamer Error: Could not create pipeline\n");<br> }<br><br> if(!src || !videoStream || !sink || !videoDec || !videoFilter)<br> {<br><br> printf("GStreamer Error: Video Elements: Could not create element\n");<br>
}<br><br> if (!splitter)<br> {<br><br> printf("GStreamer Error: Splitter Element: Could not create video<br>splitter\n");<br> }<br><br> if (!videoStream)<br> {<br>
printf("Stream Creation failure.\n");<br> }<br><br> g_object_set(G_OBJECT(src),"device","/dev/video0",NULL);<br><br> caps = gst_caps_new_simple ("image/jpeg",<br>
"width", G_TYPE_INT, 320,<br> "height", G_TYPE_INT, 240,<br> "framerate",GST_TYPE_FRACTION,100,1,<br> NULL);<br>
<br> // UDP Connection<br> g_object_set(G_OBJECT(videoStream),"host",ipaddr, "port", 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("Source -> Splitter Link failure\n");<br> }<br><br><br>
pad1 = gst_element_get_request_pad(splitter, "src%d");<br> pad2 = gst_element_get_request_pad(splitter, "src%d");<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("Link between queue and stream failed.\n");<br> }<br><br> if (!gst_element_link_many(queue2, videoDec, videoFilter, sink, NULL))<br>
{<br> printf("queue -> Local Src link failed\n");<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 -> updsink<br>Source -> encode.to.jpeg -> filter -> tee<br> -queue -><br>
decode.jpeg > 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' 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>