A quick way to create a tree structure ffmpeg
npm install --save ffmpeg.structure.iovar iofs = require('ffmpeg.structure.io') var formats = [{
input: 'test.mp4',
format: '640x360',
quality: '360p',
bandwith: ''
},{
input: 'test.mp4',
format: '848x480',
quality: '480p',
bandwith: ''
}];
iofs.createFileHlsForQuality(formats, function(data){
//data is true or false
console.log(data);
});