Skip to content

Sonarvio/sonarvio-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

js-standard-style

Sonarvio Converter

A wrapper for an emscripted version of ffmpeg to extract the audio tracks from media containers. It includes custom builds for 'wav'.

npm install --save sonarvio-converter

Features

  • minimal API surface for '.exec', '.info' and '.transform'
  • automatic queue system for scheduling re-used workers
  • transparent migration for usage with proxy for CORS handling

Usage

For a better integration with existing projects using webpack the actual script files for the workers are excluded. They have to be provided as an argument through the constructor.

// local
var Converter = require('sonarvio-converter')
var converter = new Converter({
	types: {
		webm: '<FILE_TO_WORKER_SCRIPT>' // e.g. require(file!ffmpeg.js/ffmpeg-worker-webm)
	}
})

converter.exec('webm', '-version').then(function(){
	console.log('shown infos');
})

converter.transform({
	name: 'example.webm',
	data: ....
}, {
	name: 'result.opus'
}).then(function (track) {
	console.log(track);
})

// remote
var Converter = require('sonarvio-converter')
var converter = new Converter({
	proxy: 'http://sonarvio.com/__/proxy.html'
})

converter.info('webm').then(function (info) {
	console.log(info);
})

About

wrapper for an emscripted version of ffmpeg

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published