cgiffard / NCoder

Little node wrapper for ffmpeg.
3 stars 0 forks source link

streaming interface #1

Open max-mapper opened 11 years ago

max-mapper commented 11 years ago

it would be super awesome to have an API like this:

var fs = require('fs')
var NCoder = require('ncoder')

var webmEncodeStream = new NCoder.createEncodeStream('webm', {
  "videoWidth": 640,
  "videoHeight": 360,
  "videoBitRate": "1024k",
  "audioBitRate": "128k"
})

fs.createReadStream('movie.mpg').pipe(webmEncodeStream).pipe(fs.createWriteStream('out.webm'))
cgiffard commented 11 years ago

Thanks for leaving an issue. :)

It's a fantastic idea, and something I'd love to see myself. But I expect it might require some fairly gnarly ffmpeg hackery - and I'm not exactly an expert. I'll see what I can do, but don't get your hopes up...

max-mapper commented 11 years ago

IIRC it is something like this:

ffmpeg -f webm -i - -o -