-
Notifications
You must be signed in to change notification settings - Fork 887
/
Copy pathfull.js
33 lines (32 loc) · 873 Bytes
/
full.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var ffmpeg = require('../index');
// make sure you set the correct path to your video file
var proc = ffmpeg('/path/to/your_movie.avi')
// set video bitrate
.videoBitrate(1024)
// set target codec
.videoCodec('divx')
// set aspect ratio
.aspect('16:9')
// set size in percent
.size('50%')
// set fps
.fps(24)
// set audio bitrate
.audioBitrate('128k')
// set audio codec
.audioCodec('libmp3lame')
// set number of audio channels
.audioChannels(2)
// set custom option
.addOption('-vtag', 'DIVX')
// set output format to force
.format('avi')
// setup event handlers
.on('end', function() {
console.log('file has been converted succesfully');
})
.on('error', function(err) {
console.log('an error happened: ' + err.message);
})
// save to file
.save('/path/to/your_target.avi');