GNOME Bugzilla – Bug 751292
bpmdetect: Provide timestamps together with BPM information
Last modified: 2018-11-03 13:36:24 UTC
It's always equal to 18446744073709551615 when I try to fetch tags like that (sorry for C++11): gst_pad_set_event_function_full(pad, [](GstPad *pad, GstObject *parent, GstEvent *event) -> gboolean { switch (GST_EVENT_TYPE(event)) { case GST_EVENT_TAG: { gdouble bpm = 0; GstTagList *tag_list = nullptr; gst_event_parse_tag(event, &tag_list); gst_tag_list_get_double(tag_list, GST_TAG_BEATS_PER_MINUTE, &bpm); g_print("BPM change detected: %lf BPM\n", bpm); /// What GST_EVENT_TIMESTAMP(event) should show here? } break; default: break; } return true; }, nullptr, nullptr);
Can we just take PTS of input buffer and put that into the event?
Created attachment 305790 [details] [review] Adds timestamp to BPM detection event Timestamp taken from input buffer
Comment on attachment 305790 [details] [review] Adds timestamp to BPM detection event We don't put timestamps like this in events really. I think a better way of handling this is like with the messages posted by e.g. the level and spectrum elements. They contain all the relevant timestamp information you might need.
But bpmdetect doesn't post anything to Bus. It does send events. What timestamp field in event means (or should mean) then?
It probably should post messages :) The timestamp field in events (and messages, etc) are completely unused. They should probably go away at some point.
Also for GstSceneChange: as I understood, we can not use events to report timestamps of BPM or Scene changes, we should teach GstBpmDetect and GstSceneChange to post to bus, is that correct?
Kyrylo, do you plan on updating the patch?
But it seems we can not put timestamps in events, correct?
Sure, events are just a GstStructure. You can put any value you want in there :) Just like e.g. the spectrum element does with the GstMessages it is sending.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/261.