-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support emsg box parsing #426
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great 👍 Parsing by bytes looks painful.. I'm sure that took some effort to figure out! +1 after some minor styling changes and possibly another test or two.
@wseymour15 good catch on the indentation inconsistencies, I was leaning on auto-detect in the IDE without realizing my default was 4 per tab 😅 . I added a couple more edge case tests for the c string util as well. Thanks for taking a look at this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have some existing code (now duplicate) for this in https://github.com/videojs/mux.js/tree/main/lib/aac/utils.js and https://github.com/videojs/mux.js/tree/main/lib/aac/index.js
@brandonocasey Yeah, I noticed there was already some duplication between the aac timed metadata parsing and mux.js/lib/m2ts/metadata-stream.js Line 206 in 2e50704
I lifted as much common functionality from metadata-stream as I could, however since both aac and m2ts are accommodating partial segments, it seemed safer to leave the push implementations alone and implement extraction from full-segment fmp4 separately. There is likely room for further consolidation between all 3 implementations, however I think it makes sense to do that in a separate PR.
|
@wseymour15 @dzianis-dashkevich I added some emsg validation and corresponding tests to account for malformed data and addressed the other comments. Thanks for taking a look at the revised PR! |
Feature
Added basic fmp4 emsg box parsing for v0 and v1 boxes. Exposed a new
mp4/probe
function for extracting timed message data from emsg boxesgetEmsgID3
.This will allow us to extract emsg timed metadata from fmp4/cmaf content, specifically ID3 frame data which is supported by various ad service integrations.
References:
https://aomediacodec.github.io/id3-emsg/
https://dashif-documents.azurewebsites.net/Events/master/event.html#event-metadata-timing
https://github.com/id3/ID3v2.4/blob/master/id3v2.40-structure.txt
Testing
Tested using mock data derived from the emsg spec, as well as manually tested real fmp4 segment data in the debug page.