Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sendVideo(callback) {
- let time = 5; // sec
- let fps = 10;
- let filename = '/tmp/camera1.mp4';
- let codec = 'libx264'; //
- let ffmpegCommand = '-y -i '+ CAM3_URL + ' -t '+time+
- ' -f mp4 -vcodec '+codec+
- ' -pix_fmt yuv420p -s 1280:720 -b:v 1500k -vsync vfr -an -r '+fps+' '+filename;
- let ffmpeg = spawn('ffmpeg', (ffmpegCommand).split(' '), {});
- // ffmpeg.stderr.on('data', function(data){
- // log('err', data.toString());
- // });
- ffmpeg.on('close', function(code) {
- callback(filename);
- });
- }
- sendVideo(function(filename){
- sendTo('telegram.0', {text: filename, caption: 'Камера'});
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement