Advertisement
Guest User

Untitled

a guest
Dec 17th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1.  
  2. function sendVideo(callback) {
  3. let time = 5; // sec
  4. let fps = 10;
  5. let filename = '/tmp/camera1.mp4';
  6. let codec = 'libx264'; //
  7. let ffmpegCommand = '-y -i '+ CAM3_URL + ' -t '+time+
  8. ' -f mp4 -vcodec '+codec+
  9. ' -pix_fmt yuv420p -s 1280:720 -b:v 1500k -vsync vfr -an -r '+fps+' '+filename;
  10. let ffmpeg = spawn('ffmpeg', (ffmpegCommand).split(' '), {});
  11. // ffmpeg.stderr.on('data', function(data){
  12. // log('err', data.toString());
  13. // });
  14. ffmpeg.on('close', function(code) {
  15. callback(filename);
  16. });
  17. }
  18.  
  19. sendVideo(function(filename){
  20. sendTo('telegram.0', {text: filename, caption: 'Камера'});
  21. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement