Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* filtergraphs.
*/
// ["0:v", m.scale({w: 1920, h: 1080})]
//
//
import _ from "underscore";
import fluent from "fluent-ffmpeg";
import filterList from "../filterlist";
// Look ma! It's the Symbol API!
const isFilterNode = Symbol("isFilterNode");
fluent.prototype.magic = function(...args) {
if (!this._magicFilters) {
this._filterIdx = 0;
this.filterLabels = {};
this._magicFilters = [];
this._origRun = this.run;
this.run = function(...args) {
this.outputOptions([
"-filter_complex",
this._magicFilters.join(";"),
]);
return this._origRun.call(this, ...args);
};
}
const inputs = [];
let doneWithInputs = false;
return new Promise((resolve, reject) => {
ffmpeg.prototype._spawnFfmpeg(
["-hwaccels"],
{ captureStdout: true, stdoutLines: 0 },
(err, stdoutRing) => {
if (err) {
reject(err);
}
let stdout = stdoutRing.get();
let lines = [
...new Set(
stdout
.replace("Hardware acceleration methods:", "")
.replace(/\n/g, " ")
.trim()
.split(" ")
)
];