@osaas/client-transcode 0.2.0 → 0.3.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/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/vmaf.d.ts +4 -0
- package/lib/vmaf.d.ts.map +1 -0
- package/lib/vmaf.js +30 -0
- package/lib/vmaf.js.map +1 -0
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.QueuePool = void 0;
|
|
3
|
+
exports.vmafCompare = exports.QueuePool = void 0;
|
|
4
4
|
var pool_1 = require("./pool");
|
|
5
5
|
Object.defineProperty(exports, "QueuePool", { enumerable: true, get: function () { return pool_1.QueuePool; } });
|
|
6
|
+
var vmaf_1 = require("./vmaf");
|
|
7
|
+
Object.defineProperty(exports, "vmafCompare", { enumerable: true, get: function () { return vmaf_1.vmafCompare; } });
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,+BAAmC;AAA1B,iGAAA,SAAS,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,+BAAmC;AAA1B,iGAAA,SAAS,OAAA;AAClB,+BAAqC;AAA5B,mGAAA,WAAW,OAAA"}
|
package/lib/vmaf.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vmaf.d.ts","sourceRoot":"","sources":["../src/vmaf.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,OAAO,EAIR,MAAM,oBAAoB,CAAC;AAG5B,wBAAsB,WAAW,CAC/B,GAAG,EAAE,OAAO,EACZ,SAAS,EAAE,GAAG,EACd,SAAS,EAAE,GAAG,EACd,YAAY,EAAE,GAAG,GAChB,OAAO,CAAC,GAAG,CAAC,CA6Bd"}
|
package/lib/vmaf.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.vmafCompare = void 0;
|
|
7
|
+
const client_core_1 = require("@osaas/client-core");
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
async function vmafCompare(ctx, reference, distorted, resultBucket) {
|
|
10
|
+
const serviceAccessToken = await ctx.getServiceAccessToken('eyevinn-easyvmaf-s3');
|
|
11
|
+
const jobId = Math.random().toString(36).substring(7);
|
|
12
|
+
const resultFile = `${resultBucket
|
|
13
|
+
.toString()
|
|
14
|
+
.replace(/\/$/, '')}/${node_path_1.default.basename(distorted.pathname)}_${jobId}.json`;
|
|
15
|
+
if (!process.env.AWS_ACCESS_KEY_ID || !process.env.AWS_SECRET_ACCESS_KEY) {
|
|
16
|
+
throw new Error('AWS credentials not set');
|
|
17
|
+
}
|
|
18
|
+
const job = await (0, client_core_1.createJob)(ctx, 'eyevinn-easyvmaf-s3', serviceAccessToken, {
|
|
19
|
+
name: jobId,
|
|
20
|
+
awsAccessKeyId: process.env.AWS_ACCESS_KEY_ID,
|
|
21
|
+
awsSecretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
|
|
22
|
+
cmdLineArgs: `-r ${reference.toString()} -d ${distorted.toString()} -o ${resultFile}`
|
|
23
|
+
});
|
|
24
|
+
(0, client_core_1.Log)().debug(`Comparing file ${reference.toString()} with ${reference.toString()}`);
|
|
25
|
+
await (0, client_core_1.waitForJobToComplete)(ctx, 'eyevinn-easyvmaf-s3', job.name, serviceAccessToken);
|
|
26
|
+
(0, client_core_1.Log)().debug(`VMAF comparison ${job.name} completed`);
|
|
27
|
+
return new URL(resultFile);
|
|
28
|
+
}
|
|
29
|
+
exports.vmafCompare = vmafCompare;
|
|
30
|
+
//# sourceMappingURL=vmaf.js.map
|
package/lib/vmaf.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vmaf.js","sourceRoot":"","sources":["../src/vmaf.ts"],"names":[],"mappings":";;;;;;AAAA,oDAK4B;AAC5B,0DAA6B;AAEtB,KAAK,UAAU,WAAW,CAC/B,GAAY,EACZ,SAAc,EACd,SAAc,EACd,YAAiB;IAEjB,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,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE;QACxE,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,OAAO,CAAC,GAAG,CAAC,iBAAiB;QAC7C,kBAAkB,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB;QACrD,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;AAlCD,kCAkCC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osaas/client-transcode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Open Source Cloud Client SDK transcode library",
|
|
5
5
|
"author": "Eyevinn Technology <work@eyevinn.se>",
|
|
6
6
|
"homepage": "https://www.osaas.io",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "b4832cc5efef3522a8797ee20b49a77c4f8384a9"
|
|
36
36
|
}
|