Skip to content
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

Parse unknown metadata and write metadata #91

Merged
merged 4 commits into from
Jan 31, 2023

Conversation

jessa0
Copy link
Contributor

@jessa0 jessa0 commented Jan 16, 2023

The meta box is very open-ended, leaving itself open to extension by future specs. This PR:

  1. parses the Hdlrbox as required by the spec for the meta box
  2. only parses iTunes metadata when the handler type is mdir (as seen in `big_buck_bunny_metadata.m4v)
  3. makes MetaBox into an enum, to allow for other handlers in the future (like requested in question: MOV Quicktime and MP4 metadata #66)
  4. allows parsing MetaBox in more positions as per the spec
  5. writes metadata out if present

@alfg
Copy link
Owner

alfg commented Jan 19, 2023

Thanks again @jessa0. I will take a look at this soon.

#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
#[serde(tag = "hdlr")]
#[serde(rename_all = "lowercase")]
pub enum MetaBox {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also implement the Mp4Box trait for meta (and child boxes)? So I can access mp4.moov.meta for example.

Copy link
Contributor Author

@jessa0 jessa0 Jan 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea. i already had written another commit 669edcf to be able to write meta and udta boxes which adds these implementations, but was waiting for this PR to merge before opening another. I'll just push it to this branch.

@jessa0
Copy link
Contributor Author

jessa0 commented Jan 22, 2023

@alfg PTAL at 669edcf which happens to address your comment?

@jessa0 jessa0 requested a review from alfg January 22, 2023 21:03
@jessa0 jessa0 changed the title Parse unknown metadata Parse unknown metadata and write metadata Jan 22, 2023
@alfg
Copy link
Owner

alfg commented Jan 28, 2023

Thanks again @jessa0. Sorry for the delay. I will review and try this out soon.

@alfg alfg merged commit 2a374c5 into alfg:master Jan 31, 2023
@alfg
Copy link
Owner

alfg commented Jan 31, 2023

Looks good. Thank you @jessa0!

jprochazk pushed a commit to jprochazk/mp4 that referenced this pull request Sep 18, 2024
* validate meta box handler type, parse meta with unknown handlers

* parse meta in moov and trak position

* write meta and udta

* fix clippy nit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants