Udpsrc to autovideosink

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Udpsrc to autovideosink

chrplus3
I'm trying to play a stream from an udpsrc to autovideosink.

Working:
----------------------------------------------------------------------------------

----------------------------------------------------------------------------------

Not working:
----------------------------------------------------------------------------------

----------------------------------------------------------------------------------

The problem is that the elements couldn't be linked.
So i checked whether I need dynamic pad handlers, but every used element is
using "presence: always" for its pads (Gstreamer documentation).

Thanks in advance,
Christian





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Udpsrc to autovideosink

chrplus3
I've just seen, that raw text is not working in this mailing list.

Here is the code again:
Working:
gst-launch-1.0 -v \
udpsrc port=5016 caps="application/x-rtp,encoding-name=JPEG,payload=26" ! \
rtpjpegdepay ! jpegparse ! queue max-size-time=0 max-size-buffers=0 !
jpegdec ! autovideosink

Not working (because element link failed):
...
GstElement *pipeline, *source, *depay, *parse, *queue, *decode, *sink;
GstCaps *caps;
gst_init(&argc, &argv);
pipeline = gst_pipeline_new("pipe");
source = gst_element_factory_make("udpsrc", "source");
depay = gst_element_factory_make("rtpjpegdepay", "depay");
parse = gst_element_factory_make("jpegparse", "parse");
queue = gst_element_factory_make("queue", "queue");
decode = gst_element_factory_make("jpegdec", "decode");
sink = gst_element_factory_make("autovideosink", "sink");
caps = gst_caps_new_simple(
        "video/x-rtp",
        "encoding-name", G_TYPE_STRING, "JPEG",
        "payload", G_TYPE_INT, 26, NULL);
g_object_set(G_OBJECT(source),
        "port", 5016,
        "caps", caps, NULL);
g_object_set(G_OBJECT(queue),
        "max-size-time", 0,
        "max-size-buffers", 0, NULL);
gst_bin_add_many(GST_BIN(pipeline), source, depay, parse, queue, decode,
sink, NULL);
if(!gst_element_link_many(source, depay, parse, queue, decode, sink, NULL))
{
        g_printerr("Elements could not be linked.\n");
        gst_object_unref(pipeline);
        return -1;
}
gst_element_set_state(pipeline, GST_STATE_PLAYING);
...



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Udpsrc to autovideosink

Ian Davidson
Hi Christian,

Some elements have Dynamic Source Pads - so they do not have the source
pad until they have examined what is coming in to them. Such elements
cannot be linked until the element has created the pad.

You need to examine the documentation for each element to see whether
the pads are static or dynamic.  If it is a dynamic pad, you need to
watch for messages from that element - and then dynamically link when
the pad has been created.

gst-launch is clever enough to know that it has to do that!


On 13/09/2017 08:49, chrplus3 wrote:

> I've just seen, that raw text is not working in this mailing list.
>
> Here is the code again:
> Working:
> gst-launch-1.0 -v \
> udpsrc port=5016 caps="application/x-rtp,encoding-name=JPEG,payload=26" ! \
> rtpjpegdepay ! jpegparse ! queue max-size-time=0 max-size-buffers=0 !
> jpegdec ! autovideosink
>
> Not working (because element link failed):
> ...
> GstElement *pipeline, *source, *depay, *parse, *queue, *decode, *sink;
> GstCaps *caps;
> gst_init(&argc, &argv);
> pipeline = gst_pipeline_new("pipe");
> source = gst_element_factory_make("udpsrc", "source");
> depay = gst_element_factory_make("rtpjpegdepay", "depay");
> parse = gst_element_factory_make("jpegparse", "parse");
> queue = gst_element_factory_make("queue", "queue");
> decode = gst_element_factory_make("jpegdec", "decode");
> sink = gst_element_factory_make("autovideosink", "sink");
> caps = gst_caps_new_simple(
> "video/x-rtp",
> "encoding-name", G_TYPE_STRING, "JPEG",
> "payload", G_TYPE_INT, 26, NULL);
> g_object_set(G_OBJECT(source),
> "port", 5016,
> "caps", caps, NULL);
> g_object_set(G_OBJECT(queue),
> "max-size-time", 0,
> "max-size-buffers", 0, NULL);
> gst_bin_add_many(GST_BIN(pipeline), source, depay, parse, queue, decode,
> sink, NULL);
> if(!gst_element_link_many(source, depay, parse, queue, decode, sink, NULL))
> {
> g_printerr("Elements could not be linked.\n");
> gst_object_unref(pipeline);
> return -1;
> }
> gst_element_set_state(pipeline, GST_STATE_PLAYING);
> ...
>
> --
Ian Davidson

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Udpsrc to autovideosink

filnet
In reply to this post by chrplus3
Not sure it explains your issue, but you don't set the same caps in the CLI pipeline and C pipeline.

And you might want to get the detailed error message (using debug output or some other mean).


Le Mercredi 13 septembre 2017 9h49, chrplus3 <[hidden email]> a écrit :


I've just seen, that raw text is not working in this mailing list.

Here is the code again:
Working:
gst-launch-1.0 -v \
udpsrc port=5016 caps="application/x-rtp,encoding-name=JPEG,payload=26" ! \
rtpjpegdepay ! jpegparse ! queue max-size-time=0 max-size-buffers=0 !
jpegdec ! autovideosink

Not working (because element link failed):
...
GstElement *pipeline, *source, *depay, *parse, *queue, *decode, *sink;
GstCaps *caps;
gst_init(&argc, &argv);
pipeline = gst_pipeline_new("pipe");
source = gst_element_factory_make("udpsrc", "source");
depay = gst_element_factory_make("rtpjpegdepay", "depay");
parse = gst_element_factory_make("jpegparse", "parse");
queue = gst_element_factory_make("queue", "queue");
decode = gst_element_factory_make("jpegdec", "decode");
sink = gst_element_factory_make("autovideosink", "sink");
caps = gst_caps_new_simple(
    "video/x-rtp",
    "encoding-name", G_TYPE_STRING, "JPEG",
    "payload", G_TYPE_INT, 26, NULL);
g_object_set(G_OBJECT(source),
    "port", 5016,
    "caps", caps, NULL);
g_object_set(G_OBJECT(queue),
    "max-size-time", 0,
    "max-size-buffers", 0, NULL);
gst_bin_add_many(GST_BIN(pipeline), source, depay, parse, queue, decode,
sink, NULL);
if(!gst_element_link_many(source, depay, parse, queue, decode, sink, NULL))
{
    g_printerr("Elements could not be linked.\n");
    gst_object_unref(pipeline);
    return -1;
}
gst_element_set_state(pipeline, GST_STATE_PLAYING);

...



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Udpsrc to autovideosink

chrplus3
Thanks for every response,

problem fixed by adjusting udpsrc caps.

Regards,
Christian



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel