Add check for convert. Never used.
This commit is contained in:
parent
35b8b0def2
commit
691e741d70
|
@ -14,6 +14,7 @@ class FFMPEG {
|
||||||
constructor(sys) {
|
constructor(sys) {
|
||||||
this.id = 'ffmpeg';
|
this.id = 'ffmpeg';
|
||||||
this.bin = sys.deps.ffmpeg;
|
this.bin = sys.deps.ffmpeg;
|
||||||
|
this.convert = sys.deps.convert;
|
||||||
this.TMPDIR = path_1.join(sys.tmp, 'mcopy_digital');
|
this.TMPDIR = path_1.join(sys.tmp, 'mcopy_digital');
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
|
@ -75,7 +76,7 @@ class FFMPEG {
|
||||||
});
|
});
|
||||||
//
|
//
|
||||||
cmd = `${this.bin} -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}"`;
|
cmd2 = `${this.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}" -ss 00:00:07.000 -vframes 1 "export-${time}.jpg"
|
||||||
//ffmpeg -i "${video}" -compression_algo raw -pix_fmt rgb24 "export-%05d.tiff"
|
//ffmpeg -i "${video}" -compression_algo raw -pix_fmt rgb24 "export-%05d.tiff"
|
||||||
//-vf "select=gte(n\,${frame})" -compression_algo raw -pix_fmt rgb24 "export-${padded}.png"
|
//-vf "select=gte(n\,${frame})" -compression_algo raw -pix_fmt rgb24 "export-${padded}.png"
|
||||||
|
@ -88,7 +89,7 @@ class FFMPEG {
|
||||||
}
|
}
|
||||||
if (output && output.stdout)
|
if (output && output.stdout)
|
||||||
this.log.info(`"${output.stdout}"`);
|
this.log.info(`"${output.stdout}"`);
|
||||||
if (rgb[0] !== 255 || rgb[1] !== 255 || rgb[2] !== 255) {
|
if (this.convert && (rgb[0] !== 255 || rgb[1] !== 255 || rgb[2] !== 255)) {
|
||||||
try {
|
try {
|
||||||
this.log.info(cmd2);
|
this.log.info(cmd2);
|
||||||
output2 = await exec_1.exec(cmd2);
|
output2 = await exec_1.exec(cmd2);
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -158,6 +158,7 @@ class FilmOut {
|
||||||
displayName = pathStr.split('/').pop();
|
displayName = pathStr.split('/').pop();
|
||||||
elem.val(displayName);
|
elem.val(displayName);
|
||||||
$('#filmout_file').val(displayName);
|
$('#filmout_file').val(displayName);
|
||||||
|
this.useFile();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -185,6 +186,7 @@ class FilmOut {
|
||||||
$('#projector_type_digital').prop('checked', 'checked');
|
$('#projector_type_digital').prop('checked', 'checked');
|
||||||
$('#digital').removeClass('active');
|
$('#digital').removeClass('active');
|
||||||
}
|
}
|
||||||
|
//cancel video
|
||||||
}
|
}
|
||||||
onFilmout(evt, args) {
|
onFilmout(evt, args) {
|
||||||
let state;
|
let state;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -52,7 +52,7 @@ gui.notify = function (title, message) {
|
||||||
}
|
}
|
||||||
return resolve(true);
|
return resolve(true);
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
};
|
};
|
||||||
gui.updateCam = async function (t) {
|
gui.updateCam = async function (t) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
|
@ -162,6 +162,8 @@ class FilmOut {
|
||||||
displayName = pathStr.split('/').pop();
|
displayName = pathStr.split('/').pop();
|
||||||
elem.val(displayName);
|
elem.val(displayName);
|
||||||
$('#filmout_file').val(displayName);
|
$('#filmout_file').val(displayName);
|
||||||
|
|
||||||
|
this.useFile();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
useFile () {
|
useFile () {
|
||||||
|
@ -188,6 +190,7 @@ class FilmOut {
|
||||||
$('#projector_type_digital').prop('checked', 'checked');
|
$('#projector_type_digital').prop('checked', 'checked');
|
||||||
$('#digital').removeClass('active');
|
$('#digital').removeClass('active');
|
||||||
}
|
}
|
||||||
|
//cancel video
|
||||||
}
|
}
|
||||||
onFilmout (evt : any, args : any) {
|
onFilmout (evt : any, args : any) {
|
||||||
let state : any;
|
let state : any;
|
||||||
|
|
|
@ -14,6 +14,7 @@ class FFMPEG {
|
||||||
constructor(sys) {
|
constructor(sys) {
|
||||||
this.id = 'ffmpeg';
|
this.id = 'ffmpeg';
|
||||||
this.bin = sys.deps.ffmpeg;
|
this.bin = sys.deps.ffmpeg;
|
||||||
|
this.convert = sys.deps.convert;
|
||||||
this.TMPDIR = path_1.join(sys.tmp, 'mcopy_digital');
|
this.TMPDIR = path_1.join(sys.tmp, 'mcopy_digital');
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
|
@ -75,7 +76,7 @@ class FFMPEG {
|
||||||
});
|
});
|
||||||
//
|
//
|
||||||
cmd = `${this.bin} -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}"`;
|
cmd2 = `${this.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}" -ss 00:00:07.000 -vframes 1 "export-${time}.jpg"
|
||||||
//ffmpeg -i "${video}" -compression_algo raw -pix_fmt rgb24 "export-%05d.tiff"
|
//ffmpeg -i "${video}" -compression_algo raw -pix_fmt rgb24 "export-%05d.tiff"
|
||||||
//-vf "select=gte(n\,${frame})" -compression_algo raw -pix_fmt rgb24 "export-${padded}.png"
|
//-vf "select=gte(n\,${frame})" -compression_algo raw -pix_fmt rgb24 "export-${padded}.png"
|
||||||
|
@ -88,7 +89,7 @@ class FFMPEG {
|
||||||
}
|
}
|
||||||
if (output && output.stdout)
|
if (output && output.stdout)
|
||||||
this.log.info(`"${output.stdout}"`);
|
this.log.info(`"${output.stdout}"`);
|
||||||
if (rgb[0] !== 255 || rgb[1] !== 255 || rgb[2] !== 255) {
|
if (this.convert && (rgb[0] !== 255 || rgb[1] !== 255 || rgb[2] !== 255)) {
|
||||||
try {
|
try {
|
||||||
this.log.info(cmd2);
|
this.log.info(cmd2);
|
||||||
output2 = await exec_1.exec(cmd2);
|
output2 = await exec_1.exec(cmd2);
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -13,6 +13,7 @@ import { exit } from 'exit';
|
||||||
|
|
||||||
class FFMPEG {
|
class FFMPEG {
|
||||||
private bin : string;
|
private bin : string;
|
||||||
|
private convert : string;
|
||||||
private log : any;
|
private log : any;
|
||||||
private id : string = 'ffmpeg';
|
private id : string = 'ffmpeg';
|
||||||
private TMPDIR : string;
|
private TMPDIR : string;
|
||||||
|
@ -25,6 +26,7 @@ class FFMPEG {
|
||||||
**/
|
**/
|
||||||
constructor (sys : any) {
|
constructor (sys : any) {
|
||||||
this.bin = sys.deps.ffmpeg;
|
this.bin = sys.deps.ffmpeg;
|
||||||
|
this.convert = sys.deps.convert;
|
||||||
this.TMPDIR = join(sys.tmp, 'mcopy_digital');
|
this.TMPDIR = join(sys.tmp, 'mcopy_digital');
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
|
@ -93,7 +95,7 @@ class FFMPEG {
|
||||||
});
|
});
|
||||||
//
|
//
|
||||||
cmd = `${this.bin} -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}"`;
|
cmd2 = `${this.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}" -ss 00:00:07.000 -vframes 1 "export-${time}.jpg"
|
||||||
//ffmpeg -i "${video}" -compression_algo raw -pix_fmt rgb24 "export-%05d.tiff"
|
//ffmpeg -i "${video}" -compression_algo raw -pix_fmt rgb24 "export-%05d.tiff"
|
||||||
|
@ -107,7 +109,7 @@ class FFMPEG {
|
||||||
}
|
}
|
||||||
if (output && output.stdout) this.log.info(`"${output.stdout}"`);
|
if (output && output.stdout) this.log.info(`"${output.stdout}"`);
|
||||||
|
|
||||||
if (rgb[0] !== 255 || rgb[1] !== 255 || rgb[2] !== 255) {
|
if (this.convert && (rgb[0] !== 255 || rgb[1] !== 255 || rgb[2] !== 255)) {
|
||||||
try {
|
try {
|
||||||
this.log.info(cmd2);
|
this.log.info(cmd2);
|
||||||
output2 = await exec(cmd2);
|
output2 = await exec(cmd2);
|
||||||
|
|
|
@ -202,6 +202,7 @@ class FilmOut {
|
||||||
this.state.enabled = true;
|
this.state.enabled = true;
|
||||||
return await this.ui.send(this.id, { valid : true, state : JSON.stringify(this.state) });
|
return await this.ui.send(this.id, { valid : true, state : JSON.stringify(this.state) });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if gif is animated, false if it is a still
|
* Return true if gif is animated, false if it is a still
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue