Encode video using Nodejs + ffmpeg or handbrake

I was looking for a way to encode multiple videos at the same time with NodeJS, but have not yet found a good solution for it.

Using FFMPEG I never get a 100% rejection response. There is always a 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"
+4
source share
1 answer

Did you consider handbrake-js ?

encoding example:

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
    );
  });
+4
source

Source: https://habr.com/ru/post/1533226/


All Articles