Hi,<br><div class="gmail_quote"><br>I am facing to a problem that I am sure it&#39;s pretty common for some of you.<br>Giving an uri, I am using uridecodebin to automatically select/connect the source and the decoders.<br>
Then I am usually connecting an identity element to grab frames for image processing purposes.<br>
I am also recording the stream but I re-encode it because I need to record what I analysed. (It&#39;s not exactly what I analysed<br>but I can see jerks and image contents, black frames etc..).<br><br>Now I would like to save the original stream. I mean before decoding it.<br>

Here are the steps:<br><br>- use uridecodebin<br>- in autoplug-continue callback, retrieve the decodebin2 element, get its sink pad and call gst_pad_set_blocked_async(TRUE)<br>on the peer pad.<br>- in the associated GstPadBlockCallback, unlink those two pads in order to just insert a tee element and relink them.<br>

- then create and connect a queue2-&gt;filesink to this tee element<br>- unblock the pad<br>- set the newer elements (tee, queue2, filesink) to playing state<br><br>So before to be demuxed, the stream is pushed into a file.<br>

<br>*The first problem is that I do not know how to properly and automatically select the file extension (ogg, flv, mp4...)<br>Note that for now I am using the uri extension maybe there is a proper way to do that.<br>*The second problem is at pipeline shutdown because now just sending an eos event from the pipeline is not working (eos message never comes on the bus)<br>

So it&#39;s due to the add of the branch tee-&gt;queue2-&gt;filesink.<br>I have to block the queue2 &#39;s source pad, and send an eos event from this filesink element, then unlink queue2, set queue2 and filesink to NULL state, and finally send an eos event from the pipeline. In order to be able to catch an eos message on the bus.<br>

<br>Well I am not sure this is the best way to record a stream without decoding it. I know that the stream should be remuxed in order to have the correct origin for the timetsamps, and to have the index correctly written for some containers.<br>

<br><u>So my 3 questions are: </u><br><br>-- Is this goal really too specific and not common to be done in this manually way each time someone wants to achieve it ?<br><br>--In the case there is not a more immediate way, could we imagine a filename property on uridecodebin for this goal ?<br>

<br>--If something like the following functions do not exsit yet, would it be usefull to add api to dynamically insert new elements between existing playing elements:<br>(I can read a lot of mail where the solution is block a pad, unlink, set state, insert, send event, unblock, etc...) ?<br>

<br>gst_element_insert_downstream_async(element, new_element, callback) would try to insert &#39;new_element&#39; the closest possible to &#39;element&#39; in the dwonstream way.<br>gst_element_insert_upstream_async(element, new_element, callback).<br>

gst_element_insert_between_async(downstream_element, up_stream_element, new_element, callback)<br>(well maybe gst_bin_... would be more appropriate, but gst_element_link has those kind of bin considerations too)<br><br>Sincerely<br>
Julien<font color="#888888"><br>
</font></div><br>