Add ability to use ENV variables in a subprocess. Use the DISPLAY env variable when launching fd to set which screen it launches on.
This commit is contained in:
parent
acd7e3bae2
commit
748551a353
|
@ -5,6 +5,7 @@ WS_PORT=8081
|
|||
WIDTH=2560
|
||||
HEIGHT=1600
|
||||
FD=../filmout_display/build/bin/fd
|
||||
#FD_DISPLAY=:0
|
||||
FFMPEG=ffmpeg
|
||||
FD_HOST=localhost
|
||||
FD_PORT=8082
|
||||
|
|
|
@ -43,6 +43,7 @@ export declare class FD {
|
|||
private height;
|
||||
private host;
|
||||
private port;
|
||||
private env;
|
||||
private shell;
|
||||
private log;
|
||||
private client;
|
||||
|
@ -50,7 +51,7 @@ export declare class FD {
|
|||
private socketConnected;
|
||||
private waiting;
|
||||
private mock;
|
||||
constructor(bin: string, width: number, height: number, host: string, port: number, mock?: boolean);
|
||||
constructor(bin: string, width: number, height: number, host: string, port: number, display?: string, mock?: boolean);
|
||||
private startDisplay;
|
||||
private startClient;
|
||||
private logstd;
|
||||
|
|
|
@ -25,7 +25,8 @@ var Mode;
|
|||
Mode[Mode["INVERT_CHANNELS"] = 5] = "INVERT_CHANNELS";
|
||||
})(Mode || (Mode = {}));
|
||||
class FD {
|
||||
constructor(bin, width, height, host, port, mock = false) {
|
||||
constructor(bin, width, height, host, port, display = null, mock = false) {
|
||||
this.env = null;
|
||||
this.shell = null;
|
||||
this.client = null;
|
||||
this.socketAvailable = false;
|
||||
|
@ -40,12 +41,17 @@ class FD {
|
|||
this.mock = mock;
|
||||
this.log = (0, log_1.createLog)('fd');
|
||||
if (!this.mock) {
|
||||
if (display !== null) {
|
||||
this.env = {
|
||||
DISPLAY: display
|
||||
};
|
||||
}
|
||||
this.shell = new shell_1.Shell([
|
||||
this.bin,
|
||||
'--width', `${this.width}`,
|
||||
'--height', `${this.height}`,
|
||||
'--port', `${this.port}`
|
||||
], this.logstd.bind(this), this.logsterr.bind(this), null, true);
|
||||
], this.env, this.logstd.bind(this), this.logsterr.bind(this), null, true);
|
||||
}
|
||||
this.startDisplay();
|
||||
this.startClient();
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -14,14 +14,14 @@ class FFMPEG {
|
|||
async rawList() {
|
||||
const cmd = [this.bin, '-formats'];
|
||||
return new Promise(async (resolve, reject) => {
|
||||
this.shell = new shell_1.Shell(cmd, null, null, resolve, true);
|
||||
this.shell = new shell_1.Shell(cmd, null, null, null, resolve, true);
|
||||
await this.shell.execute();
|
||||
});
|
||||
}
|
||||
async demuxerInfo(demuxer) {
|
||||
const cmd = [this.bin, `ffmpeg -h demuxer=${demuxer}`];
|
||||
return new Promise(async (resolve, reject) => {
|
||||
this.shell = new shell_1.Shell(cmd, null, null, resolve, true);
|
||||
this.shell = new shell_1.Shell(cmd, null, null, null, resolve, true);
|
||||
await this.shell.execute();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffmpeg/index.ts"],"names":[],"mappings":";;;AACA,gCAAkC;AAClC,oCAAiC;AAEjC,2BAAyB;AAEzB,MAAa,MAAM;IAOlB,YAAa,MAAc,QAAQ;QAH3B,YAAO,GAAc,EAAE,CAAC;QACxB,gBAAW,GAAS,EAAE,CAAC;QAG9B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,GAAG,GAAG,IAAA,eAAS,EAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;IAEO,KAAK,CAAC,OAAO;QACpB,MAAM,GAAG,GAAc,CAAE,IAAI,CAAC,GAAG,EAAE,UAAU,CAAE,CAAC;QAChD,OAAO,IAAI,OAAO,CAAC,KAAK,EAAE,OAAkB,EAAE,MAAiB,EAAE,EAAE;YAClE,IAAI,CAAC,KAAK,GAAG,IAAI,aAAK,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;YACvD,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QAC5B,CAAC,CAA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IACrB,CAAC;CACD;AAjFD,wBAiFC;AAED,MAAM,CAAC,OAAO,GAAG,EAAE,MAAM,EAAE,CAAC"}
|
|
@ -103,7 +103,7 @@ class FFPROBE {
|
|||
function after(lines) {
|
||||
return resolve(lines);
|
||||
}
|
||||
const child = new shell_1.Shell(cmd, null, null, after, true);
|
||||
const child = new shell_1.Shell(cmd, null, null, null, after, true);
|
||||
await child.execute();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ffprobe/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAEb,0CAAqC;AACrC,+BAA+B;AAC/B,oCAAiC;AACjC,gCAAmC;AAenC;;GAEG;AAEH,MAAa,OAAO;IAInB,YAAa,MAAe,SAAS;QACpC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,GAAG,GAAG,IAAA,eAAS,EAAC,UAAU,CAAC,CAAC;IAClC,CAAC;IAEM,KAAK,CAAC,MAAM,CAAE,IAAa;QACjC,IAAI,CAAC;YACJ,MAAM,IAAA,iBAAM,EAAC,IAAI,CAAC,CAAC;YACnB,OAAO,IAAI,CAAC;QACb,CAAC;QAAC,MAAM,CAAC;YACR,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IAED;;QAEI;IACI,QAAQ,CAAE,MAAe;QAChC,IAAI,GAAG,GAAY,IAAI,CAAC;QACxB,IAAI,KAAgB,CAAC;QACrB,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;YAChC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC1B,GAAG,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACnD,CAAC;aAAM,CAAC;YACP,GAAG,GAAG,UAAU,CAAC,MAAM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E,CAAC;YACd,OAAO,GAAG,CAAC,MAAM,CAAC;QACnB,CAAC;QAED,OAAO,MAAM,CAAC;IACf,CAAC;CACD;AAzKD,0BAyKC;AAED;;;;EAIE;AAEF,MAAM,CAAC,OAAO,GAAG,EAAE,OAAO,EAAE,CAAC"}
|
|
@ -42,7 +42,7 @@ class Image {
|
|||
'-depth', '8',
|
||||
output
|
||||
];
|
||||
const shell = new shell_1.Shell(args, null, null, null, true);
|
||||
const shell = new shell_1.Shell(args, null, null, null, null, true);
|
||||
try {
|
||||
await shell.execute();
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/image/index.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,kCAAiC;AACjC,+BAAqC;AACrC,2BAA4B;AAC5B,0CAA4C;AAC5C,oCAAiC;AAEjC,MAAa,KAAK;IAQjB;QAPQ,WAAM,GAAY,WAAW,CAAC;QAC9B,mBAAc,GAAY,IAAI,CAAC;QAC/B,kBAAa,GAAY,IAAI,CAAC;QAC9B,eAAU,GAAY,IAAI,CAAC;QAC3B,cAAS,GAAY,IAAI,CAAC;QAC1B,QAAG,GAAY,IAAI,CAAC;QAG3B,IAAI,IAAI,CAAC,GAAG,KAAK,IAAI,EAAE,CAAC;YACvB,IAAI,CAAC,GAAG,GAAG,IAAA,WAAM,GAAE,CAAC;QACrB,CAAC;IACF,CAAC;IAEO,KAAK,CAAC,MAAM,CAAE,MAAe,MAAM;QAC1C,MAAM,YAAY,GAAY,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAClE,MAAM,QAAQ,GAAY,IAAA,WAAI,EAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC;QAEhF,IAAI,CAAC;YACJ,MAAM,IAAA,gBAAK,EAAC,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BAAM,EAAC,OAAO,CAAC,CAAC;gBACvB,CAAC;gBAAC,OAAO,GAAG,EAAE,CAAC;oBACd,EAAE;gBACH,CAAC;YACF,CAAC;QACF,CAAC;QACD,OAAO,IAAI,CAAC,cAAc,CAAC;IAC5B,CAAC;IAEM,KAAK,CAAC,KAAK,CAAE,KAAc,EAAE,MAAe;QAClD,MAAM,IAAI,GAAY,aAAM,CAAC,UAAU,CAAC,GAAG,KAAK,IAAI,MAAM,EAAE,CAAC,CAAC;QAC9D,IAAI,IAAI,KAAK,IAAI,CAAC,SAAS,EAAE,CAAC;YAC7B,MAAM,OAAO,GAAkB;gBAC9B,MAAM,EAAE;oBACP,KAAK;oBACL,MAAM;oBACN,QAAQ,EAAE,CAAC;oBACX,UAAU,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE;iBACtC;aACD,CAAC;YACF,IAAI,CAAC,UAAU,GAAG,MAAM,IAAA,eAAK,EAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC;YACzD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACvB,CAAC;QACD,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;CACD;AA1FD,sBA0FC;AAED,MAAM,CAAC,OAAO,GAAG,EAAE,KAAK,EAAE,CAAC"}
|
|
@ -467,7 +467,7 @@ async function main() {
|
|||
image = new image_1.Image();
|
||||
camera = new camera_1.Camera(mock);
|
||||
display = new display_1.Display(width, height);
|
||||
fd = new fd_1.FD((0, env_1.envString)('FD', 'fd'), width, height, (0, env_1.envString)('FD_HOST', 'localhost'), (0, env_1.envInt)('FD_PORT', 8082), mock);
|
||||
fd = new fd_1.FD((0, env_1.envString)('FD', 'fd'), width, height, (0, env_1.envString)('FD_HOST', 'localhost'), (0, env_1.envInt)('FD_PORT', 8082), (0, env_1.envString)('FD_DISPLAY', null), mock);
|
||||
app.listen(port, async () => {
|
||||
log.info(`filmout_manager HTTP server running on port ${port}`);
|
||||
});
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -3,12 +3,13 @@ export declare class Shell {
|
|||
private log;
|
||||
private bin;
|
||||
private args;
|
||||
private opts;
|
||||
private lines;
|
||||
private stdio;
|
||||
private stderr;
|
||||
private after;
|
||||
private silent;
|
||||
constructor(args: any[], stdio?: Function, stderr?: Function, after?: Function, silent?: boolean);
|
||||
constructor(args: any[], env?: any, stdio?: Function, stderr?: Function, after?: Function, silent?: boolean);
|
||||
execute(): Promise<number>;
|
||||
kill(): void;
|
||||
}
|
||||
|
|
|
@ -5,13 +5,16 @@ const child_process_1 = require("child_process");
|
|||
const log_1 = require("../log");
|
||||
const os_1 = require("os");
|
||||
class Shell {
|
||||
constructor(args, stdio = null, stderr = null, after = null, silent = false) {
|
||||
constructor(args, env = null, stdio = null, stderr = null, after = null, silent = false) {
|
||||
this.opts = {};
|
||||
this.lines = [];
|
||||
this.stdio = null;
|
||||
this.stderr = null;
|
||||
this.after = null;
|
||||
this.silent = false;
|
||||
const bin = args.shift();
|
||||
if (env !== null)
|
||||
this.opts = { env };
|
||||
this.bin = bin;
|
||||
this.args = args;
|
||||
this.stdio = stdio;
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shell/index.ts"],"names":[],"mappings":";;;AAAA,iDAAsE;AACtE,gCAAmC;AAEnC,2BAAyB;AAEzB,MAAa,KAAK;IAWjB,YAAa,IAAY,EAAE,QAAmB,IAAI,EAAE,SAAoB,IAAI,EAAE,QAAmB,IAAI,EAAE,SAAmB,KAAK;QANvH,UAAK,GAAc,EAAE,CAAC;QACtB,UAAK,GAAc,IAAI,CAAC;QACxB,WAAM,GAAc,IAAI,CAAC;QACzB,UAAK,GAAc,IAAI,CAAC;QACxB,WAAM,GAAa,KAAK,CAAC;QAGhC,MAAM,GAAG,GAAY,IAAI,CAAC,KAAK,EAAE,CAAC;QAClC,IAAI,CAAC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,IAAI,CAAC,MAAM;YAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC/E,2BAA2B;QAC3B,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACnB,CAAC;CACD;AApED,sBAoEC;AAED,MAAM,CAAC,OAAO,GAAG,EAAE,KAAK,EAAE,CAAC"}
|
|
@ -56,6 +56,7 @@ export class FD {
|
|||
private height : number;
|
||||
private host : string;
|
||||
private port : number;
|
||||
private env : any = null;
|
||||
private shell : Shell = null;
|
||||
private log : Logger;
|
||||
private client : Socket = null;
|
||||
|
@ -65,7 +66,7 @@ export class FD {
|
|||
private waiting : Function = null;
|
||||
private mock : boolean = false;
|
||||
|
||||
constructor (bin: string, width : number, height : number, host : string, port : number, mock : boolean = false) {
|
||||
constructor (bin: string, width : number, height : number, host : string, port : number, display : string = null, mock : boolean = false) {
|
||||
this.bin = bin;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
|
@ -74,12 +75,17 @@ export class FD {
|
|||
this.mock = mock;
|
||||
this.log = createLog('fd');
|
||||
if (!this.mock) {
|
||||
if (display !== null) {
|
||||
this.env = {
|
||||
DISPLAY : display
|
||||
}
|
||||
}
|
||||
this.shell = new Shell([
|
||||
this.bin,
|
||||
'--width', `${this.width}`,
|
||||
'--height', `${this.height}`,
|
||||
'--port', `${this.port}`
|
||||
], this.logstd.bind(this), this.logsterr.bind(this), null, true);
|
||||
], this.env, this.logstd.bind(this), this.logsterr.bind(this), null, true);
|
||||
}
|
||||
this.startDisplay();
|
||||
this.startClient();
|
||||
|
|
|
@ -19,7 +19,7 @@ export class FFMPEG {
|
|||
private async rawList () : Promise<string> {
|
||||
const cmd : string[] = [ this.bin, '-formats' ];
|
||||
return new Promise(async (resolve : Function, reject : Function) => {
|
||||
this.shell = new Shell(cmd, null, null, resolve, true);
|
||||
this.shell = new Shell(cmd, null, null, null, resolve, true);
|
||||
await this.shell.execute();
|
||||
});
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ export class FFMPEG {
|
|||
private async demuxerInfo (demuxer : string) : Promise<string> {
|
||||
const cmd : string[] = [ this.bin, `ffmpeg -h demuxer=${demuxer}` ];
|
||||
return new Promise(async (resolve : Function, reject : Function) => {
|
||||
this.shell = new Shell(cmd, null, null, resolve, true);
|
||||
this.shell = new Shell(cmd, null, null, null, resolve, true);
|
||||
await this.shell.execute();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -124,7 +124,7 @@ export class FFPROBE {
|
|||
function after (lines : string) {
|
||||
return resolve(lines);
|
||||
}
|
||||
const child : Shell = new Shell(cmd, null, null, after, true);
|
||||
const child : Shell = new Shell(cmd, null, null, null, after, true);
|
||||
await child.execute();
|
||||
});
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ export class Image {
|
|||
'-depth', '8',
|
||||
output
|
||||
];
|
||||
const shell : Shell = new Shell(args, null, null, null, true);
|
||||
const shell : Shell = new Shell(args, null, null, null, null, true);
|
||||
try {
|
||||
await shell.execute();
|
||||
} catch (err) {
|
||||
|
|
|
@ -19,7 +19,6 @@ import { envString, envInt } from './env';
|
|||
import { sendMail } from './mail';
|
||||
import { Files } from './files';
|
||||
import type { SequenceObject, VideoObject, ImageObject } from './files';
|
||||
import { Shell } from './shell';
|
||||
import { delay } from './delay';
|
||||
import { TestImage } from './testimage';
|
||||
import { FD } from './fd';
|
||||
|
@ -467,7 +466,7 @@ async function main () {
|
|||
image = new Image();
|
||||
camera = new Camera(mock);
|
||||
display = new Display(width, height);
|
||||
fd = new FD(envString('FD', 'fd'), width, height, envString('FD_HOST', 'localhost'), envInt('FD_PORT', 8082), mock);
|
||||
fd = new FD(envString('FD', 'fd'), width, height, envString('FD_HOST', 'localhost'), envInt('FD_PORT', 8082), envString('FD_DISPLAY', null), mock);
|
||||
|
||||
app.listen(port, async () => {
|
||||
log.info(`filmout_manager HTTP server running on port ${port}`);
|
||||
|
|
|
@ -7,15 +7,17 @@ export class Shell {
|
|||
private child : ChildProcessWithoutNullStreams;
|
||||
private log : Logger;
|
||||
private bin : string;
|
||||
private args : any[];
|
||||
private args : any[];
|
||||
private opts : any = {};
|
||||
private lines : string[] = [];
|
||||
private stdio : Function = null;
|
||||
private stderr : Function = null;
|
||||
private after : Function = null;
|
||||
private silent : boolean = false;
|
||||
|
||||
constructor (args : any[], stdio : Function = null, stderr : Function = null, after : Function = null, silent : boolean = false) {
|
||||
constructor (args : any[], env : any = null, stdio : Function = null, stderr : Function = null, after : Function = null, silent : boolean = false) {
|
||||
const bin : string = args.shift();
|
||||
if (env !== null) this.opts = { env };
|
||||
this.bin = bin;
|
||||
this.args = args;
|
||||
this.stdio = stdio;
|
||||
|
|
Loading…
Reference in New Issue