Parse user metadata
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 22/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript, typescript
- Domain
- data
Research direction
This is a usage question about walking MP4 udta/ilst boxes: the sample calls mp4boxFile.getBoxes("ilst") and then dumps the raw payload with TextDecoder, and asks whether ilst is the only box holding user metadata such as comments. Start in the box-parsing sources (the udta/meta/ilst box definitions and getBoxes) to see whether ilst children are exposed as parsed boxes or only as raw data, and test with a file that carries a comment atom. Done means a documented, correct way to read comment metadata, or a small parser improvement, rather than manual byte decoding.
Written by the indexing model from the issue text.
Description
I’m trying to get the users metadata of a video (comment notably). I tried to do something like that:
<!DOCTYPE html>
<html>
<head>
<title>MP4 Metadata Extraction</title>
</head>
<body>
<input type="file" id="fileInput" accept=".mp4">
<div id="metadataDisplay"></div>
<script src="mp4box.all.js"></script>
<script>
document.getElementById("fileInput").addEventListener("change", function (e) {
const file = e.target.files[0];
if (file) {
const reader = new FileReader();
reader.onload = function (e) {
const arrayBuffer = e.target.result;
// Initialize mp4box
const mp4boxFile = MP4Box.createFile();
mp4boxFile.onReady = (info) => {
console.log("READY");
console.log(info);
};
mp4boxFile.onError = () => {
console.log("Error");
};
// Create a Blob from the ArrayBuffer
/* const blob = new Blob([arrayBuffer]);
*/
console.log("created blob");
// Read the Blob using mp4box
arrayBuffer.fileStart = 0;
mp4boxFile.appendBuffer(arrayBuffer);
// Get metadata, ilst is inside udta, and seems to be the one with comments (maybe others could as well?)
/* const udtaBoxes = mp4boxFile.getBoxes("udta"); */
const ilstBoxes = mp4boxFile.getBoxes("ilst");
const decoder = new TextDecoder('utf-8');
ilstBoxes.forEach( (ilstBox) => {
console.log(decoder.decode(ilstBox.data));
});
};
reader.readAsArrayBuffer(file);
}
});
</script>
</body>
</html>
and I’m close enough to get the content, but I’m not sure how to parse it further, and I’m not sure if this is the only box that can contain user content. Is there a simpler way to get user metadata, like comments?
- Dominant language
- TypeScript
- Stars
- 2.5k
- Forks
- 390
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 8
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from gpac/mp4box.js
-
mp4box.js — 20-byte `sgpd` box with large `entry_count` causes unbounded loop and heap OOM abortOpen
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 32/100
gpac/mp4box.js#551 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
gpac/mp4box.js#528 · 2 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 40/100
Maintainers usually reply within 1 day
Similar issues
-
bug needs-triage potential-regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
aws/aws-sdk-js-v3#8408 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
colinhacks/zod#6743 ·
Maintainers usually reply within 1 day
-
[BUG] Packing list: the weight field drops digits on a slow connection and saves the wrong weightOpen
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
openai/openai-node#3124 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
anthropics/anthropic-sdk-typescript#1296 ·
Maintainers usually reply within 8 days