@quatrain/worker 1.1.25 → 1.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/Helpers.d.ts CHANGED
@@ -7,5 +7,5 @@ export declare class Helpers {
7
7
  * @param width width of thumbnail (4/3 ratio)
8
8
  * @returns
9
9
  */
10
- static generateVideoThumbnail: (videoPath: string, frame?: number, width?: number) => Promise<any>;
10
+ static generateVideoThumbnail: (videoPath: string, outputPath: string, frame?: number, width?: number) => Promise<any>;
11
11
  }
package/lib/Helpers.js CHANGED
@@ -1,11 +1,7 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.Helpers = void 0;
7
4
  const Worker_1 = require("./Worker");
8
- const path_1 = __importDefault(require("path"));
9
5
  class Helpers {
10
6
  static FFMPEG = '/usr/bin/ffmpeg';
11
7
  /**
@@ -15,16 +11,15 @@ class Helpers {
15
11
  * @param width width of thumbnail (4/3 ratio)
16
12
  * @returns
17
13
  */
18
- static generateVideoThumbnail = async (videoPath, frame = 0, width = 320) => {
14
+ static generateVideoThumbnail = async (videoPath, outputPath, frame = 0, width = 320) => {
19
15
  const resolution = `${width}x${Math.ceil(width * 0.75)}`;
20
- const outputPath = path_1.default.resolve(videoPath.split('.')[0], `_${frame}_${resolution}.jpg`);
21
16
  const ffmpegParams = [
22
17
  '-i',
23
18
  videoPath,
24
19
  '-vframes',
25
20
  '1',
26
21
  '-vf',
27
- `select=gte(n\,${frame})`,
22
+ `"select=gte(n\,${frame})"`,
28
23
  '-s',
29
24
  resolution,
30
25
  '-ss',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quatrain/worker",
3
- "version": "1.1.25",
3
+ "version": "1.1.26",
4
4
  "description": "Container Worker helpers",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",