Advertisement
FlyFar

save-video-stream.js

Mar 14th, 2023
637
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.56 KB | Cybersecurity | 0 0
  1. // Run this to save a h264 video file, with the PaVE frame filtered out.
  2. // You can then use this file as a ffmpeg source for additional processing
  3. // or streaming to a ffserver
  4.  
  5. var arDrone = require('..');
  6. var PaVEParser = require('../lib/video/PaVEParser');
  7. var output = require('fs').createWriteStream('./vid.h264');
  8.  
  9. var video = arDrone.createClient().getVideoStream();
  10. var parser = new PaVEParser();
  11.  
  12. parser
  13.   .on('data', function(data) {
  14.     output.write(data.payload);
  15.   })
  16.   .on('end', function() {
  17.     output.end();
  18.   });
  19.  
  20. video.pipe(parser);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement