polotno-node 2.9.31 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polotno-node",
3
- "version": "2.9.31",
3
+ "version": "2.9.32",
4
4
  "description": "Polotno workflow from NodeJS",
5
5
  "main": "index.js",
6
6
  "scripts": {
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 1000k',
32
- '-quality realtime',
33
- '-speed 4',
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.log('Error occurred: ' + err.message);
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: ' + mp4Destination);
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: ' + webmDestination);
68
+ console.log('Converting video finished: ' + filename);
71
69
  return {
72
70
  dataURL,
73
71
  file: webmDestination,