最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Converting video to .mp4 with Node.js - Stack Overflow

programmeradmin1浏览0评论

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
Add a ment  | 

2 Answers 2

Reset to default 5

Well, 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.

发布评论

评论列表(0)

  1. 暂无评论