@editframe/api 0.12.0-beta.8 → 0.13.0-beta.1
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/ProgressIterator.d.ts +1 -1
- package/dist/{api/src/ProgressIterator.js → ProgressIterator.js} +14 -2
- package/dist/StreamEventSource.d.ts +5 -3
- package/dist/{api/src/StreamEventSource.js → StreamEventSource.js} +0 -2
- package/dist/client.d.ts +1 -1
- package/dist/index.d.ts +14 -10
- package/dist/{api/src/index.js → index.js} +9 -5
- package/dist/node.d.ts +6 -0
- package/dist/node.js +98 -0
- package/dist/resources/caption-file.d.ts +32 -4
- package/dist/{api/src/resources → resources}/caption-file.js +9 -0
- package/dist/resources/image-file.d.ts +28 -10
- package/dist/{api/src/resources → resources}/image-file.js +18 -1
- package/dist/resources/isobmff-file.d.ts +25 -5
- package/dist/resources/isobmff-track.d.ts +497 -6
- package/dist/{api/src/resources → resources}/isobmff-track.js +24 -18
- package/dist/resources/process-isobmff.d.ts +2 -2
- package/dist/resources/renders.d.ts +27 -15
- package/dist/{api/src/resources → resources}/renders.js +21 -13
- package/dist/resources/transcriptions.d.ts +4 -3
- package/dist/resources/unprocessed-file.d.ts +11 -10
- package/dist/{api/src/resources → resources}/unprocessed-file.js +0 -33
- package/dist/resources/url-token.d.ts +1 -1
- package/dist/uploadChunks.d.ts +4 -1
- package/dist/utils/assertTypesMatch.d.ts +3 -0
- package/dist/utils/createReadableStreamFromReadable.d.ts +4 -0
- package/docs/packages/api/docs/.nojekyll +1 -0
- package/docs/packages/api/docs/assets/highlight.css +71 -0
- package/docs/packages/api/docs/assets/icons.js +18 -0
- package/docs/packages/api/docs/assets/icons.svg +1 -0
- package/docs/packages/api/docs/assets/main.js +60 -0
- package/docs/packages/api/docs/assets/navigation.js +1 -0
- package/docs/packages/api/docs/assets/search.js +1 -0
- package/docs/packages/api/docs/assets/style.css +1493 -0
- package/docs/packages/api/docs/classes/Client.html +4 -0
- package/docs/packages/api/docs/functions/createCaptionFile.html +8 -0
- package/docs/packages/api/docs/functions/createISOBMFFFile.html +1 -0
- package/docs/packages/api/docs/functions/createISOBMFFTrack.html +1 -0
- package/docs/packages/api/docs/functions/createImageFile.html +1 -0
- package/docs/packages/api/docs/functions/createRender.html +1 -0
- package/docs/packages/api/docs/functions/createTranscription.html +1 -0
- package/docs/packages/api/docs/functions/createURLToken.html +1 -0
- package/docs/packages/api/docs/functions/createUnprocessedFile.html +1 -0
- package/docs/packages/api/docs/functions/getISOBMFFFileTranscription.html +1 -0
- package/docs/packages/api/docs/functions/getIsobmffProcessInfo.html +1 -0
- package/docs/packages/api/docs/functions/getIsobmffProcessProgress.html +1 -0
- package/docs/packages/api/docs/functions/getTranscriptionInfo.html +1 -0
- package/docs/packages/api/docs/functions/getTranscriptionProgress.html +1 -0
- package/docs/packages/api/docs/functions/lookupCaptionFileByMd5.html +1 -0
- package/docs/packages/api/docs/functions/lookupISOBMFFFileByMd5.html +1 -0
- package/docs/packages/api/docs/functions/lookupImageFileByMd5.html +1 -0
- package/docs/packages/api/docs/functions/lookupRenderByMd5.html +1 -0
- package/docs/packages/api/docs/functions/lookupUnprocessedFileByMd5.html +1 -0
- package/docs/packages/api/docs/functions/processIsobmffFile.html +1 -0
- package/docs/packages/api/docs/functions/transcribeISOBMFFFile.html +1 -0
- package/docs/packages/api/docs/functions/uploadCaptionFile.html +1 -0
- package/docs/packages/api/docs/functions/uploadFragmentIndex.html +1 -0
- package/docs/packages/api/docs/functions/uploadISOBMFFTrack.html +1 -0
- package/docs/packages/api/docs/functions/uploadImageFile.html +1 -0
- package/docs/packages/api/docs/functions/uploadRender.html +1 -0
- package/docs/packages/api/docs/functions/uploadUnprocessedReadableStream.html +1 -0
- package/docs/packages/api/docs/index.html +39 -0
- package/docs/packages/api/docs/interfaces/CreateCaptionFileResult.html +4 -0
- package/docs/packages/api/docs/interfaces/CreateISOBMFFFileResult.html +5 -0
- package/docs/packages/api/docs/interfaces/CreateISOBMFFTrackResult.html +6 -0
- package/docs/packages/api/docs/interfaces/CreateImageFileResult.html +5 -0
- package/docs/packages/api/docs/interfaces/CreateRenderResult.html +4 -0
- package/docs/packages/api/docs/interfaces/CreateTranscriptionResult.html +3 -0
- package/docs/packages/api/docs/interfaces/CreateUnprocessedFileResult.html +6 -0
- package/docs/packages/api/docs/interfaces/GetISOBMFFFileTranscriptionResult.html +4 -0
- package/docs/packages/api/docs/interfaces/IsobmffProcessInfoResult.html +7 -0
- package/docs/packages/api/docs/interfaces/LookupCaptionFileByMd5Result.html +4 -0
- package/docs/packages/api/docs/interfaces/LookupISOBMFFFileByMd5Result.html +5 -0
- package/docs/packages/api/docs/interfaces/LookupImageFileByMd5Result.html +5 -0
- package/docs/packages/api/docs/interfaces/LookupRenderByMd5Result.html +4 -0
- package/docs/packages/api/docs/interfaces/LookupUnprocessedFileByMd5Result.html +6 -0
- package/docs/packages/api/docs/interfaces/ProcessIsobmffFileResult.html +2 -0
- package/docs/packages/api/docs/interfaces/TranscribeISOBMFFFileResult.html +4 -0
- package/docs/packages/api/docs/interfaces/TranscriptionInfoResult.html +3 -0
- package/docs/packages/api/docs/interfaces/URLTokenResult.html +2 -0
- package/docs/packages/api/docs/modules.html +54 -0
- package/docs/packages/api/docs/variables/CreateCaptionFilePayload.html +1 -0
- package/docs/packages/api/docs/variables/CreateISOBMFFFilePayload.html +1 -0
- package/docs/packages/api/docs/variables/CreateISOBMFFTrackPayload.html +1 -0
- package/docs/packages/api/docs/variables/CreateImageFilePayload.html +1 -0
- package/docs/packages/api/docs/variables/CreateRenderPayload.html +1 -0
- package/docs/packages/api/docs/variables/CreateTranscriptionPayload.html +1 -0
- package/docs/packages/api/docs/variables/CreateUnprocessedFilePayload.html +1 -0
- package/docs/packages/api/docs/variables/TranscribeISOBMFFFilePayload.html +1 -0
- package/package.json +12 -4
- package/src/resources/caption-file.test.ts +3 -3
- package/src/resources/caption-file.ts +31 -2
- package/src/resources/image-file.test.ts +3 -3
- package/src/resources/image-file.ts +23 -37
- package/src/resources/isobmff-file.test.ts +3 -3
- package/src/resources/isobmff-file.ts +27 -3
- package/src/resources/isobmff-track.test.ts +4 -4
- package/src/resources/isobmff-track.ts +147 -25
- package/src/resources/process-isobmff.test.ts +3 -3
- package/src/resources/process-isobmff.ts +2 -2
- package/src/resources/renders.test.ts +3 -18
- package/src/resources/renders.ts +44 -15
- package/src/resources/transcriptions.test.ts +2 -2
- package/src/resources/transcriptions.ts +7 -3
- package/src/resources/unprocessed-file.test.ts +3 -3
- package/src/resources/unprocessed-file.ts +20 -53
- package/src/resources/url-token.test.ts +3 -3
- package/src/resources/url-token.ts +1 -1
- package/src/utils/assertTypesMatch.ts +10 -0
- package/src/utils/createReadableStreamFromReadable.ts +117 -0
- /package/dist/{api/src/CHUNK_SIZE_BYTES.js → CHUNK_SIZE_BYTES.js} +0 -0
- /package/dist/{api/src/client.js → client.js} +0 -0
- /package/dist/{api/src/resources → resources}/isobmff-file.js +0 -0
- /package/dist/{api/src/resources → resources}/process-isobmff.js +0 -0
- /package/dist/{api/src/resources → resources}/transcriptions.js +0 -0
- /package/dist/{api/src/resources → resources}/url-token.js +0 -0
- /package/dist/{api/src/streamChunker.js → streamChunker.js} +0 -0
- /package/dist/{api/src/uploadChunks.js → uploadChunks.js} +0 -0
- /package/dist/{cli/src/utils → utils}/createReadableStreamFromReadable.js +0 -0
|
@@ -1,6 +1,218 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { Client } from '../client.
|
|
3
|
-
export declare const
|
|
2
|
+
import { Client } from '../client.js';
|
|
3
|
+
export declare const AudioStreamSchema: z.ZodObject<{
|
|
4
|
+
index: z.ZodNumber;
|
|
5
|
+
codec_name: z.ZodString;
|
|
6
|
+
codec_long_name: z.ZodString;
|
|
7
|
+
codec_type: z.ZodLiteral<"audio">;
|
|
8
|
+
codec_tag_string: z.ZodString;
|
|
9
|
+
codec_tag: z.ZodString;
|
|
10
|
+
sample_fmt: z.ZodString;
|
|
11
|
+
sample_rate: z.ZodString;
|
|
12
|
+
channels: z.ZodNumber;
|
|
13
|
+
channel_layout: z.ZodString;
|
|
14
|
+
bits_per_sample: z.ZodNumber;
|
|
15
|
+
initial_padding: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
r_frame_rate: z.ZodString;
|
|
17
|
+
avg_frame_rate: z.ZodString;
|
|
18
|
+
time_base: z.ZodString;
|
|
19
|
+
start_pts: z.ZodNumber;
|
|
20
|
+
start_time: z.ZodNumber;
|
|
21
|
+
duration_ts: z.ZodNumber;
|
|
22
|
+
duration: z.ZodNumber;
|
|
23
|
+
bit_rate: z.ZodString;
|
|
24
|
+
disposition: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
index: number;
|
|
27
|
+
codec_name: string;
|
|
28
|
+
codec_long_name: string;
|
|
29
|
+
codec_type: "audio";
|
|
30
|
+
codec_tag_string: string;
|
|
31
|
+
codec_tag: string;
|
|
32
|
+
sample_fmt: string;
|
|
33
|
+
sample_rate: string;
|
|
34
|
+
channels: number;
|
|
35
|
+
channel_layout: string;
|
|
36
|
+
bits_per_sample: number;
|
|
37
|
+
r_frame_rate: string;
|
|
38
|
+
avg_frame_rate: string;
|
|
39
|
+
time_base: string;
|
|
40
|
+
start_pts: number;
|
|
41
|
+
start_time: number;
|
|
42
|
+
duration_ts: number;
|
|
43
|
+
duration: number;
|
|
44
|
+
bit_rate: string;
|
|
45
|
+
disposition: Record<string, unknown>;
|
|
46
|
+
initial_padding?: number | undefined;
|
|
47
|
+
}, {
|
|
48
|
+
index: number;
|
|
49
|
+
codec_name: string;
|
|
50
|
+
codec_long_name: string;
|
|
51
|
+
codec_type: "audio";
|
|
52
|
+
codec_tag_string: string;
|
|
53
|
+
codec_tag: string;
|
|
54
|
+
sample_fmt: string;
|
|
55
|
+
sample_rate: string;
|
|
56
|
+
channels: number;
|
|
57
|
+
channel_layout: string;
|
|
58
|
+
bits_per_sample: number;
|
|
59
|
+
r_frame_rate: string;
|
|
60
|
+
avg_frame_rate: string;
|
|
61
|
+
time_base: string;
|
|
62
|
+
start_pts: number;
|
|
63
|
+
start_time: number;
|
|
64
|
+
duration_ts: number;
|
|
65
|
+
duration: number;
|
|
66
|
+
bit_rate: string;
|
|
67
|
+
disposition: Record<string, unknown>;
|
|
68
|
+
initial_padding?: number | undefined;
|
|
69
|
+
}>;
|
|
70
|
+
export interface AudioStreamSchema {
|
|
71
|
+
/** The index of the stream in the file */
|
|
72
|
+
index: number;
|
|
73
|
+
/** The name of the codec */
|
|
74
|
+
codec_name: string;
|
|
75
|
+
/** The long name of the codec */
|
|
76
|
+
codec_long_name: string;
|
|
77
|
+
/** The type of the codec */
|
|
78
|
+
codec_type: "audio";
|
|
79
|
+
/** The tag string of the codec */
|
|
80
|
+
codec_tag_string: string;
|
|
81
|
+
/** The tag of the codec */
|
|
82
|
+
codec_tag: string;
|
|
83
|
+
/** The sample format */
|
|
84
|
+
sample_fmt: string;
|
|
85
|
+
/** The sample rate */
|
|
86
|
+
sample_rate: string;
|
|
87
|
+
/** The number of channels */
|
|
88
|
+
channels: number;
|
|
89
|
+
/** The channel layout */
|
|
90
|
+
channel_layout: string;
|
|
91
|
+
/** The number of bits per sample */
|
|
92
|
+
bits_per_sample: number;
|
|
93
|
+
/** The initial padding */
|
|
94
|
+
initial_padding?: number;
|
|
95
|
+
/** The frame rate */
|
|
96
|
+
r_frame_rate: string;
|
|
97
|
+
/** The average frame rate */
|
|
98
|
+
avg_frame_rate: string;
|
|
99
|
+
/** The time base */
|
|
100
|
+
time_base: string;
|
|
101
|
+
/** The start presentation timestamp */
|
|
102
|
+
start_pts: number;
|
|
103
|
+
/** The start time */
|
|
104
|
+
start_time: number;
|
|
105
|
+
/** The duration timestamp */
|
|
106
|
+
duration_ts: number;
|
|
107
|
+
/** The duration */
|
|
108
|
+
duration: number;
|
|
109
|
+
/** The bit rate */
|
|
110
|
+
bit_rate: string;
|
|
111
|
+
/** The disposition record. Subject to change, not documented. */
|
|
112
|
+
disposition: Record<string, unknown>;
|
|
113
|
+
}
|
|
114
|
+
export declare const VideoStreamSchema: z.ZodObject<{
|
|
115
|
+
index: z.ZodNumber;
|
|
116
|
+
codec_name: z.ZodString;
|
|
117
|
+
codec_long_name: z.ZodString;
|
|
118
|
+
codec_type: z.ZodLiteral<"video">;
|
|
119
|
+
codec_tag_string: z.ZodString;
|
|
120
|
+
codec_tag: z.ZodString;
|
|
121
|
+
width: z.ZodNumber;
|
|
122
|
+
height: z.ZodNumber;
|
|
123
|
+
coded_width: z.ZodNumber;
|
|
124
|
+
coded_height: z.ZodNumber;
|
|
125
|
+
r_frame_rate: z.ZodString;
|
|
126
|
+
avg_frame_rate: z.ZodString;
|
|
127
|
+
time_base: z.ZodString;
|
|
128
|
+
start_pts: z.ZodOptional<z.ZodNumber>;
|
|
129
|
+
start_time: z.ZodOptional<z.ZodNumber>;
|
|
130
|
+
duration_ts: z.ZodOptional<z.ZodNumber>;
|
|
131
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
132
|
+
bit_rate: z.ZodOptional<z.ZodString>;
|
|
133
|
+
disposition: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
134
|
+
}, "strip", z.ZodTypeAny, {
|
|
135
|
+
index: number;
|
|
136
|
+
codec_name: string;
|
|
137
|
+
codec_long_name: string;
|
|
138
|
+
codec_type: "video";
|
|
139
|
+
codec_tag_string: string;
|
|
140
|
+
codec_tag: string;
|
|
141
|
+
r_frame_rate: string;
|
|
142
|
+
avg_frame_rate: string;
|
|
143
|
+
time_base: string;
|
|
144
|
+
disposition: Record<string, unknown>;
|
|
145
|
+
width: number;
|
|
146
|
+
height: number;
|
|
147
|
+
coded_width: number;
|
|
148
|
+
coded_height: number;
|
|
149
|
+
start_pts?: number | undefined;
|
|
150
|
+
start_time?: number | undefined;
|
|
151
|
+
duration_ts?: number | undefined;
|
|
152
|
+
duration?: number | undefined;
|
|
153
|
+
bit_rate?: string | undefined;
|
|
154
|
+
}, {
|
|
155
|
+
index: number;
|
|
156
|
+
codec_name: string;
|
|
157
|
+
codec_long_name: string;
|
|
158
|
+
codec_type: "video";
|
|
159
|
+
codec_tag_string: string;
|
|
160
|
+
codec_tag: string;
|
|
161
|
+
r_frame_rate: string;
|
|
162
|
+
avg_frame_rate: string;
|
|
163
|
+
time_base: string;
|
|
164
|
+
disposition: Record<string, unknown>;
|
|
165
|
+
width: number;
|
|
166
|
+
height: number;
|
|
167
|
+
coded_width: number;
|
|
168
|
+
coded_height: number;
|
|
169
|
+
start_pts?: number | undefined;
|
|
170
|
+
start_time?: number | undefined;
|
|
171
|
+
duration_ts?: number | undefined;
|
|
172
|
+
duration?: number | undefined;
|
|
173
|
+
bit_rate?: string | undefined;
|
|
174
|
+
}>;
|
|
175
|
+
export interface VideoStreamSchema {
|
|
176
|
+
/** The index of the stream in the file */
|
|
177
|
+
index: number;
|
|
178
|
+
/** The name of the codec */
|
|
179
|
+
codec_name: string;
|
|
180
|
+
/** The long name of the codec */
|
|
181
|
+
codec_long_name: string;
|
|
182
|
+
/** The type of the codec */
|
|
183
|
+
codec_type: "video";
|
|
184
|
+
/** The tag string of the codec */
|
|
185
|
+
codec_tag_string: string;
|
|
186
|
+
/** The tag of the codec */
|
|
187
|
+
codec_tag: string;
|
|
188
|
+
/** The width */
|
|
189
|
+
width: number;
|
|
190
|
+
/** The height */
|
|
191
|
+
height: number;
|
|
192
|
+
/** The coded width */
|
|
193
|
+
coded_width: number;
|
|
194
|
+
/** The coded height */
|
|
195
|
+
coded_height: number;
|
|
196
|
+
/** The frame rate */
|
|
197
|
+
r_frame_rate: string;
|
|
198
|
+
/** The average frame rate */
|
|
199
|
+
avg_frame_rate: string;
|
|
200
|
+
/** The time base */
|
|
201
|
+
time_base: string;
|
|
202
|
+
/** The start presentation timestamp */
|
|
203
|
+
start_pts?: number;
|
|
204
|
+
/** The start time */
|
|
205
|
+
start_time?: number;
|
|
206
|
+
/** The duration timestamp */
|
|
207
|
+
duration_ts?: number;
|
|
208
|
+
/** The duration */
|
|
209
|
+
duration?: number;
|
|
210
|
+
/** The bit rate */
|
|
211
|
+
bit_rate?: string;
|
|
212
|
+
/** The disposition record. Subject to change, not documented. */
|
|
213
|
+
disposition: Record<string, unknown>;
|
|
214
|
+
}
|
|
215
|
+
export declare const AudioTrackPayload: z.ZodObject<{
|
|
4
216
|
file_id: z.ZodString;
|
|
5
217
|
track_id: z.ZodNumber;
|
|
6
218
|
type: z.ZodLiteral<"audio">;
|
|
@@ -75,9 +287,39 @@ export declare const CreateISOBMFFTrackPayload: z.ZodDiscriminatedUnion<"type",
|
|
|
75
287
|
codec_name: z.ZodString;
|
|
76
288
|
byte_size: z.ZodNumber;
|
|
77
289
|
}, "strip", z.ZodTypeAny, {
|
|
290
|
+
codec_name: string;
|
|
78
291
|
type: "audio";
|
|
79
292
|
byte_size: number;
|
|
293
|
+
file_id: string;
|
|
294
|
+
track_id: number;
|
|
295
|
+
probe_info: {
|
|
296
|
+
index: number;
|
|
297
|
+
codec_name: string;
|
|
298
|
+
codec_long_name: string;
|
|
299
|
+
codec_type: "audio";
|
|
300
|
+
codec_tag_string: string;
|
|
301
|
+
codec_tag: string;
|
|
302
|
+
sample_fmt: string;
|
|
303
|
+
sample_rate: string;
|
|
304
|
+
channels: number;
|
|
305
|
+
channel_layout: string;
|
|
306
|
+
bits_per_sample: number;
|
|
307
|
+
r_frame_rate: string;
|
|
308
|
+
avg_frame_rate: string;
|
|
309
|
+
time_base: string;
|
|
310
|
+
start_pts: number;
|
|
311
|
+
start_time: number;
|
|
312
|
+
duration_ts: number;
|
|
313
|
+
duration: number;
|
|
314
|
+
bit_rate: string;
|
|
315
|
+
disposition: Record<string, unknown>;
|
|
316
|
+
initial_padding?: number | undefined;
|
|
317
|
+
};
|
|
318
|
+
duration_ms: number;
|
|
319
|
+
}, {
|
|
80
320
|
codec_name: string;
|
|
321
|
+
type: "audio";
|
|
322
|
+
byte_size: number;
|
|
81
323
|
file_id: string;
|
|
82
324
|
track_id: number;
|
|
83
325
|
probe_info: {
|
|
@@ -104,10 +346,258 @@ export declare const CreateISOBMFFTrackPayload: z.ZodDiscriminatedUnion<"type",
|
|
|
104
346
|
initial_padding?: number | undefined;
|
|
105
347
|
};
|
|
106
348
|
duration_ms: number;
|
|
349
|
+
}>;
|
|
350
|
+
export interface AudioTrackPayload {
|
|
351
|
+
file_id: string;
|
|
352
|
+
track_id: number;
|
|
353
|
+
type: "audio";
|
|
354
|
+
probe_info: AudioStreamSchema;
|
|
355
|
+
duration_ms: number;
|
|
356
|
+
codec_name: string;
|
|
357
|
+
byte_size: number;
|
|
358
|
+
}
|
|
359
|
+
export declare const VideoTrackPayload: z.ZodObject<{
|
|
360
|
+
file_id: z.ZodString;
|
|
361
|
+
track_id: z.ZodNumber;
|
|
362
|
+
type: z.ZodLiteral<"video">;
|
|
363
|
+
probe_info: z.ZodObject<{
|
|
364
|
+
index: z.ZodNumber;
|
|
365
|
+
codec_name: z.ZodString;
|
|
366
|
+
codec_long_name: z.ZodString;
|
|
367
|
+
codec_type: z.ZodLiteral<"video">;
|
|
368
|
+
codec_tag_string: z.ZodString;
|
|
369
|
+
codec_tag: z.ZodString;
|
|
370
|
+
width: z.ZodNumber;
|
|
371
|
+
height: z.ZodNumber;
|
|
372
|
+
coded_width: z.ZodNumber;
|
|
373
|
+
coded_height: z.ZodNumber;
|
|
374
|
+
r_frame_rate: z.ZodString;
|
|
375
|
+
avg_frame_rate: z.ZodString;
|
|
376
|
+
time_base: z.ZodString;
|
|
377
|
+
start_pts: z.ZodOptional<z.ZodNumber>;
|
|
378
|
+
start_time: z.ZodOptional<z.ZodNumber>;
|
|
379
|
+
duration_ts: z.ZodOptional<z.ZodNumber>;
|
|
380
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
381
|
+
bit_rate: z.ZodOptional<z.ZodString>;
|
|
382
|
+
disposition: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
383
|
+
}, "strip", z.ZodTypeAny, {
|
|
384
|
+
index: number;
|
|
385
|
+
codec_name: string;
|
|
386
|
+
codec_long_name: string;
|
|
387
|
+
codec_type: "video";
|
|
388
|
+
codec_tag_string: string;
|
|
389
|
+
codec_tag: string;
|
|
390
|
+
r_frame_rate: string;
|
|
391
|
+
avg_frame_rate: string;
|
|
392
|
+
time_base: string;
|
|
393
|
+
disposition: Record<string, unknown>;
|
|
394
|
+
width: number;
|
|
395
|
+
height: number;
|
|
396
|
+
coded_width: number;
|
|
397
|
+
coded_height: number;
|
|
398
|
+
start_pts?: number | undefined;
|
|
399
|
+
start_time?: number | undefined;
|
|
400
|
+
duration_ts?: number | undefined;
|
|
401
|
+
duration?: number | undefined;
|
|
402
|
+
bit_rate?: string | undefined;
|
|
403
|
+
}, {
|
|
404
|
+
index: number;
|
|
405
|
+
codec_name: string;
|
|
406
|
+
codec_long_name: string;
|
|
407
|
+
codec_type: "video";
|
|
408
|
+
codec_tag_string: string;
|
|
409
|
+
codec_tag: string;
|
|
410
|
+
r_frame_rate: string;
|
|
411
|
+
avg_frame_rate: string;
|
|
412
|
+
time_base: string;
|
|
413
|
+
disposition: Record<string, unknown>;
|
|
414
|
+
width: number;
|
|
415
|
+
height: number;
|
|
416
|
+
coded_width: number;
|
|
417
|
+
coded_height: number;
|
|
418
|
+
start_pts?: number | undefined;
|
|
419
|
+
start_time?: number | undefined;
|
|
420
|
+
duration_ts?: number | undefined;
|
|
421
|
+
duration?: number | undefined;
|
|
422
|
+
bit_rate?: string | undefined;
|
|
423
|
+
}>;
|
|
424
|
+
duration_ms: z.ZodNumber;
|
|
425
|
+
codec_name: z.ZodString;
|
|
426
|
+
byte_size: z.ZodNumber;
|
|
427
|
+
}, "strip", z.ZodTypeAny, {
|
|
428
|
+
codec_name: string;
|
|
429
|
+
type: "video";
|
|
430
|
+
byte_size: number;
|
|
431
|
+
file_id: string;
|
|
432
|
+
track_id: number;
|
|
433
|
+
probe_info: {
|
|
434
|
+
index: number;
|
|
435
|
+
codec_name: string;
|
|
436
|
+
codec_long_name: string;
|
|
437
|
+
codec_type: "video";
|
|
438
|
+
codec_tag_string: string;
|
|
439
|
+
codec_tag: string;
|
|
440
|
+
r_frame_rate: string;
|
|
441
|
+
avg_frame_rate: string;
|
|
442
|
+
time_base: string;
|
|
443
|
+
disposition: Record<string, unknown>;
|
|
444
|
+
width: number;
|
|
445
|
+
height: number;
|
|
446
|
+
coded_width: number;
|
|
447
|
+
coded_height: number;
|
|
448
|
+
start_pts?: number | undefined;
|
|
449
|
+
start_time?: number | undefined;
|
|
450
|
+
duration_ts?: number | undefined;
|
|
451
|
+
duration?: number | undefined;
|
|
452
|
+
bit_rate?: string | undefined;
|
|
453
|
+
};
|
|
454
|
+
duration_ms: number;
|
|
107
455
|
}, {
|
|
456
|
+
codec_name: string;
|
|
457
|
+
type: "video";
|
|
458
|
+
byte_size: number;
|
|
459
|
+
file_id: string;
|
|
460
|
+
track_id: number;
|
|
461
|
+
probe_info: {
|
|
462
|
+
index: number;
|
|
463
|
+
codec_name: string;
|
|
464
|
+
codec_long_name: string;
|
|
465
|
+
codec_type: "video";
|
|
466
|
+
codec_tag_string: string;
|
|
467
|
+
codec_tag: string;
|
|
468
|
+
r_frame_rate: string;
|
|
469
|
+
avg_frame_rate: string;
|
|
470
|
+
time_base: string;
|
|
471
|
+
disposition: Record<string, unknown>;
|
|
472
|
+
width: number;
|
|
473
|
+
height: number;
|
|
474
|
+
coded_width: number;
|
|
475
|
+
coded_height: number;
|
|
476
|
+
start_pts?: number | undefined;
|
|
477
|
+
start_time?: number | undefined;
|
|
478
|
+
duration_ts?: number | undefined;
|
|
479
|
+
duration?: number | undefined;
|
|
480
|
+
bit_rate?: string | undefined;
|
|
481
|
+
};
|
|
482
|
+
duration_ms: number;
|
|
483
|
+
}>;
|
|
484
|
+
export interface VideoTrackPayload {
|
|
485
|
+
file_id: string;
|
|
486
|
+
track_id: number;
|
|
487
|
+
type: "video";
|
|
488
|
+
probe_info: VideoStreamSchema;
|
|
489
|
+
duration_ms: number;
|
|
490
|
+
codec_name: string;
|
|
491
|
+
byte_size: number;
|
|
492
|
+
}
|
|
493
|
+
export declare const CreateISOBMFFTrackPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
494
|
+
file_id: z.ZodString;
|
|
495
|
+
track_id: z.ZodNumber;
|
|
496
|
+
type: z.ZodLiteral<"audio">;
|
|
497
|
+
probe_info: z.ZodObject<{
|
|
498
|
+
index: z.ZodNumber;
|
|
499
|
+
codec_name: z.ZodString;
|
|
500
|
+
codec_long_name: z.ZodString;
|
|
501
|
+
codec_type: z.ZodLiteral<"audio">;
|
|
502
|
+
codec_tag_string: z.ZodString;
|
|
503
|
+
codec_tag: z.ZodString;
|
|
504
|
+
sample_fmt: z.ZodString;
|
|
505
|
+
sample_rate: z.ZodString;
|
|
506
|
+
channels: z.ZodNumber;
|
|
507
|
+
channel_layout: z.ZodString;
|
|
508
|
+
bits_per_sample: z.ZodNumber;
|
|
509
|
+
initial_padding: z.ZodOptional<z.ZodNumber>;
|
|
510
|
+
r_frame_rate: z.ZodString;
|
|
511
|
+
avg_frame_rate: z.ZodString;
|
|
512
|
+
time_base: z.ZodString;
|
|
513
|
+
start_pts: z.ZodNumber;
|
|
514
|
+
start_time: z.ZodNumber;
|
|
515
|
+
duration_ts: z.ZodNumber;
|
|
516
|
+
duration: z.ZodNumber;
|
|
517
|
+
bit_rate: z.ZodString;
|
|
518
|
+
disposition: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
519
|
+
}, "strip", z.ZodTypeAny, {
|
|
520
|
+
index: number;
|
|
521
|
+
codec_name: string;
|
|
522
|
+
codec_long_name: string;
|
|
523
|
+
codec_type: "audio";
|
|
524
|
+
codec_tag_string: string;
|
|
525
|
+
codec_tag: string;
|
|
526
|
+
sample_fmt: string;
|
|
527
|
+
sample_rate: string;
|
|
528
|
+
channels: number;
|
|
529
|
+
channel_layout: string;
|
|
530
|
+
bits_per_sample: number;
|
|
531
|
+
r_frame_rate: string;
|
|
532
|
+
avg_frame_rate: string;
|
|
533
|
+
time_base: string;
|
|
534
|
+
start_pts: number;
|
|
535
|
+
start_time: number;
|
|
536
|
+
duration_ts: number;
|
|
537
|
+
duration: number;
|
|
538
|
+
bit_rate: string;
|
|
539
|
+
disposition: Record<string, unknown>;
|
|
540
|
+
initial_padding?: number | undefined;
|
|
541
|
+
}, {
|
|
542
|
+
index: number;
|
|
543
|
+
codec_name: string;
|
|
544
|
+
codec_long_name: string;
|
|
545
|
+
codec_type: "audio";
|
|
546
|
+
codec_tag_string: string;
|
|
547
|
+
codec_tag: string;
|
|
548
|
+
sample_fmt: string;
|
|
549
|
+
sample_rate: string;
|
|
550
|
+
channels: number;
|
|
551
|
+
channel_layout: string;
|
|
552
|
+
bits_per_sample: number;
|
|
553
|
+
r_frame_rate: string;
|
|
554
|
+
avg_frame_rate: string;
|
|
555
|
+
time_base: string;
|
|
556
|
+
start_pts: number;
|
|
557
|
+
start_time: number;
|
|
558
|
+
duration_ts: number;
|
|
559
|
+
duration: number;
|
|
560
|
+
bit_rate: string;
|
|
561
|
+
disposition: Record<string, unknown>;
|
|
562
|
+
initial_padding?: number | undefined;
|
|
563
|
+
}>;
|
|
564
|
+
duration_ms: z.ZodNumber;
|
|
565
|
+
codec_name: z.ZodString;
|
|
566
|
+
byte_size: z.ZodNumber;
|
|
567
|
+
}, "strip", z.ZodTypeAny, {
|
|
568
|
+
codec_name: string;
|
|
108
569
|
type: "audio";
|
|
109
570
|
byte_size: number;
|
|
571
|
+
file_id: string;
|
|
572
|
+
track_id: number;
|
|
573
|
+
probe_info: {
|
|
574
|
+
index: number;
|
|
575
|
+
codec_name: string;
|
|
576
|
+
codec_long_name: string;
|
|
577
|
+
codec_type: "audio";
|
|
578
|
+
codec_tag_string: string;
|
|
579
|
+
codec_tag: string;
|
|
580
|
+
sample_fmt: string;
|
|
581
|
+
sample_rate: string;
|
|
582
|
+
channels: number;
|
|
583
|
+
channel_layout: string;
|
|
584
|
+
bits_per_sample: number;
|
|
585
|
+
r_frame_rate: string;
|
|
586
|
+
avg_frame_rate: string;
|
|
587
|
+
time_base: string;
|
|
588
|
+
start_pts: number;
|
|
589
|
+
start_time: number;
|
|
590
|
+
duration_ts: number;
|
|
591
|
+
duration: number;
|
|
592
|
+
bit_rate: string;
|
|
593
|
+
disposition: Record<string, unknown>;
|
|
594
|
+
initial_padding?: number | undefined;
|
|
595
|
+
};
|
|
596
|
+
duration_ms: number;
|
|
597
|
+
}, {
|
|
110
598
|
codec_name: string;
|
|
599
|
+
type: "audio";
|
|
600
|
+
byte_size: number;
|
|
111
601
|
file_id: string;
|
|
112
602
|
track_id: number;
|
|
113
603
|
probe_info: {
|
|
@@ -203,9 +693,9 @@ export declare const CreateISOBMFFTrackPayload: z.ZodDiscriminatedUnion<"type",
|
|
|
203
693
|
codec_name: z.ZodString;
|
|
204
694
|
byte_size: z.ZodNumber;
|
|
205
695
|
}, "strip", z.ZodTypeAny, {
|
|
696
|
+
codec_name: string;
|
|
206
697
|
type: "video";
|
|
207
698
|
byte_size: number;
|
|
208
|
-
codec_name: string;
|
|
209
699
|
file_id: string;
|
|
210
700
|
track_id: number;
|
|
211
701
|
probe_info: {
|
|
@@ -231,9 +721,9 @@ export declare const CreateISOBMFFTrackPayload: z.ZodDiscriminatedUnion<"type",
|
|
|
231
721
|
};
|
|
232
722
|
duration_ms: number;
|
|
233
723
|
}, {
|
|
724
|
+
codec_name: string;
|
|
234
725
|
type: "video";
|
|
235
726
|
byte_size: number;
|
|
236
|
-
codec_name: string;
|
|
237
727
|
file_id: string;
|
|
238
728
|
track_id: number;
|
|
239
729
|
probe_info: {
|
|
@@ -259,6 +749,7 @@ export declare const CreateISOBMFFTrackPayload: z.ZodDiscriminatedUnion<"type",
|
|
|
259
749
|
};
|
|
260
750
|
duration_ms: number;
|
|
261
751
|
}>]>;
|
|
752
|
+
export type CreateISOBMFFTrackPayload = VideoTrackPayload | AudioTrackPayload;
|
|
262
753
|
export interface CreateISOBMFFTrackResult {
|
|
263
754
|
next_byte: number;
|
|
264
755
|
byte_size: number;
|
|
@@ -266,5 +757,5 @@ export interface CreateISOBMFFTrackResult {
|
|
|
266
757
|
file_id: string;
|
|
267
758
|
complete: boolean;
|
|
268
759
|
}
|
|
269
|
-
export declare const createISOBMFFTrack: (client: Client, payload:
|
|
270
|
-
export declare const uploadISOBMFFTrack: (client: Client, fileId: string, trackId: number, fileStream: ReadableStream, trackSize: number) => import('../uploadChunks.
|
|
760
|
+
export declare const createISOBMFFTrack: (client: Client, payload: CreateISOBMFFTrackPayload) => Promise<CreateISOBMFFTrackResult>;
|
|
761
|
+
export declare const uploadISOBMFFTrack: (client: Client, fileId: string, trackId: number, fileStream: ReadableStream, trackSize: number) => import('../uploadChunks.js').IteratorWithPromise<import('../uploadChunks.js').UploadChunkEvent>;
|
|
@@ -47,25 +47,27 @@ const VideoStreamSchema = z.object({
|
|
|
47
47
|
});
|
|
48
48
|
const log = debug("ef:api:isobmff-track");
|
|
49
49
|
const MAX_TRACK_SIZE = 1024 * 1024 * 1024;
|
|
50
|
+
const AudioTrackPayload = z.object({
|
|
51
|
+
file_id: z.string(),
|
|
52
|
+
track_id: z.number().int(),
|
|
53
|
+
type: z.literal("audio"),
|
|
54
|
+
probe_info: AudioStreamSchema,
|
|
55
|
+
duration_ms: z.number().int(),
|
|
56
|
+
codec_name: z.string(),
|
|
57
|
+
byte_size: z.number().int().max(MAX_TRACK_SIZE)
|
|
58
|
+
});
|
|
59
|
+
const VideoTrackPayload = z.object({
|
|
60
|
+
file_id: z.string(),
|
|
61
|
+
track_id: z.number().int(),
|
|
62
|
+
type: z.literal("video"),
|
|
63
|
+
probe_info: VideoStreamSchema,
|
|
64
|
+
duration_ms: z.number().int(),
|
|
65
|
+
codec_name: z.string(),
|
|
66
|
+
byte_size: z.number().int().max(MAX_TRACK_SIZE)
|
|
67
|
+
});
|
|
50
68
|
const CreateISOBMFFTrackPayload = z.discriminatedUnion("type", [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
track_id: z.number().int(),
|
|
54
|
-
type: z.literal("audio"),
|
|
55
|
-
probe_info: AudioStreamSchema,
|
|
56
|
-
duration_ms: z.number().int(),
|
|
57
|
-
codec_name: z.string(),
|
|
58
|
-
byte_size: z.number().int().max(MAX_TRACK_SIZE)
|
|
59
|
-
}),
|
|
60
|
-
z.object({
|
|
61
|
-
file_id: z.string(),
|
|
62
|
-
track_id: z.number().int(),
|
|
63
|
-
type: z.literal("video"),
|
|
64
|
-
probe_info: VideoStreamSchema,
|
|
65
|
-
duration_ms: z.number().int(),
|
|
66
|
-
codec_name: z.string(),
|
|
67
|
-
byte_size: z.number().int().max(MAX_TRACK_SIZE)
|
|
68
|
-
})
|
|
69
|
+
AudioTrackPayload,
|
|
70
|
+
VideoTrackPayload
|
|
69
71
|
]);
|
|
70
72
|
const createISOBMFFTrack = async (client, payload) => {
|
|
71
73
|
log("Creating isobmff track", payload);
|
|
@@ -92,7 +94,11 @@ const uploadISOBMFFTrack = (client, fileId, trackId, fileStream, trackSize) => {
|
|
|
92
94
|
});
|
|
93
95
|
};
|
|
94
96
|
export {
|
|
97
|
+
AudioStreamSchema,
|
|
98
|
+
AudioTrackPayload,
|
|
95
99
|
CreateISOBMFFTrackPayload,
|
|
100
|
+
VideoStreamSchema,
|
|
101
|
+
VideoTrackPayload,
|
|
96
102
|
createISOBMFFTrack,
|
|
97
103
|
uploadISOBMFFTrack
|
|
98
104
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ProgressIterator } from '../ProgressIterator.
|
|
2
|
-
import { Client } from '../client.
|
|
1
|
+
import { ProgressIterator } from '../ProgressIterator.js';
|
|
2
|
+
import { Client } from '../client.js';
|
|
3
3
|
export interface IsobmffProcessInfoResult {
|
|
4
4
|
id: string;
|
|
5
5
|
created_at: string;
|
|
@@ -1,30 +1,40 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { CompletionIterator } from '../ProgressIterator.js';
|
|
3
|
+
import { Client } from '../client.js';
|
|
3
4
|
export declare const CreateRenderPayload: z.ZodObject<{
|
|
4
|
-
md5: z.ZodString
|
|
5
|
-
fps: z.ZodNumber
|
|
5
|
+
md5: z.ZodOptional<z.ZodString>;
|
|
6
|
+
fps: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
6
7
|
width: z.ZodNumber;
|
|
7
8
|
height: z.ZodNumber;
|
|
8
|
-
work_slice_ms: z.ZodNumber
|
|
9
|
+
work_slice_ms: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
9
10
|
duration_ms: z.ZodNumber;
|
|
10
|
-
strategy: z.ZodEnum<["v1", "v2"]
|
|
11
|
+
strategy: z.ZodOptional<z.ZodDefault<z.ZodEnum<["v1", "v2"]>>>;
|
|
11
12
|
}, "strip", z.ZodTypeAny, {
|
|
12
|
-
md5: string;
|
|
13
13
|
width: number;
|
|
14
14
|
height: number;
|
|
15
|
-
strategy: "v1" | "v2";
|
|
16
15
|
duration_ms: number;
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
md5?: string | undefined;
|
|
17
|
+
strategy?: "v1" | "v2" | undefined;
|
|
18
|
+
fps?: number | undefined;
|
|
19
|
+
work_slice_ms?: number | undefined;
|
|
19
20
|
}, {
|
|
20
|
-
md5: string;
|
|
21
21
|
width: number;
|
|
22
22
|
height: number;
|
|
23
|
-
strategy: "v1" | "v2";
|
|
24
23
|
duration_ms: number;
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
md5?: string | undefined;
|
|
25
|
+
strategy?: "v1" | "v2" | undefined;
|
|
26
|
+
fps?: number | undefined;
|
|
27
|
+
work_slice_ms?: number | undefined;
|
|
27
28
|
}>;
|
|
29
|
+
export interface CreateRenderPayload {
|
|
30
|
+
md5?: string;
|
|
31
|
+
fps?: number;
|
|
32
|
+
width: number;
|
|
33
|
+
height: number;
|
|
34
|
+
work_slice_ms?: number;
|
|
35
|
+
duration_ms: number;
|
|
36
|
+
strategy?: "v1" | "v2";
|
|
37
|
+
}
|
|
28
38
|
export interface CreateRenderResult {
|
|
29
39
|
id: string;
|
|
30
40
|
md5: string;
|
|
@@ -35,6 +45,8 @@ export interface LookupRenderByMd5Result {
|
|
|
35
45
|
md5: string;
|
|
36
46
|
status: "complete" | "created" | "failed" | "pending" | "rendering" | string;
|
|
37
47
|
}
|
|
38
|
-
export declare const createRender: (client: Client, payload:
|
|
39
|
-
export declare const uploadRender: (client: Client, fileId: string, fileStream: ReadableStream
|
|
48
|
+
export declare const createRender: (client: Client, payload: CreateRenderPayload) => Promise<CreateRenderResult>;
|
|
49
|
+
export declare const uploadRender: (client: Client, fileId: string, fileStream: ReadableStream) => Promise<any>;
|
|
50
|
+
export declare const getRenderInfo: (client: Client, id: string) => Promise<LookupRenderByMd5Result>;
|
|
40
51
|
export declare const lookupRenderByMd5: (client: Client, md5: string) => Promise<LookupRenderByMd5Result | null>;
|
|
52
|
+
export declare const getRenderProgress: (client: Client, id: string) => Promise<CompletionIterator>;
|