<meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  
  
    <div class="moz-cite-prefix">On 03/05/2013 04:45 PM, Gary Thomas
      [via GStreamer-devel] wrote:<br>
    </div>
    <blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' cite="mid:513612A7.8050607@mlbassoc.com" type="cite"> On
      2013-03-04 16:29, pfarmer wrote:
      <div class="shrinkable-quote"><br>
        > On 03/04/2013 10:25 PM, Gary Thomas [via GStreamer-devel]
        wrote:
        <br>
        >> On 2013-03-04 13:15, pfarmer wrote:
        <br>
        >>
        <br>
        >> > Gary Thomas wrote
        <br>
        >> >> I'm trying to split up a pipeline using
        udpsrc/udpsink elements.
        <br>
        >> >> All of the "network" traffic will be local.
         This is in anticipation
        <br>
        >> >> of having some variable number of sinks for a
        single data source
        <br>
        >> >> (I have a camera that I want to share amongst
        a number of applications)
        <br>
        >> >>
        <br>
        >> >> I have this working pipeline:
        <br>
        >> >>     gst-launch -e -v v4l2src
        device=/dev/video0 queue-size=16 \
        <br>
        >> >>       !
        <br>
        >> >>
video/x-raw-yuv,format='(fourcc)UYVY',width=1280,height=720,framerate=30/1<br>
        >> >> \
        <br>
        >> >>       ! tee name=v-t \
        <br>
        >> >>         v-t. ! queue ! videoscale !
        "video/x-raw-yuv,width=240,height=120"
        <br>
        >> >> ! ffmpegcolorspace ! ximagesink
        force-aspect-ratio=true
        <br>
        >> >> This pipeline just takes the output of the
        camera and displays it in
        <br>
        >> >> a window on my desktop.
        <br>
        >> >>
        <br>
        >> >> I've tried splitting it up like this:
        <br>
        >> >>     # Start the source pipeline
        <br>
        >> >>     gst-launch -e -v v4l2src
        device=/dev/video0 queue-size=16 \
        <br>
        >> >>        !
        <br>
        >> >>
video/x-raw-yuv,format='(fourcc)UYVY',width=1280,height=720,framerate=30/1<br>
        >> >> \
        <br>
        >> >>        ! tee name=v-src \
        <br>
        >> >>          v-src. ! queue ! rtpvrawpay pt=96 !
        udpsink port=61000
        <br>
        >> >>
        <br>
        >> >>     # Display the image
        <br>
        >> >>     gst-launch -e -v udpsrc port=61000  \
        <br>
        >> >>       !
        <br>
        >> >>
        <br>
        >>
"application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)RAW,sampling=(string)YCbCr-4:2:2,depth=(string)8,width=(string)1280,height=(string)720,colorimetry=(string)SMPTE240M,payload=(int)96"<br>
        >> >> \
        <br>
        >> >>       ! rtpvrawdepay \
        <br>
        >> >>       !
        <br>
        >> >>
video/x-raw-yuv,format='(fourcc)UYVY',width=1280,height=720,framerate=30/1<br>
        >> >> \
        <br>
        >> >>       ! tee name=v-t \
        <br>
        >> >>         v-t. ! queue ! videoscale !
        "video/x-raw-yuv,width=240,height=120"
        <br>
        >> >> ! ffmpegcolorspace ! ximagesink
        force-aspect-ratio=true
        <br>
        >> >>
        <br>
        >> >> I can see that the packets are being sent
        between the two pipelines,
        <br>
        >> >> but it looks like they are being quietly
        dropped (no messages).  It's
        <br>
        >> >> not totally clear that they are arriving to
        the second pipeline at all.
        <br>
        >> >> I've also tried this where the source pipeline
        is on one machine and
        <br>
        >> >> the receiving pipeline is on another, still no
        luck.
        <br>
        >> >>
        <br>
        >> >> I know that the CAPS match because I copied
        them from the output of
        <br>
        >> >> a previous run.
        <br>
        >> >>
        <br>
        >> >> Any hints what I might be doing wrong &
        how to make this work?
        <br>
        >> >
        <br>
        >> > Try to make the imagesink not syncing to the
        clock: sync=false
        <br>
        >> > In my case the ximagesink also does not work, I
        have to use the xvimagesink.
        <br>
        >> > For example:
        <br>
        >> > Sender:
        <br>
        >> >   gst-launch -v v4l2src ! tee ! queue !
        ffmpegcolorspace !
        <br>
        >> >
        video/x-raw-yuv,format='(fourcc)UYVY',width=1280,height=720,
        framerate=30/1
        <br>
        >> > ! rtpvrawpay ! udpsink port=61000  tee0. ! queue !
        xvimagesink sync=false
        <br>
        >> > Receiver:
        <br>
        >> >   gst-launch udpsrc port=61000
        caps="application/x-rtp,
        <br>
        >> > encoding-name=(string)RAW,
        sampling=(string)YCbCr-4:2:2, width=(string)1280,
        <br>
        >> > height=(string)720, colorimetry=(string)BT709-2,
        depth=(string)8" !
        <br>
        >> > rtpvrawdepay ! xvimagesink
        <br>
        >>
        <br>
        >> That didn't make any difference, sorry.
        <br>
        >>
        <br>
        >> I also tried adding the extra branch to do a local
        display and ran this
        <br>
        >> between machines - the source machine displays fine,
        the destination shows nothing.
        <br>
        >>
        <br>
        >> Do the above quoted pipelines imply that they actually
        run for you?  Are you
        <br>
        >> using gstreamer-0.10 or 1.0?  (I'm stuck on 0.10 for
        the time being)
        <br>
        >>
        <br>
        >> >
        <br>
        >> >
        <br>
        >> > Gary Thomas wrote
        <br>
        >> >> Is this a reasonable approach to sharing this
        data?  Eventually
        <br>
        >> >> I need to grab & display it on the screen
        while at the same time
        <br>
        >> >> sending it out over a [physical] network.
        <br>
        >> >
        <br>
        >> > On the same machine shared memory might be better
        suited. I.e. with
        <br>
        >> > shmsink/shmsrc (at least on a Unix machine).
        <br>
        >> >
        <br>
        >>
        <br>
        >> Thanks for the pointer, I'll check it out.
        <br>
        >>
        <br>
        >> --
        <br>
        >>
        ------------------------------------------------------------
        <br>
        >> Gary Thomas                 |  Consulting for the
        <br>
        >> MLB Associates              |    Embedded world
        <br>
        >>
        ------------------------------------------------------------
        <br>
        >> _______________________________________________
        <br>
        >> gstreamer-devel mailing list
        <br>
        >> [hidden email]
        </user/SendEmail.jtp?type=node&node=4658879&i=0>
        <br>
        >> <a moz-do-not-send="true"
          href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel"
          target="_top" rel="nofollow" link="external">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
        >>
        <br>
        >>
        <br>
        >>
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
        >> If you reply to this email, your message will be added
        to the discussion below:
        <br>
        >> <a moz-do-not-send="true"
