<div dir="ltr"><div>I have fixed the issues you pointed out (was in a hurry and didn't even compile the code before sending the last email), and have done as you said regarding the pads and it is working fine, thanks a lot!</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 25 Mar 2022 at 14:53, Tim-Philipp Müller <<a href="mailto:t.i.m@zen.co.uk">t.i.m@zen.co.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, 2022-03-25 at 14:35 +0000, Diogo Rodrigues wrote:<br>
<br>
Hi,<br>
<br>
> I'm still getting started with GStreamer so I'm not very used to its<br>
> syntax or workings. Namely, I do need to implement the pipeline in C<br>
> (although I know there is a C function that can interpret a string<br>
> description of a gst-launch pipeline, but I'd prefer to do everything<br>
> in C).I am having trouble translating the last part to C:<br>
> <br>
> mux.audio_%u splitmuxsink muxer-factory=oggmux name=mux max-size-<br>
> time=10000000000 location=file-%02u.ogg<br>
> <br>
> More specifically, the parts "mux.audio_%u" and "muxer-factory=oggmux<br>
> name=mux", I can't understand what they mean (even after reading gst-<br>
> launch docs, maybe I'm missing something, please bare with me). This<br>
> is what I've come up with so far, but it is clearly not working:<br>
> <br>
<br>
mux.audio_%u means "link to the element named mux" (we named it with<br>
splitmuxsink name=mux)<br>
<br>
The audio_%u part is the name of a pad template (gst-inspect-1.0<br>
splitmuxsink), so you're basically telling the gst-launch engine what<br>
request pad to request from splitmuxsink.<br>
<br>
If you're using GStreamer 1.20 you can use<br>
<br>
src_pad = gst_element_get_static_pad(identity, "src");<br>
sink_pad = gst_element_request_pad_simple(splitmuxsink, "audio_%u");<br>
pad_link_return = gst_pad_link(src_pad, sink_pad);<br>
<br>
pad_link_return is an enum, not a boolean for what it's worth. Also<br>
make sure the elements have been added to the pipeline/bin before<br>
linking them.<br>
<br>
> g_object_set(identity, "drop-buffer-flags",<br>
> GST_BUFFER_FLAG_HEADER, NULL);<br>
<br>
In this case this works, but in general flags properties are a bit<br>
tricky because the enum is usually not public. You can use the numbers<br>
you see in gst-inspect-1.0 identity (0x400), or you can use<br>
gst_util_set_object_arg(identity, "headers");<br>
<br>
<br>
> g_object_set(sink, "max-size-time", 10000000000 NULL);<br>
<br>
<br>
This is a 64-bit integer, so best to use (guint64) 10000000000 or<br>
G_GUINT64_CONSTANT(10000000000), or (guint64) 10 * GST_SECOND.<br>
<br>
g_object_set() is a vararg function that will fail in interesting ways<br>
if you don't pass the exact type that it expects for the property.<br>
<br>
> gst_bin_add_many(GST_BIN(pipeline), source, parser, decoder,<br>
> converter, encoder, sink, NULL);<br>
> if (gst_element_link_many(source, parser, decoder, converter,<br>
> encoder, sink, NULL) != TRUE)<br>
<br>
It doesn't look like you have the identity in here? (Not that it<br>
matters for making linking work)<br>
<br>
I think you'll have to link like I suggested above (code untested<br>
though), so it creates a request pad with the right pad template.<br>
<br>
Cheers<br>
Tim<br>
<br>
</blockquote></div>