mafintosh / mafintosh/mp4-stream
Stop listing after `stream` atoms
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 215
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
1MiB MP4 Sample: http://www.sample-videos.com/video/mp4/240/big_buck_bunny_240p_1mb.mp4
MP4 structure:
> ftyp (32 bytes)
> free (8 bytes)
> mdat (1046699 bytes)
> moov (6904 bytes)
Code snippet:
``` javascript
var mp4 = require('mp4-stream')
var fs = require('fs')
var decode = mp4.decode()
fs.createReadStream('video.mp4')
.pipe(decode)
.on('box', function (box, next) {
console.log('found box (' + box.type + ') at ' + box.offset + ' (' + box.length + ')')
if (box.container) {
console.log('box has child boxes (will be emitted next)')
}
if (box.stream) {
console.log('box has stream data (consume stream to continue)')
box.stream.resume()
}
next() // call this when you're done
})
```
Result:
> found box (ftyp) at 0 (32)
> found box (free) at 32 (8)
> box has stream data (consume stream to continue)
Stop listing after `free` atom.
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Reproduce the issue with the supplied 1MiB MP4 sample and the shown mp4.decode() pipeline. Start at the decode entry point and trace the `box` callback after `box.stream.resume()` and `next()`. Done means the decoder continues listing boxes after the `mdat` stream, including the `moov` atom described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- audio-video-rtc
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100