<html><head></head><body><div>Le mercredi 08 septembre 2021 à 10:35 -0400, Dwight Kulkarni via gstreamer-devel a écrit :</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I am trying to get my pipeline to add a datetime stamp to the location, as opposed to the numeric value. </div><div><br></div><div>Previously I was using: splitmuxsink location=video%02d.mkv</div><div><br></div><div>This is creating multiple files with video00.mkv etc. names.</div><div><br></div><div>Now I tried using: splitmuxsink location=video$(date +%s).mkv</div><div><br></div><div>This is creating only a single file with timestamp and appears to overwrite the previous files. </div><div><br></div><div>1) I see some examples where a callback is used. Should I use a callback or is there another way ?</div><div><br></div><div>2) If I use callback, I have GstMediaFactory object where I assign the pipeline with: <span style="background-color:transparent;font-family:inherit;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-weight:inherit;white-space:inherit;font-size:13px">gst_rtsp_media_factory_set_launch</span></div></div></blockquote><div><br></div><div>You have to connect to the "media-configure" signal of your factory:</div><div><br></div><div><a href="https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/-/blob/master/examples/test-appsrc.c#L123">https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/-/blob/master/examples/test-appsrc.c#L123</a></div><div><br></div><div>And then use gst_rtps_media_get_element() to retreive the pipeline:</div><div><br></div><div><a href="https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/-/blob/master/examples/test-appsrc.c#L66">https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/-/blob/master/examples/test-appsrc.c#L66</a></div><div><br></div><div>regards,</div><div>Nicolas</div><div><br></div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>I can't seem to find how to access the pipeline element in GstMediaFactory object.</div><div><br></div><div>I want to do something like this code:</div><div><br></div><div><pre class="gmail-default gmail-s-code-block" style="margin-top:0px;padding:12px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:1.30769;font-size:13px;vertical-align:baseline;box-sizing:inherit;width:auto;max-height:600px;overflow:auto;border-radius:5px"><code class="gmail-hljs gmail-language-php" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;background-color:transparent;white-space:inherit"><span class="gmail-hljs-built_in" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">static</span> gchararray
format_location_callback (GstElement * splitmux,
guint fragment_id,
gpointer udata)
{
<span class="gmail-hljs-built_in" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">static</span> <span class="gmail-hljs-keyword" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">int</span> i =<span class="gmail-hljs-number" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">0</span>;
gchararray myarray = g_strdup_printf(<span class="gmail-hljs-string" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">"myvid%d.mp4"</span>, i);
i += <span class="gmail-hljs-number" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">1</span>;
<span class="gmail-hljs-keyword" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">return</span> myarray;
}</code></pre></div><div><span style="background-color:initial;color:rgb(0,0,0);font-family:Consolas,Monaco,"andale mono","ubuntu mono",monospace;font-size:14px"><br></span></div><div><pre class="gmail-default gmail-s-code-block" style="margin-top:0px;padding:12px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:1.30769;font-size:13px;vertical-align:baseline;box-sizing:inherit;width:auto;max-height:600px;overflow:auto;border-radius:5px"><code class="gmail-hljs gmail-language-php" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;background-color:transparent;white-space:inherit">g_signal_connect (G_OBJECT (bin->sink), <span class="gmail-hljs-string" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">"format-location"</span>,
G_CALLBACK (format_location_callback), bin);</code></pre></div><div><br></div><div>Any help is appreciated. Thanks !<br><div><br></div></div></div></blockquote><div><br></div><div><span></span></div></body></html>