Update extract.js
This commit is contained in:
parent
29e91d7de4
commit
8864f1f910
|
@ -41,13 +41,22 @@ function extract(req,res,next) {
|
||||||
let fps = req.query.fps || 1;
|
let fps = req.query.fps || 1;
|
||||||
//compress = zip or gzip
|
//compress = zip or gzip
|
||||||
let compress = req.query.compress || "none";
|
let compress = req.query.compress || "none";
|
||||||
|
let preset = req.query.preset || "default";
|
||||||
let ffmpegParams ={};
|
let ffmpegParams ={};
|
||||||
var format = "png";
|
var format = "png";
|
||||||
if (extract === "images"){
|
if (extract === "images"){
|
||||||
format = "png"
|
format = "png"
|
||||||
ffmpegParams.outputOptions=[
|
ffmpegParams.outputOptions=[];
|
||||||
`-vf fps=${fps}`
|
switch (preset) {
|
||||||
];
|
case "preset-1":
|
||||||
|
ffmpegParams.outputOptions.push(`-vf scale='min(400, iw):min(400, ih)':force_original_aspect_ratio=decrease`);
|
||||||
|
ffmpegParams.outputOptions.push(`-f image2`);
|
||||||
|
ffmpegParams.outputOptions.push(`-vframes 1`);
|
||||||
|
ffmpegParams.outputOptions.push(`-y`);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ffmpegParams.outputOptions.push(`-vf fps=${fps}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (extract === "audio"){
|
if (extract === "audio"){
|
||||||
format = "wav"
|
format = "wav"
|
||||||
|
@ -199,4 +208,4 @@ function extract(req,res,next) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = router
|
module.exports = router
|
||||||
|
|
Loading…
Reference in New Issue
Block a user