Description
mp4box.onSamples() will always receive a list of nbSamples samples, regardless of which ones are RAPs. The script below will reproduce the problem.
window.onload = function() {
var mp4box = new MP4Box();
mp4box.onError = function(e) {};
mp4box.onReady = function(info) {
videoTrackID = info.videoTracks[0].id;
mp4box.setExtractionOptions(videoTrackID, null, {nbSamples:10, rapAlignement:true});
};
mp4box.onSamples = function(id, user, samples) {
console.log("Received "+samples.length+" samples on track "+id+" for object "+user);
console.log(samples);
}
var downloader = new Downloader();
downloader.setUrl("https://dl.dropboxusercontent.com/u/7245016/bug_buck_bunny_trailer.mp4")
downloader.setCallback(function(response, eof) {
mp4box.appendBuffer(response);
mp4box.flush();
});
downloader.getFile();
}