@remotion/renderer 4.0.210 → 4.0.211

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
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/renderer"
4
4
  },
5
5
  "name": "@remotion/renderer",
6
- "version": "4.0.210",
6
+ "version": "4.0.211",
7
7
  "description": "Render Remotion videos using Node.js or Bun",
8
8
  "main": "dist/index.js",
9
9
  "types": "dist/index.d.ts",
@@ -18,8 +18,8 @@
18
18
  "extract-zip": "2.0.1",
19
19
  "source-map": "^0.8.0-beta.0",
20
20
  "ws": "8.17.1",
21
- "remotion": "4.0.210",
22
- "@remotion/streaming": "4.0.210"
21
+ "remotion": "4.0.211",
22
+ "@remotion/streaming": "4.0.211"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "react": ">=16.8.0",
@@ -34,13 +34,13 @@
34
34
  "@types/ws": "8.5.10"
35
35
  },
36
36
  "optionalDependencies": {
37
- "@remotion/compositor-darwin-arm64": "4.0.210",
38
- "@remotion/compositor-darwin-x64": "4.0.210",
39
- "@remotion/compositor-linux-arm64-gnu": "4.0.210",
40
- "@remotion/compositor-linux-arm64-musl": "4.0.210",
41
- "@remotion/compositor-win32-x64-msvc": "4.0.210",
42
- "@remotion/compositor-linux-x64-musl": "4.0.210",
43
- "@remotion/compositor-linux-x64-gnu": "4.0.210"
37
+ "@remotion/compositor-darwin-arm64": "4.0.211",
38
+ "@remotion/compositor-darwin-x64": "4.0.211",
39
+ "@remotion/compositor-linux-arm64-gnu": "4.0.211",
40
+ "@remotion/compositor-linux-x64-musl": "4.0.211",
41
+ "@remotion/compositor-linux-x64-gnu": "4.0.211",
42
+ "@remotion/compositor-linux-arm64-musl": "4.0.211",
43
+ "@remotion/compositor-win32-x64-msvc": "4.0.211"
44
44
  },
