Simple RTSP Pipeline Works with gst-launch But Not with API
Zheng
superxingzheng at gmail.com
Fri Jun 17 01:45:14 UTC 2016
*Thang you in advance!*
*This is the working gst-launch-1.0 pipeline.*
gst-launch-1.0 rtspsrc port-range=5000-5100
location=rtsp://192.168.1.10:8555/right latency=0 ! decodebin ! videoconvert
! video/x-raw,width=640,height=480,format=YUY2 ! autovideosink
*The following is the NOT working C function.*
int startPipeline(const char *vs_location) {
GstElement *pipeline;
GstBus *bus;
guint bus_watch_id;
gst_init(NULL, NULL);
pipeline = gst_pipeline_new("my_pipeline");
bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline));
bus_watch_id = gst_bus_add_watch(bus, bus_callback, NULL);
gst_object_unref(bus);
GstElement *source, *dec_bin, *v_conv, *sink;
source = gst_element_factory_make("rtspsrc", "source");
dec_bin = gst_element_factory_make("decodebin", "dec_bin");
v_conv = gst_element_factory_make("videoconvert", "v_con");
sink = gst_element_factory_make("autovideosink", "sink");
gst_bin_add_many(GST_BIN(pipeline), source, dec_bin, v_conv, sink, NULL);
// Set element properties.
g_object_set(G_OBJECT(source), "port-range", "5000-5100", NULL);
g_object_set(G_OBJECT(source), "location", vs_location, NULL);
g_object_set(G_OBJECT(source), "latency", 0, NULL);
gst_element_link_many(source, dec_bin, v_conv, NULL);
GstCaps *caps;
caps = gst_caps_new_simple(
"video/x-raw",
"width", G_TYPE_INT, 640,
"height", G_TYPE_INT, 480,
"format", G_TYPE_STRING, "YUY2",
NULL);
gst_element_link_filtered(v_conv, sink, caps);
gst_caps_unref(caps);
gst_element_set_state(pipeline, GST_STATE_PLAYING);
loop = g_main_loop_new(NULL, FALSE);
g_main_loop_run(loop);
// Clean up.
gst_element_set_state(pipeline, GST_STATE_NULL);
gst_object_unref(pipeline);
g_source_remove(bus_watch_id);
g_main_loop_unref(loop);
return 0;
}
*Then the Errors are here.*
0:00:00.442295071 16407 0x7f007c01e940 FIXME default
gstutils.c:3825:gst_pad_create_stream_id_internal:<fakesrc0:src> Creating
random stream-id, consider implementing a deterministic way of creating a
stream-id
0:00:00.455584401 16407 0x7f006c0025e0 FIXME rtpjitterbuffer
gstrtpjitterbuffer.c:1395:gst_jitter_buffer_sink_parse_caps:<rtpjitterbuffer0>
Unsupported timestamp reference clock
0:00:00.455616947 16407 0x7f006c0025e0 FIXME rtpjitterbuffer
gstrtpjitterbuffer.c:1403:gst_jitter_buffer_sink_parse_caps:<rtpjitterbuffer0>
Unsupported media clock
0:00:00.457236636 16407 0x7f006c0025e0 WARN basesrc
gstbasesrc.c:2947:gst_base_src_loop:<udpsrc0> error: Internal data flow
error.
0:00:00.457268553 16407 0x7f006c0025e0 WARN basesrc
gstbasesrc.c:2947:gst_base_src_loop:<udpsrc0> error: streaming task paused,
reason not-linked (-1)
Error: Internal data flow error.
Debug: gstbasesrc.c(2947): gst_base_src_loop ():
/GstPipeline:my_pipeline/GstRTSPSrc:source/GstUDPSrc:udpsrc0:
streaming task paused, reason not-linked (-1)
0:00:00.458046376 16407 0x10af5e0 WARN rtspsrc
gstrtspsrc.c:5520:gst_rtspsrc_try_send:<source> receive interrupted
0:00:00.458083322 16407 0x10af5e0 WARN rtspsrc
gstrtspsrc.c:7546:gst_rtspsrc_pause:<source> PAUSE interrupted
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Simple-RTSP-Pipeline-Works-with-gst-launch-But-Not-with-API-tp4678108.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list