<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 22 Sep 2021, at 3:08 am, Andres Gonzalez via gstreamer-devel <<a href="mailto:gstreamer-devel@lists.freedesktop.org" class="">gstreamer-devel@lists.freedesktop.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi Chris,<div class=""><br class=""></div><div class="">Using a <b class=""><i class="">tsparse</i></b> element after the udpsrc and before a hlssink2 (not hlssink) gives this runtime error:<div class=""><br class=""></div><div class="">GStreamer-CRITICAL **: 18:42:53.362: Element splitmuxsink0 already has a pad named video, the behaviour of gst_element_get_request_pad() for existing pads is undefined!<br class=""></div><div class=""><br class=""></div><div class="">But using a <b class=""><i class="">tsdemux</i></b> after udpsrc and before hlssink2 does indeed work. This pipeline works great:</div><div class=""><br class=""></div><div class=""> gst-launch-1.0 udpsrc port=50000 caps="video/mpegts,systemstream=true" ! tsdemux ! hlssink2 target-duration=5 playlist-location="playlist.m3u8" location=segment_%05d.ts<br class=""></div></div><div class=""><br class=""></div><div class="">However, when I code this pipeline up in my C++ application (using gst_element_factory_make(), gst_bin_add(), and gst_element_link()), I get that same runtime error I got when using tsparse.</div><div class=""><br class=""></div><div class="">So the pipeline: udpsrc --> tsdemux --> hlssink2. works when I use gst-launch. But when I code it up manually, I get that runtime error. So those 3 elements won't work using the typical gst_element_link() so some other pad linking is going on under the covers.</div><div class=""><br class=""></div><div class="">How do I do the link manually so these 3 elements will link up properly?</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">-Andres</div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 20, 2021 at 6:41 PM Chris Wine via gstreamer-devel <<a href="mailto:gstreamer-devel@lists.freedesktop.org" class="">gstreamer-devel@lists.freedesktop.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class=""><div class="">It might be that hlssink wants to see keyframes and durations of all the content so that it knows where to split... try adding a "tsparse" element after udpsrc. If that doesn't work, you might have to demux the individual audio/video streams, run them through their respective parsers, and then use hlssink2 to remux them.</div><div class=""><br class=""></div><div class="">--Chris<br class=""></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 20, 2021 at 5:45 PM Andres Gonzalez via gstreamer-devel <<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank" class="">gstreamer-devel@lists.freedesktop.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class="">Thanks for your response Chris.<div class=""><br class=""></div><div class="">I tried your suggestion:</div><div class=""><br class=""></div><div class="">gst-launch-1.0 udpsrc port=50000 caps="video/mpegts,systemstream=true" ! hlssink target-duration=5 playlist-location="playlist.m3u8" location=segment.%03d.ts<br class=""></div><div class=""><br class=""></div><div class="">This pipeline is operational, however, it does not create the playlist and just generates a single segment file, and it keeps growing and growing. I think the pipeline needs to know something about the video, otherwise how does it know if it has enough video in the segment file to match the specified target duration? </div><div class=""><br class=""></div><div class="">In my application, I am using hlssink2 for the pipeline that is generating a new video stream (with appsrc, encoder, etc). But this pipeline has a udpsrc and so there isn't an encoder in the pipeline. That is the reason I am using hlssink instead of hlssink2 for this pipeline.</div><div class=""><br class=""></div><div class="">-Andres</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 20, 2021 at 3:14 PM Chris Wine via gstreamer-devel <<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank" class="">gstreamer-devel@lists.freedesktop.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class=""><div class="">Hi Andres,</div><div class=""><br class=""></div><div class="">I believe hlssink takes an mpeg transport stream, so you don't need to have the tsdemux element in there unless you need to do something else to the streams before remuxing them and sending them to hlssink. So maybe just "udpsrc ! hlssink" (with properties of course) will give you want you're looking for.<br class=""></div><div class=""><br class=""></div><div class="">For making sure the caps are correct, you should just be able to set the "caps" property on udpsrc:</div><div class="">udpsrc caps="video/mpegts,systemstream=true"</div><div class=""><br class=""></div><div class="">If you already have separate audio and video streams, I'd use hlssink2 which does the mpegts muxing internally.</div><div class=""><br class=""></div><div class="">--Chris<br class=""></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 20, 2021 at 4:00 PM Andres Gonzalez via gstreamer-devel <<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank" class="">gstreamer-devel@lists.freedesktop.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class="">Just some additional info. I am using gst-launch just to figure out what the appropriate elements should be. I have a C++ app that I develop where I code up the pipeline for my application. But since I am not even sure which elements should be in the pipeline, I am experimenting around with creating the pipeline with gst-launch.<div class="">Thanks,</div><div class="">-Andres</div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 20, 2021 at 1:49 PM Andres Gonzalez <<a href="mailto:andres.agoralabs@gmail.com" target="_blank" class="">andres.agoralabs@gmail.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class="">Hi,<div class="">I have a question about creating an HLS pipeline. I am receiving a MPEG-TS UDP stream and I want to create a pipeline that will receive the UDP TS stream, and then create/publish a corresponding HLS stream. For example, something like this:</div><div class=""><br class=""></div><div class="">gst-launch-1.0 udpsrc port=50000 ! tsdemux ! hlssink playlist-root=<a href="http://192.168.0.100:8080/" target="_blank" class="">http://192.168.0.100:8080</a> location=segment.%03d.ts<br class=""></div><div class=""><br class=""></div><div class="">This actually works and receives the UDP/TS stream and starts to generate the segment_000.ts file. But it never creates the playlist file and keeps adding to the segment_000.ts file.</div><div class=""><br class=""></div><div class="">I am assuming that I need to provide some caps information about the video coming in on the UDP/TS stream but I am not sure how to do that. So could someone tell me what the pipeline should consist of to get this working?</div><div class=""><br class=""></div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</div></blockquote><br class=""></div><div>What worked for me when struggling like this was to use the DOT debug to examine the pipeline in detail. Also I use the parse to build a pipeline eg</div><div><div>pipeline = gst_parse_launch ("v4l2src name=source ! "</div><div> "queue ! "</div><div> "videoscale ! video/x-raw,width=768,height=576 ! "</div><div> "videoconvert ! "</div><div> "xvimagesink name=sink1 force-aspect-ratio=false sync=false", NULL);</div><div>James</div></div><br class=""></body></html>