Add .gitignore to exclude all node packages and lock files
This commit is contained in:
Generated
Vendored
+54
@@ -0,0 +1,54 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.muxVideoAndAudio = void 0;
|
||||
const call_ffmpeg_1 = require("./call-ffmpeg");
|
||||
const logger_1 = require("./logger");
|
||||
const make_metadata_args_1 = require("./make-metadata-args");
|
||||
const parse_ffmpeg_progress_1 = require("./parse-ffmpeg-progress");
|
||||
const truthy_1 = require("./truthy");
|
||||
const muxVideoAndAudio = async ({ videoOutput, audioOutput, output, indent, logLevel, onProgress, binariesDirectory, fps, cancelSignal, addFaststart, metadata, }) => {
|
||||
var _a;
|
||||
const startTime = Date.now();
|
||||
logger_1.Log.verbose({ indent, logLevel }, 'Muxing video and audio together');
|
||||
const command = [
|
||||
'-hide_banner',
|
||||
videoOutput ? '-i' : null,
|
||||
videoOutput,
|
||||
audioOutput ? '-i' : null,
|
||||
audioOutput,
|
||||
videoOutput ? '-c:v' : null,
|
||||
videoOutput ? 'copy' : null,
|
||||
audioOutput ? '-c:a' : null,
|
||||
audioOutput ? 'copy' : null,
|
||||
addFaststart ? '-movflags' : null,
|
||||
addFaststart ? 'faststart' : null,
|
||||
...(0, make_metadata_args_1.makeMetadataArgs)(metadata !== null && metadata !== void 0 ? metadata : {}),
|
||||
'-y',
|
||||
output,
|
||||
].filter(truthy_1.truthy);
|
||||
logger_1.Log.verbose({ indent, logLevel }, 'Combining command: ', command);
|
||||
const task = (0, call_ffmpeg_1.callFf)({
|
||||
bin: 'ffmpeg',
|
||||
args: command,
|
||||
indent,
|
||||
logLevel,
|
||||
binariesDirectory,
|
||||
cancelSignal,
|
||||
});
|
||||
(_a = task.stderr) === null || _a === void 0 ? void 0 : _a.on('data', (data) => {
|
||||
const utf8 = data.toString('utf8');
|
||||
const parsed = (0, parse_ffmpeg_progress_1.parseFfmpegProgress)(utf8, fps);
|
||||
if (parsed === undefined) {
|
||||
if (!utf8.includes('Estimating duration from bitrate, this may be inaccurate')) {
|
||||
logger_1.Log.verbose({ indent, logLevel }, utf8);
|
||||
}
|
||||
}
|
||||
else {
|
||||
logger_1.Log.verbose({ indent, logLevel }, `Combined ${parsed} frames`);
|
||||
onProgress(parsed);
|
||||
}
|
||||
});
|
||||
await task;
|
||||
logger_1.Log.verbose({ indent, logLevel }, `Muxing done in ${Date.now() - startTime}ms`);
|
||||
};
|
||||
exports.muxVideoAndAudio = muxVideoAndAudio;
|
||||
Reference in New Issue
Block a user