This commit is contained in:
Hiro Protagonist 2016-09-09 13:13:55 +12:00
parent a5d203cfd2
commit 2be6762198
2 changed files with 24 additions and 24 deletions

19
main.js
View file

@ -31,21 +31,19 @@ var customLevels = {
};
let winston = require('winston');
require('winston-logrotate');
let logger = new(winston.Logger)({
levels: customLevels.levels,
transports: [
new(winston.transports.Console)({
level: 'success'
}),
new(winston.transports.Rotate)({
new(winston.winston.transports.File)({
file: __dirname + '/process.log',
colorize: false,
colorize: true,
timestamp: true,
json: true,
max: '10m',
keep: 5,
compress: true
maxsize: 1000000,
maxFiles: 1
})
]
});
@ -68,9 +66,12 @@ let spawn = function() {
source: source,
stdoutLines: 20
})
.videoCodec('copy')
.outputOptions(config.customOutputOptions.split(','))
.on('start', function(commandLine) {
.videoCodec('copy');
if(config.customOutputOptions !== "")
cmd.outputOptions(config.customOutputOptions.split(','));
cmd.on('start', function(commandLine) {
status.running = 0;
logger.log(importance[4], 'Spawned Ffmpeg with command: ' + commandLine);
})

View file

@ -1,17 +1,16 @@
{
"name": "doccpi",
"version": "0.0.2",
"description": "Pi software for the DoC cams.",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Valentin Boettcher",
"license": "GPL-3.0",
"dependencies": {
"fluent-ffmpeg": "^2.1.0",
"socket.io-client": "^1.4.8",
"winston": "^2.2.0",
"winston-logrotate": "^1.0.0"
}
"name": "doccpi",
"version": "0.0.2",
"description": "Pi software for the DoC cams.",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Valentin Boettcher",
"license": "GPL-3.0",
"dependencies": {
"fluent-ffmpeg": "^2.1.0",
"socket.io-client": "^1.4.8",
"winston": "^2.2.0"
}
}