Created
March 4, 2013 17:17
-
-
Save ralphtheninja/5083838 to your computer and use it in GitHub Desktop.
This works. Apparently there has to be a final consumer of the last stdout, for example /dev/null in this case, or some other file descriptor.
This file contains hidden or 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 | |
| var spawn = require('child_process').spawn | |
| , child = spawn('mplayer', ['-']) | |
| , fs = require('fs') | |
| , movie = fs.createReadStream('./video') | |
| movie.pipe(child.stdin) | |
| child.stdout.pipe(fs.createWriteStream('/dev/null')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment