Created
March 3, 2013 21:58
-
-
Save ralphtheninja/5078496 to your computer and use it in GitHub Desktop.
node v0.9.11 stream problems. My video file is 350Mb large. Mplayer starts up but stops after a while (like 10 seconds). It seems that child.stdin is not emitting 'ondrain', but I'm not 100% sure. If I copy the data with createReadStream/createWriteStream it works. Works fine on v0.8.19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// This works just fine. | |
var fs = require('fs') | |
, from = fs.createReadStream('./video') | |
, to = fs.createWriteStream('./video-copy') | |
from.pipe(to) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// This works for a while. | |
var spawn = require('child_process').spawn | |
, child = spawn('mplayer', ['-']) | |
, movie = require('fs').createReadStream('./video') | |
movie.pipe(child.stdin) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment