DecklinkSink and Caps

Krzysztof Konopko krzysztof.konopko at youview.com
Mon Dec 3 06:27:25 PST 2012


Hi Johan,

I don't know what went wrong. Why are trying to make your life more
difficult than necessary?

I replaced ~70 lines of your code with just a few simple calls:

  /* Build the pipeline */

  error = NULL;
  pipeline = gst_parse_launch (
    "rtspsrc name=src timeout=1 buffer-mode=1"
    " latency=9000 protocols=GST_RTSP_LOWER_TRANS_TCP"
    " ! queue ! gstrtpbin latency=250"
    " ! queue min-threshold-time=500000"
    " ! rtph264depay ! ffdec_h264"
    " ! interlace top-field-first=true field-pattern=1"
    " ! videoscale add-borders=false ! videorate"
    " ! ffmpegcolorspace"
    " ! video/x-raw-yuv,framerate=25/1,format=(fourcc)UYVY"
    " ! decklinksink name=sink mode=2",
    &error);

  if (!pipeline) {
    g_printerr ("Cannot create pipeline: %s. Exiting.\n",
                error ? error->message : "(unknown error)");
    if (error) g_error_free (error);
    // actually it should be a goto to free all resources
    // as never know when this code gets reused where it
    // actually matters
    return EXIT_FAILURE;
  }

  src = gst_bin_get_by_name (GST_BIN (pipeline), "src");
  g_object_set (G_OBJECT (src), "location", argv[1], NULL);
  gst_object_unref (src);

  bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
  gst_bus_add_watch (bus, bus_call, loop);
  gst_object_unref (bus);

////////////////////------------***********------------/////////////////////////