45
45
  "keywords": [
46
46
  "remotion",
@@ -1,11 +0,0 @@
1
- export declare const streamingKey = "remotion_buffer:";
2
- export declare const makeStreamer: (onMessage: (statusType: 'success' | 'error', nonce: string, data: Uint8Array) => void) => {
3
- onData: (data: Uint8Array) => void;
4
- getOutputBuffer: () => Uint8Array;
5
- clear: () => void;
6
- };
7
- export declare const makeStreamPayloadMessage: ({ status, body, nonce, }: {
8
- nonce: string;
9
- status: 0 | 1;
10
- body: Uint8Array;
11
- }) => Uint8Array;
package/dist/streaming.js DELETED
@@ -1,140 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeStreamPayloadMessage = exports.makeStreamer = exports.streamingKey = void 0;
4
- exports.streamingKey = 'remotion_buffer:';
5
- const magicWordStr = 'remotion_buffer:';
6
- const makeStreamer = (onMessage) => {
7
- const separator = new Uint8Array(magicWordStr.length);
8
- for (let i = 0; i < magicWordStr.length; i++) {
9
- separator[i] = magicWordStr.charCodeAt(i);
10
- }
11
- let unprocessedBuffers = [];
12
- let outputBuffer = new Uint8Array(0);
13
- let missingData = null;
14
- const processInput = () => {
15
- let separatorIndex = outputBuffer.indexOf(separator[0]); // Start checking for the first byte of the separator
16
- if (separatorIndex === -1 ||
17
- outputBuffer
18
- .subarray(separatorIndex, separatorIndex + separator.length)
19
- .toString() !== separator.toString()) {
20
- return;
21
- }
22
- separatorIndex += separator.length;
23
- let nonceString = '';
24
- let lengthString = '';
25
- let statusString = '';
26
- // eslint-disable-next-line no-constant-condition
27
- while (true) {
28
- if (separatorIndex > outputBuffer.length - 1) {
29
- return;
30
- }
31
- const nextDigit = outputBuffer[separatorIndex];
32
- separatorIndex++;
33
- if (nextDigit === 0x3a) {
34
- break;
35
- }
36
- nonceString += String.fromCharCode(nextDigit);
37
- }
38
- // eslint-disable-next-line no-constant-condition
39
- while (true) {
40
- if (separatorIndex > outputBuffer.length - 1) {
41
- return;
42
- }
43
- const nextDigit = outputBuffer[separatorIndex];
44
- separatorIndex++;
45
- if (nextDigit === 0x3a) {
46
- break;
47
- }
48
- lengthString += String.fromCharCode(nextDigit);
49
- }
50
- // eslint-disable-next-line no-constant-condition
51
- while (true) {
52
- if (separatorIndex > outputBuffer.length - 1) {
53
- return;
54
- }
55
- const nextDigit = outputBuffer[separatorIndex];
56
- if (nextDigit === 0x3a) {
57
- break;
58
- }
59
- separatorIndex++;
60
- statusString += String.fromCharCode(nextDigit);
61
- }
62
- const length = Number(lengthString);
63
- const status = Number(statusString);
64
- const dataLength = outputBuffer.length - separatorIndex - 1;
65
- if (dataLength < length) {
66
- missingData = {
67
- dataMissing: length - dataLength,
68
- };
69
- return;
70
- }
71
- const data = outputBuffer.subarray(separatorIndex + 1, separatorIndex + 1 + Number(lengthString));
72
- onMessage(status === 1 ? 'error' : 'success', nonceString, data);
73
- missingData = null;
74
- outputBuffer = outputBuffer.subarray(separatorIndex + Number(lengthString) + 1);
75
- processInput();
76
- };
77
- const onData = (data) => {
78
- unprocessedBuffers.push(data);
79
- const separatorIndex = data.indexOf(separator[0]);
80
- if (separatorIndex === -1) {
81
- if (missingData) {
82
- missingData.dataMissing -= data.length;
83
- }
84
- if (!missingData || missingData.dataMissing > 0) {
85
- return;
86
- }
87
- }
88
- unprocessedBuffers.unshift(outputBuffer);
89
- outputBuffer = new Uint8Array(unprocessedBuffers.reduce((acc, val) => acc + val.length, 0));
90
- let offset = 0;
91
- for (const buf of unprocessedBuffers) {
92
- outputBuffer.set(buf, offset);
93
- offset += buf.length;
94
- }
95
- unprocessedBuffers = [];
96
- processInput();
97
- };
98
- return {
99
- onData,
100
- getOutputBuffer: () => outputBuffer,
101
- clear: () => {
102
- unprocessedBuffers = [];
103
- outputBuffer = new Uint8Array(0);
104
- },
105
- };
106
- };
107
- exports.makeStreamer = makeStreamer;
108
- const makeStreamPayloadMessage = ({ status, body, nonce, }) => {
109
- const nonceArr = new TextEncoder().encode(nonce);
110
- const magicWordArr = new TextEncoder().encode(magicWordStr);
111
- const separatorArr = new TextEncoder().encode(':');
112
- const bodyLengthArr = new TextEncoder().encode(body.length.toString());
113
- const statusArr = new TextEncoder().encode(String(status));
114
- // Calculate total length of new Uint8Array
115
- const totalLength = nonceArr.length +
116
- magicWordArr.length +
117
- separatorArr.length * 3 +
118
- bodyLengthArr.length +
119
- statusArr.length +
120
- body.length;
121
- // Create a new Uint8Array to hold all combined parts
122
- const concat = new Uint8Array(totalLength);
123
- let offset = 0;
124
- // Function to append data to concat
125
- const appendToConcat = (data) => {
126
- concat.set(data, offset);
127
- offset += data.length;
128
- };
129
- // Building the final Uint8Array
130
- appendToConcat(magicWordArr);
131
- appendToConcat(nonceArr);
132
- appendToConcat(separatorArr);
133
- appendToConcat(bodyLengthArr);
134
- appendToConcat(separatorArr);
135
- appendToConcat(statusArr);
136
- appendToConcat(separatorArr);
137
- appendToConcat(body);
138
- return concat;
139
- };
140
- exports.makeStreamPayloadMessage = makeStreamPayloadMessage;