From 5ce0aed2ff3bd879a859e5b2c751ab339e52d980 Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Fri, 23 Aug 2019 15:39:38 -0400 Subject: [PATCH] Use module "ffmpeg-static" to use a binary of ffmpeg stored in node_modules, rather than rely on the system version. --- app/lib/ffmpeg/index.js | 6 +++--- app/lib/ffmpeg/index.js.map | 2 +- app/lib/system/index.js | 14 ++------------ app/lib/system/index.js.map | 2 +- app/package-lock.json | 5 +++++ app/package.json | 1 + cli/lib/ffmpeg/index.js | 6 +++--- cli/lib/ffmpeg/index.js.map | 2 +- cli/lib/system/index.js | 14 ++------------ cli/lib/system/index.js.map | 2 +- lib/ffmpeg/index.js | 6 +++--- lib/ffmpeg/index.js.map | 2 +- lib/system/index.js | 14 ++------------ lib/system/index.js.map | 2 +- src/ffmpeg/index.ts | 10 +++++----- src/system/index.ts | 13 ++----------- 16 files changed, 34 insertions(+), 67 deletions(-) diff --git a/app/lib/ffmpeg/index.js b/app/lib/ffmpeg/index.js index bed840f..5053899 100644 --- a/app/lib/ffmpeg/index.js +++ b/app/lib/ffmpeg/index.js @@ -13,8 +13,8 @@ class FFMPEG { **/ constructor(sys) { this.id = 'ffmpeg'; - this.system = sys; - this.TMPDIR = path_1.join(this.system.tmp, 'mcopy_digital'); + this.bin = sys.deps.ffmpeg; + this.TMPDIR = path_1.join(sys.tmp, 'mcopy_digital'); this.init(); } /** @@ -74,7 +74,7 @@ class FFMPEG { return parseInt(e); }); // - cmd = `ffmpeg -y -i "${video}" -vf "select='gte(n\\,${frameNum})'${scale}" -vframes 1 -compression_algo raw -pix_fmt rgb24 "${tmpoutput}"`; + cmd = `${this.bin} -y -i "${video}" -vf "select='gte(n\\,${frameNum})'${scale}" -vframes 1 -compression_algo raw -pix_fmt rgb24 "${tmpoutput}"`; cmd2 = `convert "${tmpoutput}" -resize ${w}x${h} -size ${w}x${h} xc:"rgb(${rgb[0]},${rgb[1]},${rgb[2]})" +swap -compose Darken -composite "${tmpoutput}"`; //ffmpeg -i "${video}" -ss 00:00:07.000 -vframes 1 "export-${time}.jpg" //ffmpeg -i "${video}" -compression_algo raw -pix_fmt rgb24 "export-%05d.tiff" diff --git a/app/lib/ffmpeg/index.js.map b/app/lib/ffmpeg/index.js.map index 09a6cdb..04f322b 100644 --- a/app/lib/ffmpeg/index.js.map +++ b/app/lib/ffmpeg/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffmpeg/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAKb,+BAA4B;AAC5B,uCAA0D;AAC1D,+BAA4B;AAI5B,qBAAqB;AAErB,MAAM,MAAM;IAMX;;;;;QAKI;IACJ,YAAa,GAAS;QATd,OAAE,GAAY,QAAQ,CAAC;QAU9B,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,WAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;QACrD,IAAI,CAAC,IAAI,EAAE,CAAA;IACZ,CAAC;IACD;;QAEI;IACJ,KAAK,CAAC,IAAI;QACT,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC3B,IAAI,CAAC,GAAG,GAAG,MAAM,GAAG,CAAC,EAAE,KAAK,EAAG,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QAC1C,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;IACvB,CAAC;IACD;;;;;;QAMI;IAEI,YAAY,CAAE,CAAU;QAC/B,IAAI,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC;QAC1B,IAAI,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC;QACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;YACjC,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;SAChB;QACD,OAAO,GAAG,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lib/system/index.js b/app/lib/system/index.js index 568d0f7..92d00d1 100644 --- a/app/lib/system/index.js +++ b/app/lib/system/index.js @@ -15,21 +15,11 @@ const exec_1 = require("exec"); **/ async function dependencies(platform) { let obj = {}; + let ffmpeg = require('ffmpeg-static'); let ffoutput; let imoutput; let eogoutput; - try { - ffoutput = await exec_1.exec('which ffmpeg'); - } - catch (err) { - console.error('ffmpeg is not installed', err); - } - if (!ffoutput || ffoutput.stdout.trim() === '') { - console.error('ffmpeg is not installed'); - } - else { - obj.ffmpeg = ffoutput.stdout.trim(); - } + obj.ffmpeg = ffmpeg.path; try { imoutput = await exec_1.exec('which convert'); } diff --git a/app/lib/system/index.js.map b/app/lib/system/index.js.map index 364c7c8..a21ff24 100644 --- a/app/lib/system/index.js.map +++ b/app/lib/system/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/system/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAOb,2BAAkC;AAClC,uCAAkC;AAClC,SAAS;AACT,+BAA4B;AAC5B;;;;;;;;IAQI;AAGJ,KAAK,UAAU,YAAY,CAAE,QAAiB;IAC7C,IAAI,GAAG,GAAS,EAAE,CAAC;IACnB,IAAI,QAAqB,CAAC;IAC1B,IAAI,QAAqB,CAAC;IAC1B,IAAI,SAAsB,CAAC;IAE3B,IAAI;QACH,QAAQ,GAAG,MAAM,WAAI,CAAC,cAAc,CAAC,CAAC;KACtC;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAC;KAC9C;IAED,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QAC/C,OAAO,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;KACzC;SAAM;QACN,GAAG,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;KACpC;IAED,IAAI;QACH,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c0..dd5481f 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -2427,6 +2427,11 @@ "ffmpeg": { "version": "file:lib/ffmpeg" }, + "ffmpeg-static": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ffmpeg-static/-/ffmpeg-static-2.5.0.tgz", + "integrity": "sha512-4HI5aUFq9As3vNOm/0p4Pj47D8AxUqg0qnzaOuXwFMQ6uYhaLXGneUX/8b3C6gbU4ljASI+Ne7WKHpYFnLtK3A==" + }, "ffprobe": { "version": "file:lib/ffprobe" }, diff --git a/app/package.json b/app/package.json index 74519e4..16daaff 100644 --- a/app/package.json +++ b/app/package.json @@ -55,6 +55,7 @@ "exec": "file:lib/exec", "exit": "file:lib/exit", "ffmpeg": "file:lib/ffmpeg", + "ffmpeg-static": "^2.5.0", "ffprobe": "file:lib/ffprobe", "filmout": "file:lib/filmout", "fs-extra": "^8.0.1", diff --git a/cli/lib/ffmpeg/index.js b/cli/lib/ffmpeg/index.js index bed840f..5053899 100644 --- a/cli/lib/ffmpeg/index.js +++ b/cli/lib/ffmpeg/index.js @@ -13,8 +13,8 @@ class FFMPEG { **/ constructor(sys) { this.id = 'ffmpeg'; - this.system = sys; - this.TMPDIR = path_1.join(this.system.tmp, 'mcopy_digital'); + this.bin = sys.deps.ffmpeg; + this.TMPDIR = path_1.join(sys.tmp, 'mcopy_digital'); this.init(); } /** @@ -74,7 +74,7 @@ class FFMPEG { return parseInt(e); }); // - cmd = `ffmpeg -y -i "${video}" -vf "select='gte(n\\,${frameNum})'${scale}" -vframes 1 -compression_algo raw -pix_fmt rgb24 "${tmpoutput}"`; + cmd = `${this.bin} -y -i "${video}" -vf "select='gte(n\\,${frameNum})'${scale}" -vframes 1 -compression_algo raw -pix_fmt rgb24 "${tmpoutput}"`; cmd2 = `convert "${tmpoutput}" -resize ${w}x${h} -size ${w}x${h} xc:"rgb(${rgb[0]},${rgb[1]},${rgb[2]})" +swap -compose Darken -composite "${tmpoutput}"`; //ffmpeg -i "${video}" -ss 00:00:07.000 -vframes 1 "export-${time}.jpg" //ffmpeg -i "${video}" -compression_algo raw -pix_fmt rgb24 "export-%05d.tiff" diff --git a/cli/lib/ffmpeg/index.js.map b/cli/lib/ffmpeg/index.js.map index 09a6cdb..04f322b 100644 --- a/cli/lib/ffmpeg/index.js.map +++ b/cli/lib/ffmpeg/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffmpeg/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAKb,+BAA4B;AAC5B,uCAA0D;AAC1D,+BAA4B;AAI5B,qBAAqB;AAErB,MAAM,MAAM;IAMX;;;;;QAKI;IACJ,YAAa,GAAS;QATd,OAAE,GAAY,QAAQ,CAAC;QAU9B,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,WAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;QACrD,IAAI,CAAC,IAAI,EAAE,CAAA;IACZ,CAAC;IACD;;QAEI;IACJ,KAAK,CAAC,IAAI;QACT,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC3B,IAAI,CAAC,GAAG,GAAG,MAAM,GAAG,CAAC,EAAE,KAAK,EAAG,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QAC1C,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;IACvB,CAAC;IACD;;;;;;QAMI;IAEI,YAAY,CAAE,CAAU;QAC/B,IAAI,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC;QAC1B,IAAI,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC;QACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;YACjC,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;SAChB;QACD,OAAO,GAAG,CAAC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system/index.js b/cli/lib/system/index.js index 568d0f7..92d00d1 100644 --- a/cli/lib/system/index.js +++ b/cli/lib/system/index.js @@ -15,21 +15,11 @@ const exec_1 = require("exec"); **/ async function dependencies(platform) { let obj = {}; + let ffmpeg = require('ffmpeg-static'); let ffoutput; let imoutput; let eogoutput; - try { - ffoutput = await exec_1.exec('which ffmpeg'); - } - catch (err) { - console.error('ffmpeg is not installed', err); - } - if (!ffoutput || ffoutput.stdout.trim() === '') { - console.error('ffmpeg is not installed'); - } - else { - obj.ffmpeg = ffoutput.stdout.trim(); - } + obj.ffmpeg = ffmpeg.path; try { imoutput = await exec_1.exec('which convert'); } diff --git a/cli/lib/system/index.js.map b/cli/lib/system/index.js.map index 364c7c8..a21ff24 100644 --- a/cli/lib/system/index.js.map +++ b/cli/lib/system/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/system/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAOb,2BAAkC;AAClC,uCAAkC;AAClC,SAAS;AACT,+BAA4B;AAC5B;;;;;;;;IAQI;AAGJ,KAAK,UAAU,YAAY,CAAE,QAAiB;IAC7C,IAAI,GAAG,GAAS,EAAE,CAAC;IACnB,IAAI,QAAqB,CAAC;IAC1B,IAAI,QAAqB,CAAC;IAC1B,IAAI,SAAsB,CAAC;IAE3B,IAAI;QACH,QAAQ,GAAG,MAAM,WAAI,CAAC,cAAc,CAAC,CAAC;KACtC;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAC;KAC9C;IAED,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QAC/C,OAAO,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;KACzC;SAAM;QACN,GAAG,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;KACpC;IAED,IAAI;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ffmpeg/index.js index bed840f..5053899 100644 --- a/lib/ffmpeg/index.js +++ b/lib/ffmpeg/index.js @@ -13,8 +13,8 @@ class FFMPEG { **/ constructor(sys) { this.id = 'ffmpeg'; - this.system = sys; - this.TMPDIR = path_1.join(this.system.tmp, 'mcopy_digital'); + this.bin = sys.deps.ffmpeg; + this.TMPDIR = path_1.join(sys.tmp, 'mcopy_digital'); this.init(); } /** @@ -74,7 +74,7 @@ class FFMPEG { return parseInt(e); }); // - cmd = `ffmpeg -y -i "${video}" -vf "select='gte(n\\,${frameNum})'${scale}" -vframes 1 -compression_algo raw -pix_fmt rgb24 "${tmpoutput}"`; + cmd = `${this.bin} -y -i "${video}" -vf "select='gte(n\\,${frameNum})'${scale}" -vframes 1 -compression_algo raw -pix_fmt rgb24 "${tmpoutput}"`; cmd2 = `convert "${tmpoutput}" -resize ${w}x${h} -size ${w}x${h} xc:"rgb(${rgb[0]},${rgb[1]},${rgb[2]})" +swap -compose Darken -composite "${tmpoutput}"`; //ffmpeg -i "${video}" -ss 00:00:07.000 -vframes 1 "export-${time}.jpg" //ffmpeg -i "${video}" -compression_algo raw -pix_fmt rgb24 "export-%05d.tiff" diff --git a/lib/ffmpeg/index.js.map b/lib/ffmpeg/index.js.map index 09a6cdb..04f322b 100644 --- a/lib/ffmpeg/index.js.map +++ b/lib/ffmpeg/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffmpeg/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAKb,+BAA4B;AAC5B,uCAA0D;AAC1D,+BAA4B;AAI5B,qBAAqB;AAErB,MAAM,MAAM;IAMX;;;;;QAKI;IACJ,YAAa,GAAS;QATd,OAAE,GAAY,QAAQ,CAAC;QAU9B,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,WAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;QACrD,IAAI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D;QAED,IAAI,CAAC,UAAU,EAAE;YAChB,IAAI;gBACH,MAAM,gBAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBACzB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;aAC/C;YAAC,OAAO,GAAG,EAAE;gBACb,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,wBAAwB,EAAE,GAAG,CAAC,CAAC;aAC9C;SACD;QACD,IAAI;YACH,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;SACtB;QAAC,OAAO,GAAG,EAAE;YACb,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SACpB;IACF,CAAC;CACD;AAGD,MAAM,CAAC,OAAO,GAAG,CAAC,GAAS,EAAE,EAAE;IAC9B,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC,CAAA"} \ No newline at end of file diff --git a/lib/system/index.js b/lib/system/index.js index 568d0f7..92d00d1 100644 --- a/lib/system/index.js +++ b/lib/system/index.js @@ -15,21 +15,11 @@ const exec_1 = require("exec"); **/ async function dependencies(platform) { let obj = {}; + let ffmpeg = require('ffmpeg-static'); let ffoutput; let imoutput; let eogoutput; - try { - ffoutput = await exec_1.exec('which ffmpeg'); - } - catch (err) { - console.error('ffmpeg is not installed', err); - } - if (!ffoutput || ffoutput.stdout.trim() === '') { - console.error('ffmpeg is not installed'); - } - else { - obj.ffmpeg = ffoutput.stdout.trim(); - } + obj.ffmpeg = ffmpeg.path; try { imoutput = await exec_1.exec('which convert'); } diff --git a/lib/system/index.js.map b/lib/system/index.js.map index 364c7c8..a21ff24 100644 --- a/lib/system/index.js.map +++ b/lib/system/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/system/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAOb,2BAAkC;AAClC,uCAAkC;AAClC,SAAS;AACT,+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,QAAQ,EAAE;QAC1B,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC;KACrB;SAAM,IAAI,QAAQ,KAAK,YAAY,EAAE;QACrC,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC;KACrB;SAAM;QACN,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC;KACrB;IAED,GAAG,CAAC,QAAQ,GAAG,MAAM,QAAQ,EAAE,CAAA;IAC/B,GAAG,CAAC,IAAI,GAAG,MAAM,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAE5C,UAAU,CAAC,GAAG,EAAE;QACf,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACxB,CAAC,EAAE,IAAI,CAAC,CAAC;IAET,OAAO,GAAG,CAAC;AACZ,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC"} \ No newline at end of file diff --git a/src/ffmpeg/index.ts b/src/ffmpeg/index.ts index 2b1264b..7785269 100644 --- a/src/ffmpeg/index.ts +++ b/src/ffmpeg/index.ts @@ -12,7 +12,7 @@ import { exit } from 'exit'; /** @class FFMPEG **/ class FFMPEG { - private system : any; + private bin : string; private log : any; private id : string = 'ffmpeg'; private TMPDIR : string; @@ -24,9 +24,9 @@ class FFMPEG { * @param {object} sys System object to be used to get temp directory **/ constructor (sys : any) { - this.system = sys; - this.TMPDIR = join(this.system.tmp, 'mcopy_digital'); - this.init() + this.bin = sys.deps.ffmpeg; + this.TMPDIR = join(sys.tmp, 'mcopy_digital'); + this.init(); } /** * Async method to call async functions from constructor @@ -92,7 +92,7 @@ class FFMPEG { return parseInt(e); }); // - cmd = `ffmpeg -y -i "${video}" -vf "select='gte(n\\,${frameNum})'${scale}" -vframes 1 -compression_algo raw -pix_fmt rgb24 "${tmpoutput}"`; + cmd = `${this.bin} -y -i "${video}" -vf "select='gte(n\\,${frameNum})'${scale}" -vframes 1 -compression_algo raw -pix_fmt rgb24 "${tmpoutput}"`; cmd2 = `convert "${tmpoutput}" -resize ${w}x${h} -size ${w}x${h} xc:"rgb(${rgb[0]},${rgb[1]},${rgb[2]})" +swap -compose Darken -composite "${tmpoutput}"`; //ffmpeg -i "${video}" -ss 00:00:07.000 -vframes 1 "export-${time}.jpg" diff --git a/src/system/index.ts b/src/system/index.ts index 9524e70..1a6991c 100644 --- a/src/system/index.ts +++ b/src/system/index.ts @@ -22,21 +22,12 @@ import { exec } from 'exec'; async function dependencies (platform : string ) { let obj : any = {}; + let ffmpeg : any = require('ffmpeg-static') let ffoutput : ExecOutput; let imoutput : ExecOutput; let eogoutput : ExecOutput; - try { - ffoutput = await exec('which ffmpeg'); - } catch (err) { - console.error('ffmpeg is not installed', err); - } - - if (!ffoutput || ffoutput.stdout.trim() === '') { - console.error('ffmpeg is not installed'); - } else { - obj.ffmpeg = ffoutput.stdout.trim(); - } + obj.ffmpeg = ffmpeg.path; try { imoutput = await exec('which convert');