Skip to content

Commit

Permalink
scraping current output format because of several incompatible box st…
Browse files Browse the repository at this point in the history
…ructures
  • Loading branch information
necccc committed Nov 24, 2014
1 parent 53fc738 commit e9b6ebc
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
10 changes: 9 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,17 @@ UnboxingWriteStream.prototype._write = function(data, enc, done) {

if (this.currentBoxFragment) {
this.currentBoxFragment.currentLength += data.length;



console.log(this.currentBoxFragment.currentLength, this.currentBoxFragment.length );


// itt csak annyit konkatenaljunk amennyi visszavan es kell
this.currentBoxFragment.data = Buffer.concat([this.currentBoxFragment.data, data]);

if(this.currentBoxFragment.currentLength === this.currentBoxFragment.length) {
// ha ez megvan, akkor a maradek mehet tovabb a boxparsernek
if (this.currentBoxFragment.currentLength === this.currentBoxFragment.length) {
this.boxes.push(this.currentBoxFragment);
this.currentBoxFragment = null;
}
Expand Down
15 changes: 14 additions & 1 deletion lib/unflat.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = function unflat (data) {
}
});

return tree;
return data;
}


Expand All @@ -21,6 +21,19 @@ function addToTree (tree, type, data) {
}


// ez igy nem lesz jo, mert lehet tobb moof is pl,
// szoval egy array szeru struktura lesz, sorrendben
/*
[
{type: moof, content: [
{type: traf, content: ... }
]}
{type: mdat, blabla }
{type: moof, blabla }
{type: mdat, blabla }
]
*/



function subTree (tree, parents, box) {
Expand Down
5 changes: 3 additions & 2 deletions tests/tests.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


var chunkFile = './media/audio.m4s'
var chunkFile = './media/video.m4s'

var fs = require('fs');
var isoBmff = require('../index.js');
Expand All @@ -14,7 +14,8 @@ var chunkStream = fs.createReadStream(chunkFile, {
});

var unboxing = new isoBmff(function (err, data) {
console.log(data.root.moof.traf );
console.log(data);
//console.log(data.root.moof.traf );
})


Expand Down

0 comments on commit e9b6ebc

Please sign in to comment.