parsing block duration

34 views
Skip to first unread message

Jonathan Yaniv

unread,
Jun 7, 2022, 9:10:31 AM6/7/22
to WebM Discussion
I'm working on a ruby webm parser and would like to include the duration of each block in the output.

Don't see anything about block duration in the webm or matroska specs.

Any suggestions on how to capture this data?

FYI the parser is meant for inspecting data from the MediaRecorder API, concatenating the data, extracting EBML headers and top level elements, etc.

Thanks,
Jonathan

James Zern

unread,
Jun 7, 2022, 1:47:21 PM6/7/22
to WebM Discussion
Hi Jonathan,

On Tue, Jun 7, 2022 at 6:10 AM Jonathan Yaniv <yoni...@gmail.com> wrote:
I'm working on a ruby webm parser and would like to include the duration of each block in the output.

Don't see anything about block duration in the webm or matroska specs.

BlockDuration is an optional element [1] in most cases and not usually used except for the last block. The duration is generally derived from the difference between current and next block in display order.



Any suggestions on how to capture this data?

FYI the parser is meant for inspecting data from the MediaRecorder API, concatenating the data, extracting EBML headers and top level elements, etc.

Thanks,
Jonathan

--
You received this message because you are subscribed to the Google Groups "WebM Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webm-discuss...@webmproject.org.
To view this discussion on the web visit https://groups.google.com/a/webmproject.org/d/msgid/webm-discuss/41d9afa2-cd90-4124-80ee-ba7919074809n%40webmproject.org.

Jonathan Yaniv

unread,
Jun 7, 2022, 1:51:51 PM6/7/22
to WebM Discussion, James Zern

Thanks James, in particular I was interested in the duration of the last block.

James Zern

unread,
Jun 7, 2022, 7:26:52 PM6/7/22
to WebM Discussion
On Tue, Jun 7, 2022 at 10:51 AM Jonathan Yaniv <yoni...@gmail.com> wrote:

Thanks James, in particular I was interested in the duration of the last block.

If the duration is written you can use that, otherwise you can try keeping a running average of the block durations or use the previous one as an approximation.
Reply all
Reply to author
Forward
0 new messages