href="http://gstreamer-devel.966125.n4.nabble.com/Break-down-pipelines-using-udpsrc-udpsink-tp4658873p4658879.html"
          target="_top" rel="nofollow" link="external">http://gstreamer-devel.966125.n4.nabble.com/Break-down-pipelines-using-udpsrc-udpsink-tp4658873p4658879.html</a><br>
        >> To start a new topic under GStreamer-devel, email
        [hidden email]
        </user/SendEmail.jtp?type=node&node=4658880&i=0>
        <br>
        >> To unsubscribe from GStreamer-devel, click here.
        <br>
        >> NAML
        <br>
        >> <<a moz-do-not-send="true"
href="http://gstreamer-devel.966125.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml"
          target="_top" rel="nofollow" link="external">http://gstreamer-devel.966125.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml</a>>
        <br>
        >>
        <br>
        > I used gstreamer 0.10.
        <br>
        > "I also tried adding the extra branch" what do you mean by
        that? It should work more easy on the same machine. Also check
        your firewall.
        <br>
        > Does a minimalistic (without tee's and without a real src)
        example work?, like:
        <br>
        > Sender:
        <br>
        >   gst-launch videotestsrc horizontal-speed=5 !
        video/x-raw-yuv ! rtpvrawpay ! udpsink port=5001
        <br>
        > Receiver:
        <br>
        >   gst-launch udpsrc port=5001 caps="application/x-rtp,
        sampling=(string)YCbCr-4:2:2, width=(string)320,
        height=(string)240" ! rtpvrawdepay ! xvimagesink
        <br>
        >
      </div>
      <br>
      Thanks for the pointers.  I started with your examples and
      adjusted
      <br>
      them to fit my needs.  Finally, I ended up rewriting my pipelines,
      <br>
      adding bits piecemeal, until I got something that worked.  I'm
      <br>
      still unsure why my originals did not work, but these pipelines
      <br>
      function as expected:
      <br>
      <br>
      Sender (camera source):
      <br>
         gst-launch -e -v v4l2src device=/dev/video0 queue-size=16 \
      <br>
          !
      video/x-raw-yuv,format='(fourcc)UYVY',width=1280,height=720,framerate=30/1
      \
      <br>
          ! tee name=v-src \
      <br>
            v-src. ! queue leaky=upstream ! rtpvrawpay pt=96 ! shmsink
      socket-path=/tmp/shm-stream.sock \
      <br>
            v-src. ! queue leaky=upstream ! rtpvrawpay pt=96 ! shmsink
      socket-path=/tmp/shm-preview.sock \
      <br>
            v-src. ! queue leaky=upstream ! rtpvrawpay pt=96 ! shmsink
      socket-path=/tmp/shm-record.sock \
      <br>
      <br>
      One receiver (display on screen):
      <br>
         gst-launch -vv shmsrc socket-path=/tmp/shm-preview.sock \
      <br>
           ! "application/x-rtp, sampling=(string)YCbCr-4:2:2,
      width=(string)1280, height=(string)720, payload=(int)96" \
      <br>
           ! rtpvrawdepay ! tee name=v-t \
      <br>
             v-t. ! queue ! videoscale !
      "video/x-raw-yuv,width=240,height=120" ! ffmpegcolorspace !
      ximagesink force-aspect-ratio=true
      <br>
      <br>
      Curiously, the sender pipeline will hang if the queues are not
      leaky.
      <br>
      I also ended up using the shared memory connections as UDP even
      over
      <br>
      the localhost (lo) connection was way too much overhead when I
      have
      <br>
      full size video to handle.
      <br>
      <br>
      -- <br>
      ------------------------------------------------------------
      <br>
      Gary Thomas                 |  Consulting for the
      <br>
      MLB Associates              |    Embedded world
      <br>
      ------------------------------------------------------------
      <br>
      _______________________________________________
      <br>
      gstreamer-devel mailing list
      <br>
      <a moz-do-not-send="true"
        href="/user/SendEmail.jtp?type=node&node=4658897&i=0"
        target="_top" rel="nofollow" link="external">[hidden email]</a>
      <br>
      <a moz-do-not-send="true"
        href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel"
        target="_top" rel="nofollow" link="external">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
      <br>
      <br>
      <hr noshade="noshade" size="1" color="#cccccc">
      <div style="color:#444; font: 12px
        tahoma,geneva,helvetica,arial,sans-serif;">
        <div style="font-weight:bold">If you reply to this email, your
          message will be added to the discussion below:</div>
        <a moz-do-not-send="true"
href="http://gstreamer-devel.966125.n4.nabble.com/Break-down-pipelines-using-udpsrc-udpsink-tp4658873p4658897.html" target="_top" rel="nofollow" link="external">http://gstreamer-devel.966125.n4.nabble.com/Break-down-pipelines-using-udpsrc-udpsink-tp4658873p4658897.html</a>
      </div>
      <div style="color:#666; font: 11px
tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
        To start a new topic under GStreamer-devel, email
        <a href="/user/SendEmail.jtp?type=node&node=4658902&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a> <br>
        To unsubscribe from GStreamer-devel, <a moz-do-not-send="true"
href="" target="_top" rel="nofollow" link="external">click
          here</a>.<br>
        <a moz-do-not-send="true"
href="http://gstreamer-devel.966125.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" target="_top" link="external">NAML</a> </div>
    </blockquote>
    Do you have to use the RTP? It might be not necessary in your case
    since you can drop buffers as you like and it seems you'r not going
    for some sophisticated buffering or compression (and don't have to
    send it to another machine).<br>
    That your queue has to be leaky might be solved with the
    wait-for-connection=false property for the shmsink since the buffers
    will be dropped there in that case. <br>
    <br>
    Here is a pipline which works on my machine:<br>
    Sender:<br>
     gst-launch-1.0  v4l2src ! video/x-raw, width=1280, height=720,
    framerate=30/1 ! tee ! queue ! shmsink socket-path=/tmp/myshm1
    shm-size=10000000 wait-for-connection=false sync=false   tee0. !
    queue ! shmsink socket-path=/tmp/myshm2 shm-size=10000000
    wait-for-connection=false sync=false<br>
    Receiver 1:<br>
    gst-launch-1.0 shmsrc socket-path=/tmp/myshm1 ! video/x-raw,
    format=I420, width=1280, height=720, framerate=30/1 ! xvimagesink<br>
    Receiver 2:<br>
    gst-launch-1.0 shmsrc socket-path=/tmp/myshm2 ! video/x-raw,
    format=I420, width=1280, height=720, framerate=30/1 ! xvimagesink<br>
    <br>
    This should work also with gstreamer-0.10 and your supported camera
    format:<br>
    Sender:<br>
     gst-launch-0.10  v4l2src ! video/x-raw-yuv, width=1280, height=720,
    framerate=30/1, format=\(fourcc\)UYVY ! tee ! queue ! shmsink
    socket-path=/tmp/myshm1 shm-size=10000000 wait-for-connection=false
    sync=false   tee0. ! queue ! shmsink socket-path=/tmp/myshm2
    shm-size=10000000 wait-for-connection=false sync=false<br>
    Receiver 1:<br>
    gst-launch-0.10 shmsrc socket-path=/tmp/myshm1 ! video/x-raw-yuv,
    format=\(fourcc\)UYVY, width=1280, height=720, framerate=30/1 !
    xvimagesink<br>
    Receiver 2:<br>
    gst-launch-0.10 shmsrc socket-path=/tmp/myshm2 ! video/x-raw-yuv,
    format=\(fourcc\)UYVY, width=1280, height=720, framerate=30/1 !
    xvimagesink<br>
    <br>
    <br>
  



        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/Break-down-pipelines-using-udpsrc-udpsink-tp4658873p4658902.html">Re: Break down pipelines using udpsrc/udpsink</a><br/>
Sent from the <a href="http://gstreamer-devel.966125.n4.nabble.com/">GStreamer-devel mailing list archive</a> at Nabble.com.<br/>