and it works (I used autovideosink and
rtsp://cdn.actistream.com/vod/cam1.mp4 resource).

If you need more flexibility you can always refer to elements by their
names as I did for "src". If the pipeline construction has to be more
dynamic than at some point this approach will probably become clumsy but
at least IMHO you should start with something dead simple that works (as
above).

Kris

On 03/12/12 13:54, Johan Peerbolte wrote:
> Hi Kris,
> 
> i have test this and its work for caps  !
> Thanks
> 
> But i have the same error, do you have idea?
> i have add news sources on this mail
> 
> 
> the output of GST_DEBUG=2 :
> CAPS OK
> 
> Now playing: rtsp://10.21.216.105:1935/mystream
> ............................................................................................................................................................................................................................................................0:00:02.518530509
> 10241      0x145e680 WARN                 rtspsrc
> gstrtspsrc.c:4184:gst_rtspsrc_loop:<rtspsrc0> error: Internal data flow
> error.
> 0:00:02.518563366 10241      0x145e680 WARN                 rtspsrc
> gstrtspsrc.c:4184:gst_rtspsrc_loop:<rtspsrc0> error: streaming task paused,
> reason not-linked (-1)
> Error: Internal data flow error.
> Returned, stopping playback
> 0:00:02.519555898 10241      0x145e680 WARN                 rtspsrc
> gstrtspsrc.c:4591:gst_rtspsrc_try_send:<rtspsrc0> receive interrupted
> 0:00:02.519603473 10241      0x145e680 WARN                 rtspsrc
> gstrtspsrc.c:6406:gst_rtspsrc_pause:<rtspsrc0> PAUSE interrupted
> 0:00:02.520729547 10241      0x145e680 WARN                 rtspsrc
> gstrtspsrc.c:4589:gst_rtspsrc_try_send:<rtspsrc0> error: Could not receive
> message. (Parse error)
> 0:00:02.520814868 10241      0x145e680 WARN                 rtspsrc
> gstrtspsrc.c:5885:gst_rtspsrc_close:<rtspsrc0> error: Could not send
> message. (Parse error)
> Deleting pipeline
> 
> 
> 
> 
> 
> 
> 
> 2012/12/3 Krzysztof Konopko <krzysztof.konopko at youview.com>
> 
>> Hi Johan,
>>
>> In GStreamer 0.10.x format type should be GST_TYPE_FOURCC, not
>> G_TYPE_STRING and the value just "UYVY".
>>
>> I guess you're reading documentation for GStreamer 1.0 where the format
>> type is indeed G_TYPE_STRING and the value should be "UYVY". The FOURCC
>> type has been refactored in GStreamer 1.0.
>>
>> BTW, my personal advise is to use gst_parse_launch() wherever you can
>> which will save you time and effort as it allows you to specify
>> pipepline description as you do on the command line. IMHO this is
>> simpler and less error prone. You can still refer to individual elements
>> by their name property. Construct the pipeline on a bit-by-bit basis
>> only when it's absolutely necessary.
>>
>> Kris
>>
>> On 03/12/12 10:39, Johan Peerbolte wrote:
>>> Hello all,
>>>
>>> I have a pipeline  :
>>>
>>> "gst-launch rtspsrc name=src timeout=1 buffer-mode=1 latency=9000
>>> protocols=GST_RTSP_LOWER_TRANS_TCP location=%s ! queue ! gstrtpbin
>>> latency=250 "
>>> "! queue min-threshold-time=500000  ! rtph264depay  ! ffdec_h264 !
>>>  interlace top-field-first=true field-pattern=1 ! videoscale
>>> add-borders=false  ! videorate ! ffmpegcolorspace !  video/x-raw-yuv,
>>> framerate=25/1,format=(fourcc)UYVY ! decklinksink name=sink mode=2"
>>>
>>>
>>>
>>> This play rtsp and output of decklink sdi card, the decklinksink plugin
>>> take only UYVY.
>>> For this i have added caps at the end "video/x-raw-yuv,
>>> framerate=25/1,format=(fourcc)UYVY"
>>>
>>> I want to create a little binary to do the same work, but i have problem,
>>> maybe with caps
>>>
>>> I use this : "
>>>   GstCaps *filtercaps = gst_caps_new_simple ("video/x-raw-yuv",
>>> "framerate", GST_TYPE_FRACTION, 25, 1, "format", G_TYPE_STRING,
>>> "(fourcc)UYVY", NULL);
>>>   g_object_set (G_OBJECT (filter), "caps", filtercaps, NULL);
>>>
>>>   gboolean link_ok = gst_element_link_filtered(colorsp,sink,filtercaps);
>>>   gst_caps_unref (filtercaps);
>>> "
>>>
>>> i have attached sources
>>>
>>>
>>> the ouptut of GST_DEBUG=2 ./mybinary rtsp://server/app/file.mp4
>>>
>>> """""
>>> ** (mybinary:20272): WARNING **: Failed to link caps!
>>> Now playing: rtsp://cdn.actistream.com/vod/cam1.mp4
>>>
>>> A new pad recv_rtp_src_0_1866764401_96 was created
>>> application/x-rtpon the pad
>>> A new pad recv_rtp_src_1_1773709704_97 was created
>>>
>>> application/x-rtp0:00:07.569209168 20272      0x15af050 WARN
>>>   rtspsrc gstrtspsrc.c:4184:gst_rtspsrc_loop:<rtspsrc0> error: Internal
>>> data flow error.
>>> 0:00:07.569229090 20272      0x15af050 WARN                 rtspsrc
>>> gstrtspsrc.c:4184:gst_rtspsrc_loop:<rtspsrc0> error: streaming task
>> paused,
>>> reason not-linked (-1)
>>> Error: Internal data flow error.
>>> Returned, stopping playback
>>> 0:00:07.570128028 20272      0x15af050 WARN                 rtspsrc
>>> gstrtspsrc.c:4591:gst_rtspsrc_try_send:<rtspsrc0> receive interrupted
>>> 0:00:07.570145785 20272      0x15af050 WARN                 rtspsrc
>>> gstrtspsrc.c:6406:gst_rtspsrc_pause:<rtspsrc0> PAUSE interrupted
>>> 0:00:07.582227357 20272      0x15af050 WARN                 rtspsrc
>>> gstrtspsrc.c:4589:gst_rtspsrc_try_send:<rtspsrc0> error: Could not
>> receive
>>> message. (Parse error)
>>> 0:00:07.582267763 20272      0x15af050 WARN                 rtspsrc
>>> gstrtspsrc.c:5885:gst_rtspsrc_close:<rtspsrc0> error: Could not send
>>> message. (Parse error)
>>> Deleting pipeline
>>>
>>> """""
>>>
>>> i think i made a mistake about caps, maybe one person have advice :-)
>>> Thanks
>>> Johan
>>>
>>>
>>>
>>> _______________________________________________
>>> gstreamer-devel mailing list
>>> gstreamer-devel at lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>>
>>
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
> 



More information about the gstreamer-devel mailing list