<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 14, 2019 at 4:00 PM pisymbol . <<a href="mailto:pisymbol@gmail.com">pisymbol@gmail.com</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"><div dir="ltr"><div>The doc states the following:</div><div><br></div><div>"If the <a href="https://gstreamer.freedesktop.org/documentation/multifile/multifilesink.html#multifilesink:post-messages" target="_blank">post-messages</a> property is <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS" target="_blank">TRUE</a>, it sends an application
message named <code>GstMultiFileSink</code> after writing each buffer.</div><div><p>The message's structure contains these fields:</p>
<ul><li>
<a href="https://docs.python.org/3/library/functions.html#int" target="_blank">int</a> *<code>filename</code>: the filename where the buffer was written.</li><li>
<a href="https://docs.python.org/3/library/functions.html#int" target="_blank">int</a> <code>index</code>: index of the buffer.</li><li>
<a href="https://docs.python.org/3/library/functions.html#int" target="_blank">int</a> <code>timestamp</code>: the timestamp of the buffer.</li><li>
<a href="https://docs.python.org/3/library/functions.html#int" target="_blank">int</a> <code>stream-time</code>: the stream time of the buffer.</li><li>
<a href="https://docs.python.org/3/library/functions.html#int" target="_blank">int</a> running-time`: the running_time of the buffer.</li><li>
<a href="https://docs.python.org/3/library/functions.html#int" target="_blank">int</a> <code>duration</code>: the duration of the buffer.</li><li>
<a href="https://docs.python.org/3/library/functions.html#int" target="_blank">int</a> <code>offset</code>: the offset of the buffer that triggered the message.</li><li>
<a href="https://docs.python.org/3/library/functions.html#int" target="_blank">int</a> <code>offset-end</code>: the offset-end of the buffer that triggered the message"<br></li></ul></div><div>Source: <a href="https://gstreamer.freedesktop.org/documentation/multifile/multifilesink.html?gi-language=python#properties" target="_blank">https://gstreamer.freedesktop.org/documentation/multifile/multifilesink.html?gi-language=python#properties</a></div><div><br></div><div>But when my pipeline runs, the message I see on the bus is Gst.MessageType.ELEMENT with the message.src set to a GstMultiFileSink.</div><div><br></div><div>Where can I get the application specific data? I need a callback after every capture file is written via multifilesink.</div><br></div></blockquote><div><br></div><div>So the doc is flat out wrong. But after digging into source this worked for you Googlers:</div><div><br></div><div>Register a message handler on your bus:</div><div><br></div><div> bus = pipeline.get_bus()<br> bus.add_watch(GLib.PRIORITY_DEFAULT, on_message)</div><div><br></div><div>Then in on_message do:</div><div><br></div><div> def on_message(bus, message):<br> if message.type == Gst.MessageType.ELEMENT:<br> if message.src.name.startswith("multifilesink"):<br> msg_struct = message.get_structure()<br> print(msg_struct.get_string('filename')) # Prints out the current capture file</div><div><br></div><div>Need MOAR doc! :-)<br></div><div><br></div><div>-aps<br></div><div><br></div></div></div>