@osaas/cli 0.3.0 → 0.5.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/dist/cli.js +4 -0
- package/dist/cli.js.map +1 -1
- package/dist/packager/cmd.d.ts +3 -0
- package/dist/packager/cmd.d.ts.map +1 -0
- package/dist/packager/cmd.js +28 -0
- package/dist/packager/cmd.js.map +1 -0
- package/dist/vmaf/cmd.d.ts +3 -0
- package/dist/vmaf/cmd.d.ts.map +1 -0
- package/dist/vmaf/cmd.js +29 -0
- package/dist/vmaf/cmd.js.map +1 -0
- package/package.json +4 -4
- package/readme.md +19 -0
- package/src/cli.ts +4 -0
- package/src/packager/cmd.ts +33 -0
- package/src/vmaf/cmd.ts +40 -0
package/dist/cli.js
CHANGED
|
@@ -31,6 +31,8 @@ const commander_1 = require("commander");
|
|
|
31
31
|
const cmd_1 = __importDefault(require("./admin/cmd"));
|
|
32
32
|
const cmdUser = __importStar(require("./user/cmd"));
|
|
33
33
|
const cmd_2 = __importDefault(require("./transcode/cmd"));
|
|
34
|
+
const cmd_3 = __importDefault(require("./vmaf/cmd"));
|
|
35
|
+
const cmd_4 = __importDefault(require("./packager/cmd"));
|
|
34
36
|
const cli = new commander_1.Command();
|
|
35
37
|
cli
|
|
36
38
|
.configureHelp({ showGlobalOptions: true })
|
|
@@ -40,5 +42,7 @@ cli.addCommand(cmdUser.cmdList());
|
|
|
40
42
|
cli.addCommand(cmdUser.cmdCreate());
|
|
41
43
|
cli.addCommand(cmdUser.cmdRemove());
|
|
42
44
|
cli.addCommand((0, cmd_2.default)());
|
|
45
|
+
cli.addCommand((0, cmd_4.default)());
|
|
46
|
+
cli.addCommand((0, cmd_3.default)());
|
|
43
47
|
cli.parse(process.argv);
|
|
44
48
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,yCAAoC;AACpC,sDAAmC;AACnC,oDAAsC;AACtC,0DAA2C;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,yCAAoC;AACpC,sDAAmC;AACnC,oDAAsC;AACtC,0DAA2C;AAC3C,qDAAoC;AACpC,yDAAyC;AAEzC,MAAM,GAAG,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE1B,GAAG;KACA,aAAa,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC;KAC1C,MAAM,CAAC,qBAAqB,EAAE,oBAAoB,CAAC,CAAC;AACvD,GAAG,CAAC,UAAU,CAAC,IAAA,aAAQ,GAAE,CAAC,CAAC;AAC3B,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;AAClC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;AACpC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;AACpC,GAAG,CAAC,UAAU,CAAC,IAAA,aAAY,GAAE,CAAC,CAAC;AAC/B,GAAG,CAAC,UAAU,CAAC,IAAA,aAAW,GAAE,CAAC,CAAC;AAC9B,GAAG,CAAC,UAAU,CAAC,IAAA,aAAU,GAAE,CAAC,CAAC;AAC7B,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cmd.d.ts","sourceRoot":"","sources":["../../src/packager/cmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,CAAC,OAAO,UAAU,WAAW,YA4BlC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const client_core_1 = require("@osaas/client-core");
|
|
4
|
+
const client_transcode_1 = require("@osaas/client-transcode");
|
|
5
|
+
const commander_1 = require("commander");
|
|
6
|
+
function cmdPackager() {
|
|
7
|
+
const packager = new commander_1.Command('packager');
|
|
8
|
+
packager
|
|
9
|
+
.description('Create streaming package from ABR bundle on S3 and store on another S3 bucket')
|
|
10
|
+
.argument('<source>', 'Source Bucket URL (supported protocols: s3)')
|
|
11
|
+
.argument('<dest>', 'Destination URL (supported protocols: s3)')
|
|
12
|
+
.option('-v, --videos <videos...>', 'List of video files')
|
|
13
|
+
.option('-a, --audio <audio>', 'Audio file')
|
|
14
|
+
.action(async (source, dest, options, command) => {
|
|
15
|
+
try {
|
|
16
|
+
const globalOpts = command.optsWithGlobals();
|
|
17
|
+
const environment = globalOpts?.env || 'prod';
|
|
18
|
+
const ctx = new client_core_1.Context({ environment });
|
|
19
|
+
await (0, client_transcode_1.createStreamingPackage)(ctx, new URL(source), options.videos, options.audio, new URL(dest));
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
console.log(err.message);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return packager;
|
|
26
|
+
}
|
|
27
|
+
exports.default = cmdPackager;
|
|
28
|
+
//# sourceMappingURL=cmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cmd.js","sourceRoot":"","sources":["../../src/packager/cmd.ts"],"names":[],"mappings":";;AAAA,oDAA6C;AAC7C,8DAAiE;AACjE,yCAAoC;AAEpC,SAAwB,WAAW;IACjC,MAAM,QAAQ,GAAG,IAAI,mBAAO,CAAC,UAAU,CAAC,CAAC;IAEzC,QAAQ;SACL,WAAW,CACV,+EAA+E,CAChF;SACA,QAAQ,CAAC,UAAU,EAAE,6CAA6C,CAAC;SACnE,QAAQ,CAAC,QAAQ,EAAE,2CAA2C,CAAC;SAC/D,MAAM,CAAC,0BAA0B,EAAE,qBAAqB,CAAC;SACzD,MAAM,CAAC,qBAAqB,EAAE,YAAY,CAAC;SAC3C,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;QAC/C,IAAI;YACF,MAAM,UAAU,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;YAC7C,MAAM,WAAW,GAAG,UAAU,EAAE,GAAG,IAAI,MAAM,CAAC;YAC9C,MAAM,GAAG,GAAG,IAAI,qBAAO,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC;YACzC,MAAM,IAAA,yCAAsB,EAC1B,GAAG,EACH,IAAI,GAAG,CAAC,MAAM,CAAC,EACf,OAAO,CAAC,MAAM,EACd,OAAO,CAAC,KAAK,EACb,IAAI,GAAG,CAAC,IAAI,CAAC,CACd,CAAC;SACH;QAAC,OAAO,GAAG,EAAE;YACZ,OAAO,CAAC,GAAG,CAAE,GAAa,CAAC,OAAO,CAAC,CAAC;SACrC;IACH,CAAC,CAAC,CAAC;IACL,OAAO,QAAQ,CAAC;AAClB,CAAC;AA5BD,8BA4BC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cmd.d.ts","sourceRoot":"","sources":["../../src/vmaf/cmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,CAAC,OAAO,UAAU,UAAU,YAmCjC"}
|
package/dist/vmaf/cmd.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const client_core_1 = require("@osaas/client-core");
|
|
4
|
+
const client_transcode_1 = require("@osaas/client-transcode");
|
|
5
|
+
const commander_1 = require("commander");
|
|
6
|
+
function cmdCompare() {
|
|
7
|
+
const compare = new commander_1.Command('compare');
|
|
8
|
+
compare
|
|
9
|
+
.command('vmaf')
|
|
10
|
+
.description('Compare two video files using VMAF')
|
|
11
|
+
.argument('<reference>', 'URL to reference video file (supported protocols: s3)')
|
|
12
|
+
.argument('<distorted>', 'URL to distorted video file (supported protocols: s3)')
|
|
13
|
+
.argument('<result>', 'URL where to store the result (supported protocols: s3)')
|
|
14
|
+
.action(async (reference, distorted, result, options, command) => {
|
|
15
|
+
try {
|
|
16
|
+
const globalOpts = command.optsWithGlobals();
|
|
17
|
+
const environment = globalOpts?.env || 'prod';
|
|
18
|
+
const ctx = new client_core_1.Context({ environment });
|
|
19
|
+
const resultUrl = await (0, client_transcode_1.vmafCompare)(ctx, new URL(reference), new URL(distorted), new URL(result));
|
|
20
|
+
(0, client_core_1.Log)().info(`VMAF comparison result stored at ${resultUrl.toString()}`);
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
console.log(err.message);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return compare;
|
|
27
|
+
}
|
|
28
|
+
exports.default = cmdCompare;
|
|
29
|
+
//# sourceMappingURL=cmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cmd.js","sourceRoot":"","sources":["../../src/vmaf/cmd.ts"],"names":[],"mappings":";;AAAA,oDAAkD;AAClD,8DAAsD;AACtD,yCAAoC;AAEpC,SAAwB,UAAU;IAChC,MAAM,OAAO,GAAG,IAAI,mBAAO,CAAC,SAAS,CAAC,CAAC;IAEvC,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,oCAAoC,CAAC;SACjD,QAAQ,CACP,aAAa,EACb,uDAAuD,CACxD;SACA,QAAQ,CACP,aAAa,EACb,uDAAuD,CACxD;SACA,QAAQ,CACP,UAAU,EACV,yDAAyD,CAC1D;SACA,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;QAC/D,IAAI;YACF,MAAM,UAAU,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;YAC7C,MAAM,WAAW,GAAG,UAAU,EAAE,GAAG,IAAI,MAAM,CAAC;YAC9C,MAAM,GAAG,GAAG,IAAI,qBAAO,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC;YACzC,MAAM,SAAS,GAAG,MAAM,IAAA,8BAAW,EACjC,GAAG,EACH,IAAI,GAAG,CAAC,SAAS,CAAC,EAClB,IAAI,GAAG,CAAC,SAAS,CAAC,EAClB,IAAI,GAAG,CAAC,MAAM,CAAC,CAChB,CAAC;YACF,IAAA,iBAAG,GAAE,CAAC,IAAI,CAAC,oCAAoC,SAAS,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;SACxE;QAAC,OAAO,GAAG,EAAE;YACZ,OAAO,CAAC,GAAG,CAAE,GAAa,CAAC,OAAO,CAAC,CAAC;SACrC;IACH,CAAC,CAAC,CAAC;IACL,OAAO,OAAO,CAAC;AACjB,CAAC;AAnCD,6BAmCC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osaas/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Open Source Cloud CLI",
|
|
5
5
|
"author": "Eyevinn Technology <work@eyevinn.se>",
|
|
6
6
|
"homepage": "https://www.osaas.io",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"test": "jest --pass-with-no-tests"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@osaas/client-core": "^0.5.
|
|
25
|
-
"@osaas/client-transcode": "^0.
|
|
24
|
+
"@osaas/client-core": "^0.5.1",
|
|
25
|
+
"@osaas/client-transcode": "^0.4.0",
|
|
26
26
|
"chalk": "4.1.2",
|
|
27
27
|
"commander": "^12.1.0",
|
|
28
28
|
"fast-jwt": "^4.0.1"
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "1cd9bcf9e53033687345cbffa58d61853ade3a1f"
|
|
34
34
|
}
|
package/readme.md
CHANGED
|
@@ -28,7 +28,10 @@ Commands:
|
|
|
28
28
|
list <serviceId> List all my service instances
|
|
29
29
|
create [options] <serviceId> <name> Create a service instance
|
|
30
30
|
remove <serviceId> <name> Remove a service instance
|
|
31
|
+
transcode [options] <source> <dest> Transcode file to ABR fileset and store on S3 bucket
|
|
32
|
+
compare
|
|
31
33
|
help [command] display help for command
|
|
34
|
+
|
|
32
35
|
```
|
|
33
36
|
|
|
34
37
|
To display help for subcommand `admin` you enter
|
|
@@ -74,6 +77,22 @@ Commands:
|
|
|
74
77
|
% osc remove channel-engine clidemo
|
|
75
78
|
```
|
|
76
79
|
|
|
80
|
+
### Create ABR files for VOD using SVT Encore
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
osc transcode \
|
|
84
|
+
https://testcontent.eyevinn.technology/mp4/stswe-tvplus-promo.mp4 \
|
|
85
|
+
s3://lab-testcontent-store/birme/
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Compare two video files using VMAF
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
% osc compare vmaf s3://lab-testcontent-store/birme/snaxax_x264_3100.mp4 \
|
|
92
|
+
s3://lab-testcontent-store/birme/snaxax_x264_324.mp4 \
|
|
93
|
+
s3://lab-testcontent-store/birme/
|
|
94
|
+
```
|
|
95
|
+
|
|
77
96
|
### List all channel-engine instance for tenant `eyevinn` as an OSC super admin
|
|
78
97
|
|
|
79
98
|
```
|
package/src/cli.ts
CHANGED
|
@@ -4,6 +4,8 @@ import { Command } from 'commander';
|
|
|
4
4
|
import cmdAdmin from './admin/cmd';
|
|
5
5
|
import * as cmdUser from './user/cmd';
|
|
6
6
|
import cmdTranscode from './transcode/cmd';
|
|
7
|
+
import cmdCompare from './vmaf/cmd';
|
|
8
|
+
import cmdPackager from './packager/cmd';
|
|
7
9
|
|
|
8
10
|
const cli = new Command();
|
|
9
11
|
|
|
@@ -15,4 +17,6 @@ cli.addCommand(cmdUser.cmdList());
|
|
|
15
17
|
cli.addCommand(cmdUser.cmdCreate());
|
|
16
18
|
cli.addCommand(cmdUser.cmdRemove());
|
|
17
19
|
cli.addCommand(cmdTranscode());
|
|
20
|
+
cli.addCommand(cmdPackager());
|
|
21
|
+
cli.addCommand(cmdCompare());
|
|
18
22
|
cli.parse(process.argv);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Context } from '@osaas/client-core';
|
|
2
|
+
import { createStreamingPackage } from '@osaas/client-transcode';
|
|
3
|
+
import { Command } from 'commander';
|
|
4
|
+
|
|
5
|
+
export default function cmdPackager() {
|
|
6
|
+
const packager = new Command('packager');
|
|
7
|
+
|
|
8
|
+
packager
|
|
9
|
+
.description(
|
|
10
|
+
'Create streaming package from ABR bundle on S3 and store on another S3 bucket'
|
|
11
|
+
)
|
|
12
|
+
.argument('<source>', 'Source Bucket URL (supported protocols: s3)')
|
|
13
|
+
.argument('<dest>', 'Destination URL (supported protocols: s3)')
|
|
14
|
+
.option('-v, --videos <videos...>', 'List of video files')
|
|
15
|
+
.option('-a, --audio <audio>', 'Audio file')
|
|
16
|
+
.action(async (source, dest, options, command) => {
|
|
17
|
+
try {
|
|
18
|
+
const globalOpts = command.optsWithGlobals();
|
|
19
|
+
const environment = globalOpts?.env || 'prod';
|
|
20
|
+
const ctx = new Context({ environment });
|
|
21
|
+
await createStreamingPackage(
|
|
22
|
+
ctx,
|
|
23
|
+
new URL(source),
|
|
24
|
+
options.videos,
|
|
25
|
+
options.audio,
|
|
26
|
+
new URL(dest)
|
|
27
|
+
);
|
|
28
|
+
} catch (err) {
|
|
29
|
+
console.log((err as Error).message);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return packager;
|
|
33
|
+
}
|
package/src/vmaf/cmd.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Context, Log } from '@osaas/client-core';
|
|
2
|
+
import { vmafCompare } from '@osaas/client-transcode';
|
|
3
|
+
import { Command } from 'commander';
|
|
4
|
+
|
|
5
|
+
export default function cmdCompare() {
|
|
6
|
+
const compare = new Command('compare');
|
|
7
|
+
|
|
8
|
+
compare
|
|
9
|
+
.command('vmaf')
|
|
10
|
+
.description('Compare two video files using VMAF')
|
|
11
|
+
.argument(
|
|
12
|
+
'<reference>',
|
|
13
|
+
'URL to reference video file (supported protocols: s3)'
|
|
14
|
+
)
|
|
15
|
+
.argument(
|
|
16
|
+
'<distorted>',
|
|
17
|
+
'URL to distorted video file (supported protocols: s3)'
|
|
18
|
+
)
|
|
19
|
+
.argument(
|
|
20
|
+
'<result>',
|
|
21
|
+
'URL where to store the result (supported protocols: s3)'
|
|
22
|
+
)
|
|
23
|
+
.action(async (reference, distorted, result, options, command) => {
|
|
24
|
+
try {
|
|
25
|
+
const globalOpts = command.optsWithGlobals();
|
|
26
|
+
const environment = globalOpts?.env || 'prod';
|
|
27
|
+
const ctx = new Context({ environment });
|
|
28
|
+
const resultUrl = await vmafCompare(
|
|
29
|
+
ctx,
|
|
30
|
+
new URL(reference),
|
|
31
|
+
new URL(distorted),
|
|
32
|
+
new URL(result)
|
|
33
|
+
);
|
|
34
|
+
Log().info(`VMAF comparison result stored at ${resultUrl.toString()}`);
|
|
35
|
+
} catch (err) {
|
|
36
|
+
console.log((err as Error).message);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
return compare;
|
|
40
|
+
}
|