@osaas/client-transcode 0.26.1 → 0.27.0
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/vmaf.d.ts +18 -1
- package/lib/vmaf.d.ts.map +1 -1
- package/lib/vmaf.js +7 -5
- package/lib/vmaf.js.map +1 -1
- package/package.json +4 -4
package/lib/vmaf.d.ts
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Context } from '@osaas/client-core';
|
|
3
|
+
/**
|
|
4
|
+
* Options for VMAF comparison
|
|
5
|
+
*
|
|
6
|
+
* @memberof module:@osaas/client-transcode
|
|
7
|
+
* @typedef {Object} VmafCompareOptions
|
|
8
|
+
* @property {string} [awsAccessKeyId] - AWS Access Key ID
|
|
9
|
+
* @property {string} [awsSecretAccessKey] - AWS Secret Access Key
|
|
10
|
+
* @property {string} [awsSessionToken] - AWS Session Token
|
|
11
|
+
* @property {string} [s3EndpointUrl] - S3 Endpoint URL
|
|
12
|
+
*/
|
|
13
|
+
export interface VmafCompareOptions {
|
|
14
|
+
awsAccessKeyId?: string;
|
|
15
|
+
awsSecretAccessKey?: string;
|
|
16
|
+
awsSessionToken?: string;
|
|
17
|
+
s3EndpointUrl?: string;
|
|
18
|
+
}
|
|
3
19
|
/**
|
|
4
20
|
* Compare two video files using VMAF
|
|
5
21
|
*
|
|
@@ -9,6 +25,7 @@ import { Context } from '@osaas/client-core';
|
|
|
9
25
|
* @param {URL} reference - URL to reference video file (supported protocols: s3)
|
|
10
26
|
* @param {URL} distorted - URL to distorted video file (supported protocols: s3)
|
|
11
27
|
* @param {URL} resultBucket - URL to S3 bucket where result file will be stored
|
|
28
|
+
* @param {VmafCompareOptions} [opts] - Options for VMAF comparison
|
|
12
29
|
* @returns S3 URL to result file
|
|
13
30
|
* @example
|
|
14
31
|
* import { Context } from '@osaas/client-core';
|
|
@@ -20,5 +37,5 @@ import { Context } from '@osaas/client-core';
|
|
|
20
37
|
* const resultBucket = new URL('s3://video/results');
|
|
21
38
|
* const resultFile = await vmafCompare(ctx, reference, distorted, resultBucket);
|
|
22
39
|
*/
|
|
23
|
-
export declare function vmafCompare(ctx: Context, reference: URL, distorted: URL, resultBucket: URL): Promise<URL>;
|
|
40
|
+
export declare function vmafCompare(ctx: Context, reference: URL, distorted: URL, resultBucket: URL, opts?: VmafCompareOptions): Promise<URL>;
|
|
24
41
|
//# sourceMappingURL=vmaf.d.ts.map
|
package/lib/vmaf.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vmaf.d.ts","sourceRoot":"","sources":["../src/vmaf.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,OAAO,EAIR,MAAM,oBAAoB,CAAC;AAG5B
|
|
1
|
+
{"version":3,"file":"vmaf.d.ts","sourceRoot":"","sources":["../src/vmaf.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,OAAO,EAIR,MAAM,oBAAoB,CAAC;AAG5B;;;;;;;;;GASG;AACH,MAAM,WAAW,kBAAkB;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,WAAW,CAC/B,GAAG,EAAE,OAAO,EACZ,SAAS,EAAE,GAAG,EACd,SAAS,EAAE,GAAG,EACd,YAAY,EAAE,GAAG,EACjB,IAAI,GAAE,kBAAuB,GAC5B,OAAO,CAAC,GAAG,CAAC,CA+Bd"}
|
package/lib/vmaf.js
CHANGED
|
@@ -15,6 +15,7 @@ const node_path_1 = __importDefault(require("node:path"));
|
|
|
15
15
|
* @param {URL} reference - URL to reference video file (supported protocols: s3)
|
|
16
16
|
* @param {URL} distorted - URL to distorted video file (supported protocols: s3)
|
|
17
17
|
* @param {URL} resultBucket - URL to S3 bucket where result file will be stored
|
|
18
|
+
* @param {VmafCompareOptions} [opts] - Options for VMAF comparison
|
|
18
19
|
* @returns S3 URL to result file
|
|
19
20
|
* @example
|
|
20
21
|
* import { Context } from '@osaas/client-core';
|
|
@@ -26,20 +27,21 @@ const node_path_1 = __importDefault(require("node:path"));
|
|
|
26
27
|
* const resultBucket = new URL('s3://video/results');
|
|
27
28
|
* const resultFile = await vmafCompare(ctx, reference, distorted, resultBucket);
|
|
28
29
|
*/
|
|
29
|
-
async function vmafCompare(ctx, reference, distorted, resultBucket) {
|
|
30
|
+
async function vmafCompare(ctx, reference, distorted, resultBucket, opts = {}) {
|
|
30
31
|
const serviceAccessToken = await ctx.getServiceAccessToken('eyevinn-easyvmaf-s3');
|
|
31
32
|
const jobId = Math.random().toString(36).substring(7);
|
|
32
33
|
const resultFile = `${resultBucket
|
|
33
34
|
.toString()
|
|
34
35
|
.replace(/\/$/, '')}/${node_path_1.default.basename(distorted.pathname)}_${jobId}.json`;
|
|
35
|
-
if (!
|
|
36
|
+
if (!opts.awsAccessKeyId || !opts.awsSecretAccessKey) {
|
|
36
37
|
throw new Error('AWS credentials not set');
|
|
37
38
|
}
|
|
38
39
|
const job = await (0, client_core_1.createJob)(ctx, 'eyevinn-easyvmaf-s3', serviceAccessToken, {
|
|
39
40
|
name: jobId,
|
|
40
|
-
AwsAccessKeyId:
|
|
41
|
-
AwsSecretAccessKey:
|
|
42
|
-
AwsSessionToken:
|
|
41
|
+
AwsAccessKeyId: opts.awsAccessKeyId,
|
|
42
|
+
AwsSecretAccessKey: opts.awsSecretAccessKey,
|
|
43
|
+
AwsSessionToken: opts.awsSessionToken,
|
|
44
|
+
S3EndpointUrl: opts.s3EndpointUrl,
|
|
43
45
|
cmdLineArgs: `-r ${reference.toString()} -d ${distorted.toString()} -o ${resultFile}`
|
|
44
46
|
});
|
|
45
47
|
(0, client_core_1.Log)().debug(`Comparing file ${reference.toString()} with ${reference.toString()}`);
|
package/lib/vmaf.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vmaf.js","sourceRoot":"","sources":["../src/vmaf.ts"],"names":[],"mappings":";;;;;;AAAA,oDAK4B;AAC5B,0DAA6B;
|
|
1
|
+
{"version":3,"file":"vmaf.js","sourceRoot":"","sources":["../src/vmaf.ts"],"names":[],"mappings":";;;;;;AAAA,oDAK4B;AAC5B,0DAA6B;AAmB7B;;;;;;;;;;;;;;;;;;;;GAoBG;AACI,KAAK,UAAU,WAAW,CAC/B,GAAY,EACZ,SAAc,EACd,SAAc,EACd,YAAiB,EACjB,OAA2B,EAAE;IAE7B,MAAM,kBAAkB,GAAG,MAAM,GAAG,CAAC,qBAAqB,CACxD,qBAAqB,CACtB,CAAC;IACF,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACtD,MAAM,UAAU,GAAG,GAAG,YAAY;SAC/B,QAAQ,EAAE;SACV,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,mBAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,KAAK,OAAO,CAAC;IAE3E,IAAI,CAAC,IAAI,CAAC,cAAc,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE;QACpD,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;KAC5C;IACD,MAAM,GAAG,GAAG,MAAM,IAAA,uBAAS,EAAC,GAAG,EAAE,qBAAqB,EAAE,kBAAkB,EAAE;QAC1E,IAAI,EAAE,KAAK;QACX,cAAc,EAAE,IAAI,CAAC,cAAc;QACnC,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;QAC3C,eAAe,EAAE,IAAI,CAAC,eAAe;QACrC,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,WAAW,EAAE,MAAM,SAAS,CAAC,QAAQ,EAAE,OAAO,SAAS,CAAC,QAAQ,EAAE,OAAO,UAAU,EAAE;KACtF,CAAC,CAAC;IACH,IAAA,iBAAG,GAAE,CAAC,KAAK,CACT,kBAAkB,SAAS,CAAC,QAAQ,EAAE,SAAS,SAAS,CAAC,QAAQ,EAAE,EAAE,CACtE,CAAC;IACF,MAAM,IAAA,kCAAoB,EACxB,GAAG,EACH,qBAAqB,EACrB,GAAG,CAAC,IAAI,EACR,kBAAkB,CACnB,CAAC;IACF,IAAA,iBAAG,GAAE,CAAC,KAAK,CAAC,mBAAmB,GAAG,CAAC,IAAI,YAAY,CAAC,CAAC;IACrD,OAAO,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;AAC7B,CAAC;AArCD,kCAqCC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osaas/client-transcode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "Open Source Cloud Client SDK transcode library",
|
|
5
5
|
"author": "Eyevinn Open Source Cloud <osc@eyevinn.se>",
|
|
6
6
|
"homepage": "https://www.osaas.io",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@osaas/client-core": "^0.20.0",
|
|
29
|
-
"@osaas/client-db": "^0.6.
|
|
30
|
-
"@osaas/client-services": "^0.
|
|
29
|
+
"@osaas/client-db": "^0.6.7",
|
|
30
|
+
"@osaas/client-services": "^0.13.0",
|
|
31
31
|
"chalk": "4.1.2",
|
|
32
32
|
"minio": "^8.0.2"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "2369b3b9c49b39b89ce2d8142510f0879af97b69"
|
|
38
38
|
}
|