Using udpsrc as source in rtsp-server

Damiano Pinarello damiano.pinarello at bticino.it
Mon Dec 3 01:31:27 PST 2012


Hi all,

I'm working on IP camera based on DM365.
I'm using the following pipeline to strem video on 127.0.0.1 and record it at the same time:

  gst-launch \
    v4l2src always-copy=FALSE ! \
    'video/x-raw-yuv,format=(fourcc)NV12,width=640,height=480,framerate=(fraction)30/1' ! \
    TIVidenc1 bitRate=6000000 encodingPreset=2 codecName=h264enc engineName=codecServer contiguousInputFrame=TRUE \
    ! queue ! tee name=t_vid ! \
    queue ! rtph264pay pt=96 ! udpsink host=127.0.0.1 port=5000 t_vid. ! \
    queue ! valve drop=true ! filesink location=/var/tmp/sample.264

About filesink tree, I use valve element to decide when start/stop video recording.

I want to strem video via rtsp-server into three flow: the first is realtime flow, the second is the first delayed of Xsecs
and the third is a play of a recording video.

  GstQueue_r.t_time = (guint64)0;
  GstQueue_r.s_buffers = (guint)0;
  GstQueue_r.s_bytes = (guint)0;
  GstQueue_r.s_time = (guint64)0;

  // REALTIME stream
  pipeline = g_strdup_printf("( "
    " udpsrc port=5000"
    " caps=\"application/x-rtp,media=(string)video,encoding-name=(string)H264\" !"
    " queue min-threshold-time=%lld max-size-buffers=%d max-size-bytes=%d max-size-time=%lld ! rtph264pay pt=96 name=pay0"
    ")", (guint64)GstQueue_r.t_time, (guint)GstQueue_r.s_buffers, (guint)GstQueue_r.s_bytes, (guint64)GstQueue_r.s_time);
  gst_rtsp_media_factory_set_launch(GST_RTSP_MEDIA_FACTORY(realtime), pipeline);

  GstQueue_d.t_time = (guint64)10000000000ULL;
  GstQueue_d.s_buffers = (guint)0;
  GstQueue_d.s_bytes = (guint)0;
  GstQueue_d.s_time = (guint64)0;

  // DELAYED stream
  pipeline = g_strconcat("( "
    " rtspsrc location=rtsp://127.0.0.1:3051/realtime !"
    " queue min-threshold-time=%lld max-size-buffers=%d max-size-bytes=%d max-size-time=%lld ! rtph264pay pt=96 name=pay1"
    ")", (guint64)GstQueue_d.t_time, (guint)GstQueue_d.s_buffers, (guint)GstQueue_d.s_bytes, (guint64)GstQueue_d.s_time);
  gst_rtsp_media_factory_set_launch(GST_RTSP_MEDIA_FACTORY(delayed), pipeline);

  // RECORDED stream
  pipeline = g_strconcat("( "
    " filesrc location=/var/tmp/sample.264 !"
    " queue min-threshold-time=%lld max-size-buffers=%d max-size-bytes=%d max-size-time=%lld ! rtph264pay pt=96 name=pay2"
    ")", (guint64)GstQueue_r.t_time, (guint)GstQueue_r.s_buffers, (guint)GstQueue_r.s_bytes, (guint64)GstQueue_r.s_time);
  gst_rtsp_media_factory_set_launch(GST_RTSP_MEDIA_FACTORY(recorded), pipeline);

Every flow is mapped in a different url on the same rtsp-server:
 - rtsp://10.39.9.76:3051/reltime 
 - rtsp://10.39.9.76:3051/delayed 
 - rtsp://10.39.9.76:3051/recorded 

When I try to recive one video from my desktop with this pipeline:

  gst-launch -v rtspsrc location=rtsp://10.39.9.76:3051/realtime ! rtph264depay ! ffdec_h264 ! xvimagesink

the server return this kind of error that it's the same for every url:

** (gst-player:1499): CRITICAL **: could not parse launch syntax ((  udpsrc port=5000 caps="application/x-rtp,media=(string)video,encoding-name=(string)H264" ! queue min-threshold-time=0 max-size-buffers=0 max-size-bytes=0 max-size-time=0 ! rtph264pay pt=96 name=pay0)): Unrecoverable syntax error while parsing pipeline (  udpsrc port=5000 caps="application/x-rtp,media=(string)video,encoding-name=(string)H264" ! queue min-threshold-time=0 max-size-buffers=0 max-size-bytes=0 max-size-time=0 ! rtph264pay pt=96 name=pay0)

I try to modify a sintax but I don't be able to solve it.

Anyone can help me?

Tnx in advance


-- 

Damiano PINARELLO
Embedded Software Developer
Office Phone: +(39) 031 653679 Ext. 4679
FAX phone: +(39) 031 653283
Street address: Via L. Manara 4, 22036 Erba (CO), Italy
Email: damiano.pinarello at bticino.it
WebSite: www.bticino.it


Ce message, ainsi que tous les fichiers joints à ce message,
peuvent contenir des informations sensibles et/ ou confidentielles
ne devant pas être divulguées. Si vous n'êtes pas le destinataire
de ce message (ou que vous recevez ce message par erreur), nous
vous remercions de le notifier immédiatement à son expéditeur, et
de détruire ce message. Toute copie, divulgation, modification,
utilisation ou diffusion, non autorisée, directe ou indirecte, de
tout ou partie de ce message, est strictement interdite.

This e-mail, and any document attached hereby, may contain
confidential and/or privileged information. If you are not the
intended recipient (or have received this e-mail in error) please
notify the sender immediately and destroy this e-mail. Any
unauthorized, direct or indirect, copying, disclosure, distribution
or other use of the material or parts thereof is strictly
forbidden.


More information about the gstreamer-devel mailing list