diogopms

Untitled

Sep 26th, 2014
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //command: wget -q -O- "http://URL" | ffprobe pipe:0
  2. var childProcess = require('child_process');
  3. var outpout = 'FILPATH';
  4.  
  5. var url = "http://file.avi";
  6.  
  7. var downloadWget = childProcess.spawn('wget', ["-q", '-O-', url], {cwd: outpout});
  8. var ffprobleChild = childProcess.spawn('ffprobe', ['pipe:0'/*,'-show_format', '2>&1', '|', "sed", '-n', "'s/duration=//p'"*/], {cwd: outpout});
  9.  
  10. downloadWget.stdout.pipe(ffprobleChild.stdin);
  11.  
  12. ffprobleChild.stderr.on('data', function(data) {
  13.     console.log(data.toString());
  14. });
  15.  
  16.  
  17. //error:
Advertisement
Add Comment
Please, Sign In to add comment