Comparing version 2.1.0 to 2.2.0
{ | ||
"name": "demrec", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Demo Recorder Renderer", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -17,3 +17,3 @@ let fs = require('fs') | ||
function DemRec (config) { | ||
this.cfg = util.readINI(config) | ||
this.cfg = util.readINI(config, ['FFMPEG']) | ||
@@ -134,9 +134,23 @@ if (!this.cfg) throw new Error(`Config file "${config}" not found!`) | ||
let file = ph.join(dir, files[i]) | ||
let mp4 = ph.join(out, files[i] + '.mp4') | ||
let tmp = ph.join(dir, 'tmp-' + files[i]) | ||
let mp4 = ph.join(out, files[i]) | ||
await ffmpeg(`-i "${file + '.mp4'}" -i "${file + '.wav'}" -c:v copy -c:a aac "${mp4}"`, progress => { | ||
this.emit('log', { file: files[i], type: 'Merging', progress }) | ||
await ffmpeg(`-i "${file + '.mp4'}" -i "${file + '.wav'}" -c:v copy -c:a aac "${this.cfg.FFMPEG ? tmp : mp4}.mp4"`, progress => { | ||
this.emit('log', { file: files[i], type: 'Merging', progress, index: this.cfg.FFMPEG ? 1 : null }) | ||
}) | ||
res.push(mp4) | ||
if (this.cfg.FFMPEG) { | ||
let parts = this.cfg.FFMPEG | ||
for (let i = 0; i < parts.length; i++) { | ||
let cmd = parts[i].join(' ') | ||
.replaceAll('%IN%', tmp) | ||
.replaceAll('%DIR%', dir) | ||
.replaceAll('%OUT%', mp4) | ||
await ffmpeg(cmd, progress => { | ||
this.emit('log', { file: files[i], type: 'Merging', progress, index: i + 2 }) | ||
}) | ||
} | ||
} | ||
res.push(mp4 + '.mp4') | ||
} | ||
@@ -143,0 +157,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21087
401