Multifilesink messages and unclear doc

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Multifilesink messages and unclear doc

pisymbol .
The doc states the following:

"If the post-messages property is TRUE, it sends an application message named GstMultiFileSink after writing each buffer.

The message's structure contains these fields:

  • int *filename: the filename where the buffer was written.
  • int index: index of the buffer.
  • int timestamp: the timestamp of the buffer.
  • int stream-time: the stream time of the buffer.
  • int running-time`: the running_time of the buffer.
  • int duration: the duration of the buffer.
  • int offset: the offset of the buffer that triggered the message.
  • int offset-end: the offset-end of the buffer that triggered the message"

But when my pipeline runs, the message I see on the bus is Gst.MessageType.ELEMENT with the message.src set to a GstMultiFileSink.

Where can I get the application specific data? I need a callback after every capture file is written via multifilesink.

Thanks!

-aps

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Multifilesink messages and unclear doc

Thibault Saunier-4
Him

Those fields are inside the GstStructure that you can get from the message using: gst_message_get_structure[0]. Hotodoc[1] is somehow reporting wrong types for those fields in the python doc, something to fix there (please report a bug)

Regards,

Thibault Saunier


On Fri, Jun 14, 2019 at 4:00 PM pisymbol . <[hidden email]> wrote:
The doc states the following:

"If the post-messages property is TRUE, it sends an application message named GstMultiFileSink after writing each buffer.

The message's structure contains these fields:

  • int *filename: the filename where the buffer was written.
  • int index: index of the buffer.
  • int timestamp: the timestamp of the buffer.
  • int stream-time: the stream time of the buffer.
  • int running-time`: the running_time of the buffer.
  • int duration: the duration of the buffer.
  • int offset: the offset of the buffer that triggered the message.
  • int offset-end: the offset-end of the buffer that triggered the message"

But when my pipeline runs, the message I see on the bus is Gst.MessageType.ELEMENT with the message.src set to a GstMultiFileSink.

Where can I get the application specific data? I need a callback after every capture file is written via multifilesink.

Thanks!

-aps
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Multifilesink messages and unclear doc

pisymbol .
In reply to this post by pisymbol .


On Fri, Jun 14, 2019 at 4:00 PM pisymbol . <[hidden email]> wrote:
The doc states the following:

"If the post-messages property is TRUE, it sends an application message named GstMultiFileSink after writing each buffer.

The message's structure contains these fields:

  • int *filename: the filename where the buffer was written.
  • int index: index of the buffer.
  • int timestamp: the timestamp of the buffer.
  • int stream-time: the stream time of the buffer.
  • int running-time`: the running_time of the buffer.
  • int duration: the duration of the buffer.
  • int offset: the offset of the buffer that triggered the message.
  • int offset-end: the offset-end of the buffer that triggered the message"

But when my pipeline runs, the message I see on the bus is Gst.MessageType.ELEMENT with the message.src set to a GstMultiFileSink.

Where can I get the application specific data? I need a callback after every capture file is written via multifilesink.


So the doc is flat out wrong. But after digging into source this worked for you Googlers:

Register a message handler on your bus:

     bus = pipeline.get_bus()
     bus.add_watch(GLib.PRIORITY_DEFAULT, on_message)

Then in on_message do:

  def on_message(bus, message):
        if message.type == Gst.MessageType.ELEMENT:
            if message.src.name.startswith("multifilesink"):
                msg_struct = message.get_structure()
                print(msg_struct.get_string('filename')) # Prints out the current capture file

Need MOAR doc! :-)

-aps


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Multifilesink messages and unclear doc

pisymbol .
In reply to this post by Thibault Saunier-4


On Fri, Jun 14, 2019 at 4:06 PM Thibault Saunier <[hidden email]> wrote:
Him

Those fields are inside the GstStructure that you can get from the message using: gst_message_get_structure[0]. Hotodoc[1] is somehow reporting wrong types for those fields in the python doc, something to fix there (please report a bug)

Thanks Thibault! I figured it out looking at source (grumble, grumble, grumble...).

I will file a bug shortly.

-aps 

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Multifilesink messages and unclear doc

Mathieu Duponchelle
In reply to this post by pisymbol .
On 6/14/19 10:16 PM, pisymbol . wrote:
So the doc is flat out wrong. But after digging into source this worked for you Googlers:

Register a message handler on your bus:

     bus = pipeline.get_bus()
     bus.add_watch(GLib.PRIORITY_DEFAULT, on_message)

Then in on_message do:

  def on_message(bus, message):
        if message.type == Gst.MessageType.ELEMENT:
            if message.src.name.startswith("multifilesink"):
                msg_struct = message.get_structure()
                print(msg_struct.get_string('filename')) # Prints out the current capture file

Need MOAR doc! :-)

Note that ideally, we would standardize the documentation for custom messages
emitted by elements, but that needs doing :)

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Multifilesink messages and unclear doc

Thibault Saunier-4

On Fri, Jun 14, 2019 at 4:45 PM Mathieu Duponchelle <[hidden email]> wrote:
On 6/14/19 10:16 PM, pisymbol . wrote:
So the doc is flat out wrong. But after digging into source this worked for you Googlers:

Register a message handler on your bus:

     bus = pipeline.get_bus()
     bus.add_watch(GLib.PRIORITY_DEFAULT, on_message)

Then in on_message do:

  def on_message(bus, message):
        if message.type == Gst.MessageType.ELEMENT:
            if message.src.name.startswith("multifilesink"):
                msg_struct = message.get_structure()
                print(msg_struct.get_string('filename')) # Prints out the current capture file

Need MOAR doc! :-)

Note that ideally, we would standardize the documentation for custom messages
emitted by elements, but that needs doing :)
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel