polotno-node 2.9.30 → 2.9.32
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/assets/index-BnTpuNs2.js +298 -0
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/video-parallel.js +7 -9
- package/dist/assets/index-CnIp_NfV.js +0 -289
package/dist/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
}
|
|
9
9
|
</style>
|
|
10
10
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
11
|
-
<script type="module" crossorigin src="./assets/index-
|
|
11
|
+
<script type="module" crossorigin src="./assets/index-BnTpuNs2.js"></script>
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
|
14
14
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polotno-node",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.32",
|
|
4
4
|
"description": "Polotno workflow from NodeJS",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"gifencoder": "^2.0.1",
|
|
27
27
|
"pixelmatch": "^6.0.0",
|
|
28
28
|
"pngjs": "^7.0.0",
|
|
29
|
-
"polotno": "^2.10.
|
|
29
|
+
"polotno": "^2.10.11",
|
|
30
30
|
"react": "^18.3.1",
|
|
31
31
|
"react-dom": "^18.3.1",
|
|
32
32
|
"vite": "^5.3.4"
|
package/video-parallel.js
CHANGED
|
@@ -26,20 +26,18 @@ const convertToWebM = (input, output) => {
|
|
|
26
26
|
return new Promise((resolve, reject) => {
|
|
27
27
|
ffmpeg(input)
|
|
28
28
|
.outputOptions([
|
|
29
|
-
'-c:v libvpx',
|
|
29
|
+
'-c:v libvpx-vp9',
|
|
30
30
|
'-crf 30',
|
|
31
|
-
'-b:v
|
|
32
|
-
'-
|
|
33
|
-
'-
|
|
34
|
-
'-threads 4',
|
|
31
|
+
'-b:v 0',
|
|
32
|
+
'-b:a 128k',
|
|
33
|
+
'-c:a libopus',
|
|
35
34
|
])
|
|
36
35
|
.output(output)
|
|
37
|
-
.on('start', () => {})
|
|
38
36
|
.on('end', () => {
|
|
39
37
|
resolve();
|
|
40
38
|
})
|
|
41
39
|
.on('error', (err) => {
|
|
42
|
-
console.
|
|
40
|
+
console.error('Error occurred: ' + err.message);
|
|
43
41
|
reject(err);
|
|
44
42
|
})
|
|
45
43
|
.run();
|
|
@@ -62,12 +60,12 @@ const convertVideo = async (url, tempFolder) => {
|
|
|
62
60
|
const filename = Math.random().toString(36).substring(7);
|
|
63
61
|
const mp4Destination = path.join(tempFolder.name, filename + '.mp4');
|
|
64
62
|
await downloadVideo(url, mp4Destination);
|
|
65
|
-
console.log('Converting video to webm: ' +
|
|
63
|
+
console.log('Converting video to webm: ' + filename);
|
|
66
64
|
const webmDestination = mp4Destination.replace('.mp4', '.webm');
|
|
67
65
|
await convertToWebM(mp4Destination, webmDestination);
|
|
68
66
|
const dataURL = await fileToDataUrl(webmDestination);
|
|
69
67
|
|
|
70
|
-
console.log('Converting video finished: ' +
|
|
68
|
+
console.log('Converting video finished: ' + filename);
|
|
71
69
|
return {
|
|
72
70
|
dataURL,
|
|
73
71
|
file: webmDestination,
|