Closed kay-master closed 5 years ago
It's hard to understand what's wrong in your code, without a version running somewhere or more info. Do you have a log of a run? Which browser are you using? What is the file size? what is the chunk size? how many tracks? how many samples do each track have? Why did you comment out the flush?
My bad, i forgot to mention those things.
I've tested on both Chrome, Version 74.0.3729.169 (Official Build) (64-bit) and FireFox, 66.0.3 (64-bit).
I commented out flush because I was trying to learn how mp4box works, but even if its there I don't get the onSegment
event. Chunk size is *1024 1024 = 1Mb** , has 3 tracks, wvtt
which is not supported by Media Source, mp4a.40.2
and avc1.42c00d
, with duration 26460160 and 15000000 respectively.
To do you better, am sharing the code am testing with here Test Code and the video I am testing with Test MP4 Video
Am not sure if this info is enough, and lastly I believe I did addSourceBuffer
for each track
I think I solved it, on the example MP4Box.js - JavaScript MP4 Reader/Fragmenter there is a use of sb.ms.pendingInits++
which on my case doesn't increment at all or decrement. Therefore mp4Box.start();
never gets called because this statement never becomes true
if (sb.ms.pendingInits === 0) {
mp4Box.start();
}
Maybe there's something I didn't see on the example. Thanks for responding because I was close on giving up.
Hello,
I'm trying to append an MP4 video that comes from
<input type="file">
input tag, and reading it as arrayBuffer, then appending the buffer chunk of the file tomp4Box.appendBuffer()
, I do get the onReady and onMoovStart events but for whatever reasons am not getting the onSegment event, here's a snippet of the code,The code above gets triggered once we start appending to the
mp4Box.appendBuffer(chunk)
method.Finally the code that reads on the file as array buffer and appending the above mentioned method.
I'm totally failing get this working, the code above is derived from the given a example at MP4Box.js - JavaScript MP4 Reader/Fragmenter, the difference here is that I want to append the local selected mp4 file to the Media Source Extension. I don't know were is the issue, but what I notice is, am not getting the
onSegment
event.Note: I would like to improve the documentation of this project but I don't understand it yet the one that is available now its hard to understand.