@amplitude/rrvideo 2.0.0-alpha.12
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/README.md +38 -0
- package/README.zh_CN.md +36 -0
- package/build/cli.d.ts +2 -0
- package/build/cli.js +68 -0
- package/build/cli.js.map +1 -0
- package/build/index.d.ts +11 -0
- package/build/index.js +177 -0
- package/build/index.js.map +1 -0
- package/package.json +38 -0
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# rrvideo
|
|
2
|
+
|
|
3
|
+
[中文文档](./README.zh_CN.md)
|
|
4
|
+
|
|
5
|
+
rrvideo is a tool for transforming the session recorded by [rrweb](https://github.com/rrweb-io/rrweb) into a video.
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
## Install rrvideo
|
|
10
|
+
|
|
11
|
+
1. Install [Node.JS](https://nodejs.org/en/download/)。
|
|
12
|
+
2. Run `npm i -g rrvideo` to install the rrvideo CLI.
|
|
13
|
+
|
|
14
|
+
## Use rrvideo
|
|
15
|
+
|
|
16
|
+
### Transform a rrweb session(in JSON format) into a video.
|
|
17
|
+
|
|
18
|
+
```shell
|
|
19
|
+
rrvideo --input PATH_TO_YOUR_RRWEB_EVENTS_FILE
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Running this command will output a `rrvideo-output.webm` file in the current working directory.
|
|
23
|
+
|
|
24
|
+
### Config the output path
|
|
25
|
+
|
|
26
|
+
```shell
|
|
27
|
+
rrvideo --input PATH_TO_YOUR_RRWEB_EVENTS_FILE --output OUTPUT_PATH
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Config the replay
|
|
31
|
+
|
|
32
|
+
You can prepare a rrvideo config file and pass it to CLI.
|
|
33
|
+
|
|
34
|
+
```shell
|
|
35
|
+
rrvideo --input PATH_TO_YOUR_RRWEB_EVENTS_JSON_FILE --config PATH_TO_YOUR_RRVIDEO_CONFIG_FILE
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
You can find an example of the rrvideo config file [here](./rrvideo.config.example.json).
|
package/README.zh_CN.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# rrvideo
|
|
2
|
+
|
|
3
|
+
rrvideo 是用于将 [rrweb](https://github.com/rrweb-io/rrweb) 录制的数据转为视频格式的工具。
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## 安装 rrvideo
|
|
8
|
+
|
|
9
|
+
1. 安装 [Node.JS](https://nodejs.org/en/download/)。
|
|
10
|
+
2. 执行 `npm i -g rrvideo` 以安装 rrvideo CLI。
|
|
11
|
+
|
|
12
|
+
## 使用 rrvideo
|
|
13
|
+
|
|
14
|
+
### 将一份 rrweb 录制的数据(JSON 格式)转换为视频。
|
|
15
|
+
|
|
16
|
+
```shell
|
|
17
|
+
rrvideo --input PATH_TO_YOUR_RRWEB_EVENTS_FILE
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
运行以上命令会在执行文件夹中生成一个 `rrvideo-output.webm` 文件。
|
|
21
|
+
|
|
22
|
+
### 指定输出路径
|
|
23
|
+
|
|
24
|
+
```shell
|
|
25
|
+
rrvideo --input PATH_TO_YOUR_RRWEB_EVENTS_FILE --output OUTPUT_PATH
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### 对回放进行配置
|
|
29
|
+
|
|
30
|
+
通过编写一个 rrvideo 配置文件再传入 rrvideo CLI 的方式可以对回放进行一定的配置。
|
|
31
|
+
|
|
32
|
+
```shell
|
|
33
|
+
rrvideo --input PATH_TO_YOUR_RRWEB_EVENTS_JSON_FILE --config PATH_TO_YOUR_RRVIDEO_CONFIG_FILE
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
rrvideo 配置文件可参考[示例](./rrvideo.config.example.json)。
|
package/build/cli.d.ts
ADDED
package/build/cli.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
const cli_progress_bar_1 = require("@open-tech-world/cli-progress-bar");
|
|
31
|
+
const fs = __importStar(require("fs"));
|
|
32
|
+
const minimist_1 = __importDefault(require("minimist"));
|
|
33
|
+
const path = __importStar(require("path"));
|
|
34
|
+
const index_1 = require("./index");
|
|
35
|
+
const argv = (0, minimist_1.default)(process.argv.slice(2));
|
|
36
|
+
if (!argv.input) {
|
|
37
|
+
throw new Error('please pass --input to your rrweb events file');
|
|
38
|
+
}
|
|
39
|
+
let config = {};
|
|
40
|
+
if (argv.config) {
|
|
41
|
+
const configPathStr = argv.config;
|
|
42
|
+
const configPath = path.isAbsolute(configPathStr)
|
|
43
|
+
? configPathStr
|
|
44
|
+
: path.resolve(process.cwd(), configPathStr);
|
|
45
|
+
config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
46
|
+
}
|
|
47
|
+
const pBar = new cli_progress_bar_1.ProgressBar({ prefix: 'Transforming' });
|
|
48
|
+
const onProgressUpdate = (percent) => {
|
|
49
|
+
if (percent < 1)
|
|
50
|
+
pBar.run({ value: percent * 100, total: 100 });
|
|
51
|
+
else
|
|
52
|
+
pBar.run({ value: 100, total: 100, prefix: 'Transformation Completed!' });
|
|
53
|
+
};
|
|
54
|
+
(0, index_1.transformToVideo)({
|
|
55
|
+
input: argv.input,
|
|
56
|
+
output: argv.output,
|
|
57
|
+
rrwebPlayer: config,
|
|
58
|
+
onProgressUpdate,
|
|
59
|
+
})
|
|
60
|
+
.then((file) => {
|
|
61
|
+
console.log(`Successfully transformed into "${file}".`);
|
|
62
|
+
})
|
|
63
|
+
.catch((error) => {
|
|
64
|
+
console.log('Failed to transform this session.');
|
|
65
|
+
console.error(error);
|
|
66
|
+
process.exit(1);
|
|
67
|
+
});
|
|
68
|
+
//# sourceMappingURL=cli.js.map
|
package/build/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wEAAgE;AAChE,uCAAyB;AACzB,wDAAgC;AAChC,2CAA6B;AAC7B,mCAA2C;AAE3C,MAAM,IAAI,GAAG,IAAA,kBAAQ,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAE7C,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;IACf,MAAM,IAAI,KAAK,CAAC,+CAA+C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AAC,KAAK,CAAC,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RRwebPlayerOptions } from '@amplitude/rrweb-player';
|
|
2
|
+
type RRvideoConfig = {
|
|
3
|
+
input: string;
|
|
4
|
+
output?: string;
|
|
5
|
+
headless?: boolean;
|
|
6
|
+
resolutionRatio?: number;
|
|
7
|
+
onProgressUpdate?: (percent: number) => void;
|
|
8
|
+
rrwebPlayer?: Omit<RRwebPlayerOptions['props'], 'events'>;
|
|
9
|
+
};
|
|
10
|
+
export declare function transformToVideo(options: RRvideoConfig): Promise<string>;
|
|
11
|
+
export {};
|
package/build/index.js
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
exports.transformToVideo = void 0;
|
|
36
|
+
const rrweb_types_1 = require("@amplitude/rrweb-types");
|
|
37
|
+
const fs = __importStar(require("fs-extra"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const playwright_1 = require("playwright");
|
|
40
|
+
const rrwebScriptPath = path.resolve(require.resolve('@amplitude/rrweb-player'), '../../dist/index.js');
|
|
41
|
+
const rrwebStylePath = path.resolve(rrwebScriptPath, '../style.css');
|
|
42
|
+
const rrwebRaw = fs.readFileSync(rrwebScriptPath, 'utf-8');
|
|
43
|
+
const rrwebStyle = fs.readFileSync(rrwebStylePath, 'utf-8');
|
|
44
|
+
// The max valid scale value for the scaling method which can improve the video quality.
|
|
45
|
+
const MaxScaleValue = 2.5;
|
|
46
|
+
const defaultConfig = {
|
|
47
|
+
input: '',
|
|
48
|
+
output: 'rrvideo-output.webm',
|
|
49
|
+
headless: true,
|
|
50
|
+
// A good trade-off value between quality and file size.
|
|
51
|
+
resolutionRatio: 0.8,
|
|
52
|
+
onProgressUpdate: () => {
|
|
53
|
+
//
|
|
54
|
+
},
|
|
55
|
+
rrwebPlayer: {},
|
|
56
|
+
};
|
|
57
|
+
function getHtml(events, config) {
|
|
58
|
+
var _a;
|
|
59
|
+
return `
|
|
60
|
+
<html>
|
|
61
|
+
<head>
|
|
62
|
+
<style>${rrwebStyle}</style>
|
|
63
|
+
<style>html, body {padding: 0; border: none; margin: 0;}</style>
|
|
64
|
+
</head>
|
|
65
|
+
<body>
|
|
66
|
+
<script>
|
|
67
|
+
${rrwebRaw};
|
|
68
|
+
/*<!--*/
|
|
69
|
+
const events = ${JSON.stringify(events).replace(/<\/script>/g, '<\\/script>')};
|
|
70
|
+
/*-->*/
|
|
71
|
+
const userConfig = ${JSON.stringify((config === null || config === void 0 ? void 0 : config.rrwebPlayer) || {})};
|
|
72
|
+
window.replayer = new rrwebPlayer({
|
|
73
|
+
target: document.body,
|
|
74
|
+
width: userConfig.width,
|
|
75
|
+
height: userConfig.height,
|
|
76
|
+
props: {
|
|
77
|
+
...userConfig,
|
|
78
|
+
events,
|
|
79
|
+
showController: false,
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
window.replayer.addEventListener('finish', () => window.onReplayFinish());
|
|
83
|
+
window.replayer.addEventListener('ui-update-progress', (payload)=> window.onReplayProgressUpdate
|
|
84
|
+
(payload));
|
|
85
|
+
window.replayer.addEventListener('resize',()=>document.querySelector('.replayer-wrapper').style.transform = 'scale(${((_a = config === null || config === void 0 ? void 0 : config.resolutionRatio) !== null && _a !== void 0 ? _a : 1) * MaxScaleValue}) translate(-50%, -50%)');
|
|
86
|
+
</script>
|
|
87
|
+
</body>
|
|
88
|
+
</html>
|
|
89
|
+
`;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Preprocess all events to get a maximum view port size.
|
|
93
|
+
*/
|
|
94
|
+
function getMaxViewport(events) {
|
|
95
|
+
let maxWidth = 0, maxHeight = 0;
|
|
96
|
+
events.forEach((event) => {
|
|
97
|
+
if (event.type !== rrweb_types_1.EventType.Meta)
|
|
98
|
+
return;
|
|
99
|
+
if (event.data.width > maxWidth)
|
|
100
|
+
maxWidth = event.data.width;
|
|
101
|
+
if (event.data.height > maxHeight)
|
|
102
|
+
maxHeight = event.data.height;
|
|
103
|
+
});
|
|
104
|
+
return {
|
|
105
|
+
width: maxWidth,
|
|
106
|
+
height: maxHeight,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function transformToVideo(options) {
|
|
110
|
+
var _a, _b, _c;
|
|
111
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
112
|
+
const defaultVideoDir = '__rrvideo__temp__';
|
|
113
|
+
const config = Object.assign({}, defaultConfig);
|
|
114
|
+
if (!options.input)
|
|
115
|
+
throw new Error('input is required');
|
|
116
|
+
// If the output is not specified or undefined, use the default value.
|
|
117
|
+
if (!options.output)
|
|
118
|
+
delete options.output;
|
|
119
|
+
Object.assign(config, options);
|
|
120
|
+
if (config.resolutionRatio > 1)
|
|
121
|
+
config.resolutionRatio = 1; // The max value is 1.
|
|
122
|
+
const eventsPath = path.isAbsolute(config.input)
|
|
123
|
+
? config.input
|
|
124
|
+
: path.resolve(process.cwd(), config.input);
|
|
125
|
+
const outputPath = path.isAbsolute(config.output)
|
|
126
|
+
? config.output
|
|
127
|
+
: path.resolve(process.cwd(), config.output);
|
|
128
|
+
const events = JSON.parse(fs.readFileSync(eventsPath, 'utf-8'));
|
|
129
|
+
// Make the browser viewport fit the player size.
|
|
130
|
+
const maxViewport = getMaxViewport(events);
|
|
131
|
+
// Use the scaling method to improve the video quality.
|
|
132
|
+
const scaledViewport = {
|
|
133
|
+
width: Math.round(maxViewport.width * ((_a = config.resolutionRatio) !== null && _a !== void 0 ? _a : 1) * MaxScaleValue),
|
|
134
|
+
height: Math.round(maxViewport.height * ((_b = config.resolutionRatio) !== null && _b !== void 0 ? _b : 1) * MaxScaleValue),
|
|
135
|
+
};
|
|
136
|
+
Object.assign(config.rrwebPlayer, scaledViewport);
|
|
137
|
+
const browser = yield playwright_1.chromium.launch({
|
|
138
|
+
headless: config.headless,
|
|
139
|
+
});
|
|
140
|
+
const context = yield browser.newContext({
|
|
141
|
+
viewport: scaledViewport,
|
|
142
|
+
recordVideo: {
|
|
143
|
+
dir: defaultVideoDir,
|
|
144
|
+
size: scaledViewport,
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
const page = yield context.newPage();
|
|
148
|
+
yield page.goto('about:blank');
|
|
149
|
+
yield page.exposeFunction('onReplayProgressUpdate', (data) => {
|
|
150
|
+
config.onProgressUpdate(data.payload);
|
|
151
|
+
});
|
|
152
|
+
// Wait for the replay to finish
|
|
153
|
+
yield new Promise((resolve) => void page
|
|
154
|
+
.exposeFunction('onReplayFinish', () => resolve())
|
|
155
|
+
.then(() => page.setContent(getHtml(events, config))));
|
|
156
|
+
const videoPath = (yield ((_c = page.video()) === null || _c === void 0 ? void 0 : _c.path())) || '';
|
|
157
|
+
const cleanFiles = (videoPath) => __awaiter(this, void 0, void 0, function* () {
|
|
158
|
+
yield fs.remove(videoPath);
|
|
159
|
+
if ((yield fs.readdir(defaultVideoDir)).length === 0) {
|
|
160
|
+
yield fs.remove(defaultVideoDir);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
yield context.close();
|
|
164
|
+
yield Promise.all([
|
|
165
|
+
fs
|
|
166
|
+
.move(videoPath, outputPath, { overwrite: true })
|
|
167
|
+
.catch((e) => {
|
|
168
|
+
console.error("Can't create video file. Please check the output path.", e);
|
|
169
|
+
})
|
|
170
|
+
.finally(() => void cleanFiles(videoPath)),
|
|
171
|
+
browser.close(),
|
|
172
|
+
]);
|
|
173
|
+
return outputPath;
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
exports.transformToVideo = transformToVideo;
|
|
177
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,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description": "transform rrweb session into video",
|
|
5
|
+
"main": "build/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"rrvideo": "build/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"build"
|
|
11
|
+
],
|
|
12
|
+
"types": "build/index.d.ts",
|
|
13
|
+
"scripts": {
|
|
14
|
+
"install": "playwright install",
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"test": "jest",
|
|
17
|
+
"check-types": "tsc -noEmit",
|
|
18
|
+
"prepublish": "yarn build"
|
|
19
|
+
},
|
|
20
|
+
"author": "Amplitude Inc",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@amplitude/rrweb": "^2.0.0-alpha.12",
|
|
24
|
+
"@types/fs-extra": "11.0.1",
|
|
25
|
+
"@types/jest": "^27.4.1",
|
|
26
|
+
"@types/minimist": "^1.2.1",
|
|
27
|
+
"@types/node": "^18.15.11",
|
|
28
|
+
"jest": "^27.5.1",
|
|
29
|
+
"ts-jest": "^27.1.3"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@amplitude/rrweb-player": "^2.0.0-alpha.12",
|
|
33
|
+
"@open-tech-world/cli-progress-bar": "^2.0.2",
|
|
34
|
+
"fs-extra": "^11.1.1",
|
|
35
|
+
"minimist": "^1.2.5",
|
|
36
|
+
"playwright": "^1.32.1"
|
|
37
|
+
}
|
|
38
|
+
}
|