Streaming piped output from ffmpeg?

948 views
Skip to first unread message

Steve H

unread,
Aug 8, 2010, 11:25:00 PM8/8/10
to nodejs
Hello all,

I'm thinking of writing a small node.js server that streams audio from
FFmpeg over HTTP, for use in an HTML5 player.

Basically, it should execute a command like this

ffmpeg -i /path/to/a/file -f mp3 - 2>/dev/null

and return stdout to the browser.

Is this a suitable use for Node? Can someone help me get a proof of
concept working?

Here's what I have so far: http://gist.github.com/514882

mscdex

unread,
Aug 9, 2010, 2:36:58 AM8/9/10
to nodejs
Don't forget to end the response using res.end() inside
ffmpeg.on('exit').

Also, it should be noted that .write() can return false which means
the kernel send buffer is full and that it queued the data in user
memory. Ideally it would be great to sys.pump the stdout to the
response (once event buffering is an option or some other method to
ensure that no 'data' events would be lost while stdout is "paused").

Jozef

unread,
Aug 25, 2010, 4:55:37 PM8/25/10
to nodejs
Hello Steve,

Did you made any progress with ffmpeg streaming within nodejs?
Im planning / investigating to do something similar, but with video.
Reply all
Reply to author
Forward
0 new messages