This commit is contained in:
Valentin Boettcher 2016-09-09 01:49:15 +00:00
parent 32f79e7eb0
commit 4702c1cbd4
2 changed files with 7 additions and 5 deletions

10
main.js
View file

@ -37,8 +37,8 @@ let logger = new(winston.Logger)({
new(winston.transports.Console)({
level: 'success'
}),
new(winston.winston.transports.File)({
file: __dirname + '/process.log',
new(winston.transports.File)({
filename: __dirname + '/process.log',
colorize: true,
timestamp: true,
json: true,
@ -67,10 +67,12 @@ let spawn = function() {
stdoutLines: 20
})
.videoCodec('copy');
if (config.customOutputOptions !== "")
cmd.outputOptions(config.customOutputOptions.split(','));
if (config.customAudioOptions !== "")
cmd.outputOptions(config.customAudioOptions.split(','));
else
cmd.AudioCodec('copy');
cmd.on('start', function(commandLine) {
status.running = 0;
logger.log(importance[4], 'Spawned Ffmpeg with command: ' + commandLine);

View file

@ -4,7 +4,7 @@ const fs = require('fs');
let pid;
let config = JSON.parse(fs.readFileSync('./config.js'));
let p = spawn(`ssh -p ${config['ssh-port']} -f -N -R ${process.argv[2]}:localhost:22 -f -N -R 0.0.0.0:${process.argv[3]}:${config.camIP}:${process.argv[4]} ${config['ssh-user']}@${config.master.replace(/((http|https)\:\/{2}|\:[0-9]+)/g, '')} && pidof ssh`, {
let p = spawn(`ssh -oStrictHostKeyChecking=no -p ${config['ssh-port']} -f -N -R ${process.argv[2]}:localhost:22 -f -N -R 0.0.0.0:${process.argv[3]}:${config.camIP}:${process.argv[4]} ${config['ssh-user']}@${config.master.replace(/((http|https)\:\/{2}|\:[0-9]+)/g, '')} && pidof ssh`, {
shell: true,
detached: false
})