Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var fs = require('fs');
- var spawn = require('child_process').spawn;
- var ffmpeg = spawn("ffmpeg", [
- '-i', './videos/long-video.mp4',
- '-codec:v', 'copy',
- '-codec:a', 'copy',
- '-f','mp4',
- '-map', '0', '-f', 'segment', '-segment_time', '1200', './videos/pieces/video_%04d.mp4'
- ]);
- var fs = require('fs');
- var spawn = require('child_process').spawn;
- var ffmpeg = spawn("ffmpeg", [
- '-i', './videos/long-video.mp4',
- '-codec:v', 'copy',
- '-codec:a', 'copy',
- '-f','mp4',
- '-map', '0', '-f', 'segment', '-segment_time', '1200',
- 'pipe:1'
- ]);
- ffmpeg.stdout.on('data', function (data) {
- // store the video name in database
- console.log('new peice has been made' );
- });
- ffmpeg.stderr.on('data', function (data) {
- console.log('error' );
- });
Add Comment
Please, Sign In to add comment