node.js - Encode videos using Nodejs + ffmpeg or handbrake -
i have been looking way encode multiple videos simultaneously nodejs haven't find solution yet.
using ffmpeg never 100% fail free response. there broken video.
os: ubuntu 12.04
size = "#{options.maxwidth}x#{options.maxheight}" proc = new ffmpeg({ source: options.input }).withvideocodec(options.encoder).withsize(size).keeppixelaspect(true).withstrictexperimental() proc.onprogress (progress) -> console.log "progress: " + progress.percent proc.savetofile options.output, (stdout, stderr) -> console.log "file has been converted succesfully"
have considered handbrake-js?
an example encode:
var hbjs = require("handbrake-js"); hbjs.spawn({ input: "some video.avi", output: "some vide.m4v" }) .on("progress", function(progress){ console.log( "percent complete: %s, eta: %s", progress.percentcomplete, progress.eta ); });
Comments
Post a Comment