I want to be able to do something like this:
var converter = require('converter');
converter.convert({
from: 'avi',
to: 'mp4',
path: '/myvideo.avi',
newPath: '/newvideo.mp4',
error: function(err) {},
success: function() {
console.log('success!');
}
});
Thanks!
I want to be able to do something like this:
var converter = require('converter');
converter.convert({
from: 'avi',
to: 'mp4',
path: '/myvideo.avi',
newPath: '/newvideo.mp4',
error: function(err) {},
success: function() {
console.log('success!');
}
});
Thanks!
Share Improve this question asked Jun 27, 2014 at 16:42 GofilordGofilord 6,6414 gold badges28 silver badges44 bronze badges 1- There are a handful of resources already available on NPM: npmjs/package/stream-transcoder npmjs/package/codem-transcode npmjs/package/transcoding – zamnuts Commented Jun 27, 2014 at 16:52
2 Answers
Reset to default 5Well, for one converter converts between xml
, json
, and yaml
. So, you won't be able to convert an avi to an mp4 with that.
However, I have used node to spawn a child ffmpeg process for this very thing. Just an fyi, if you do choose to use ffmpeg via a child process and want to watch the log for progress and debugging, you will need to watch stderr
. Ffmpeg reserves stdout
to optionally stream the output of the conversion.
FFMPEG is good thing for play with video.
Try this mand.
exec("ffmpeg -i filePath/fileName.ext filePath/newFileName.mp4");
You can set your other preset also.