Advertisement
Guest User

Untitled

a guest
Aug 5th, 2014
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. var http = require("http");
  2. var url = require('url');
  3. var cp = require("child_process");
  4. var fs = require('fs');
  5.  
  6. var vide_size = "vga";
  7. var ffmpeg = cp.spawn("ffmpeg", [
  8. "-f", "video4linux2",
  9. "-s", "176x144",
  10. "-r", "15",
  11. "-input_format","yuyv422",
  12. "-i", "/dev/video0",
  13. "-vsync", "drop",
  14. "-vcodec", "copy",
  15. "-f", "mpegts",
  16. "-movflags", "faststart+frag_keyframe",
  17. "-frag_duration", "50000","pipe:1"
  18. ], {detached: false});
  19. ffmpeg.stderr.pipe(process.stderr);
  20. ffmpeg.stdout.on('data', function(chunk) {
  21. fs.appendFile("/tmp/test", chunk, function(err) {
  22. if(err) {
  23. console.log(err);
  24. } else {
  25. console.log("The file was saved!");
  26. }
  27. });
  28. console.log(chunk.length);
  29. console.log(chunk);
  30. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement