@editframe/assets 0.12.0-beta.19 → 0.12.0-beta.20
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/EncodedAsset.js +5 -1
- package/dist/Probe.d.ts +51 -0
- package/dist/Probe.js +14 -2
- package/package.json +1 -1
package/dist/EncodedAsset.js
CHANGED
|
@@ -13,7 +13,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
13
13
|
return result;
|
|
14
14
|
};
|
|
15
15
|
const log = debug("ef:av");
|
|
16
|
-
const BUFFER_SIZE =
|
|
16
|
+
const BUFFER_SIZE = 30;
|
|
17
17
|
class AssetNotAvailableLocally extends Error {
|
|
18
18
|
}
|
|
19
19
|
class FileAsset {
|
|
@@ -232,6 +232,10 @@ const _VideoAsset = class _VideoAsset2 extends ISOFileAsset {
|
|
|
232
232
|
duration: sample.duration,
|
|
233
233
|
type: sample.is_sync ? "key" : "delta"
|
|
234
234
|
});
|
|
235
|
+
if (this.videoDecoder.state === "closed") {
|
|
236
|
+
console.info("Decoder closed, skipping decode");
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
235
239
|
this.videoDecoder.decode(chunk);
|
|
236
240
|
const nextSample = this.defaultVideoTrak?.samples?.[i + 1];
|
|
237
241
|
if (nextSample === void 0) {
|
package/dist/Probe.d.ts
CHANGED
|
@@ -130,6 +130,20 @@ export declare const VideoStreamSchema: z.ZodObject<{
|
|
|
130
130
|
bit_rate?: string | undefined;
|
|
131
131
|
}>;
|
|
132
132
|
export type VideoStreamSchema = z.infer<typeof VideoStreamSchema>;
|
|
133
|
+
export declare const DataStreamSchema: z.ZodObject<{
|
|
134
|
+
index: z.ZodNumber;
|
|
135
|
+
codec_type: z.ZodLiteral<"data">;
|
|
136
|
+
duration: z.ZodOptional<z.ZodString>;
|
|
137
|
+
}, "strip", z.ZodTypeAny, {
|
|
138
|
+
index: number;
|
|
139
|
+
codec_type: "data";
|
|
140
|
+
duration?: string | undefined;
|
|
141
|
+
}, {
|
|
142
|
+
index: number;
|
|
143
|
+
codec_type: "data";
|
|
144
|
+
duration?: string | undefined;
|
|
145
|
+
}>;
|
|
146
|
+
export type DataStreamSchema = z.infer<typeof DataStreamSchema>;
|
|
133
147
|
declare const StreamSchema: z.ZodDiscriminatedUnion<"codec_type", [z.ZodObject<{
|
|
134
148
|
index: z.ZodNumber;
|
|
135
149
|
codec_name: z.ZodString;
|
|
@@ -256,6 +270,18 @@ declare const StreamSchema: z.ZodDiscriminatedUnion<"codec_type", [z.ZodObject<{
|
|
|
256
270
|
start_time?: number | undefined;
|
|
257
271
|
duration_ts?: number | undefined;
|
|
258
272
|
bit_rate?: string | undefined;
|
|
273
|
+
}>, z.ZodObject<{
|
|
274
|
+
index: z.ZodNumber;
|
|
275
|
+
codec_type: z.ZodLiteral<"data">;
|
|
276
|
+
duration: z.ZodOptional<z.ZodString>;
|
|
277
|
+
}, "strip", z.ZodTypeAny, {
|
|
278
|
+
index: number;
|
|
279
|
+
codec_type: "data";
|
|
280
|
+
duration?: string | undefined;
|
|
281
|
+
}, {
|
|
282
|
+
index: number;
|
|
283
|
+
codec_type: "data";
|
|
284
|
+
duration?: string | undefined;
|
|
259
285
|
}>]>;
|
|
260
286
|
export type StreamSchema = z.infer<typeof StreamSchema>;
|
|
261
287
|
declare const ProbeSchema: z.ZodObject<{
|
|
@@ -385,6 +411,18 @@ declare const ProbeSchema: z.ZodObject<{
|
|
|
385
411
|
start_time?: number | undefined;
|
|
386
412
|
duration_ts?: number | undefined;
|
|
387
413
|
bit_rate?: string | undefined;
|
|
414
|
+
}>, z.ZodObject<{
|
|
415
|
+
index: z.ZodNumber;
|
|
416
|
+
codec_type: z.ZodLiteral<"data">;
|
|
417
|
+
duration: z.ZodOptional<z.ZodString>;
|
|
418
|
+
}, "strip", z.ZodTypeAny, {
|
|
419
|
+
index: number;
|
|
420
|
+
codec_type: "data";
|
|
421
|
+
duration?: string | undefined;
|
|
422
|
+
}, {
|
|
423
|
+
index: number;
|
|
424
|
+
codec_type: "data";
|
|
425
|
+
duration?: string | undefined;
|
|
388
426
|
}>]>, "many">;
|
|
389
427
|
format: z.ZodObject<{
|
|
390
428
|
filename: z.ZodString;
|
|
@@ -475,6 +513,10 @@ declare const ProbeSchema: z.ZodObject<{
|
|
|
475
513
|
start_time?: number | undefined;
|
|
476
514
|
duration_ts?: number | undefined;
|
|
477
515
|
bit_rate?: string | undefined;
|
|
516
|
+
} | {
|
|
517
|
+
index: number;
|
|
518
|
+
codec_type: "data";
|
|
519
|
+
duration?: string | undefined;
|
|
478
520
|
})[];
|
|
479
521
|
}, {
|
|
480
522
|
format: {
|
|
@@ -531,6 +573,10 @@ declare const ProbeSchema: z.ZodObject<{
|
|
|
531
573
|
start_time?: number | undefined;
|
|
532
574
|
duration_ts?: number | undefined;
|
|
533
575
|
bit_rate?: string | undefined;
|
|
576
|
+
} | {
|
|
577
|
+
index: number;
|
|
578
|
+
codec_type: "data";
|
|
579
|
+
duration?: string | undefined;
|
|
534
580
|
})[];
|
|
535
581
|
}>;
|
|
536
582
|
export type ProbeSchema = z.infer<typeof ProbeSchema>;
|
|
@@ -623,6 +669,10 @@ export declare class Probe {
|
|
|
623
669
|
start_time?: number | undefined;
|
|
624
670
|
duration_ts?: number | undefined;
|
|
625
671
|
bit_rate?: string | undefined;
|
|
672
|
+
} | {
|
|
673
|
+
index: number;
|
|
674
|
+
codec_type: "data";
|
|
675
|
+
duration?: string | undefined;
|
|
626
676
|
})[];
|
|
627
677
|
get format(): {
|
|
628
678
|
filename: string;
|
|
@@ -639,6 +689,7 @@ export declare class Probe {
|
|
|
639
689
|
get mustReencodeAudio(): boolean;
|
|
640
690
|
get mustReencodeVideo(): boolean;
|
|
641
691
|
get mustRemux(): boolean;
|
|
692
|
+
get hasNonAudioOrVideoStreams(): boolean;
|
|
642
693
|
get hasAudio(): boolean;
|
|
643
694
|
get hasVideo(): boolean;
|
|
644
695
|
get isAudioOnly(): boolean;
|
package/dist/Probe.js
CHANGED
|
@@ -61,9 +61,15 @@ const ProbeFormatSchema = z.object({
|
|
|
61
61
|
bit_rate: z.string().optional(),
|
|
62
62
|
probe_score: z.number()
|
|
63
63
|
});
|
|
64
|
+
const DataStreamSchema = z.object({
|
|
65
|
+
index: z.number(),
|
|
66
|
+
codec_type: z.literal("data"),
|
|
67
|
+
duration: z.string().optional()
|
|
68
|
+
});
|
|
64
69
|
const StreamSchema = z.discriminatedUnion("codec_type", [
|
|
65
70
|
AudioStreamSchema,
|
|
66
|
-
VideoStreamSchema
|
|
71
|
+
VideoStreamSchema,
|
|
72
|
+
DataStreamSchema
|
|
67
73
|
]);
|
|
68
74
|
const ProbeSchema = z.object({
|
|
69
75
|
streams: z.array(StreamSchema),
|
|
@@ -166,7 +172,12 @@ class Probe {
|
|
|
166
172
|
return false;
|
|
167
173
|
}
|
|
168
174
|
get mustRemux() {
|
|
169
|
-
return this.format.format_name !== "mp4";
|
|
175
|
+
return this.format.format_name !== "mp4" || this.data.streams.some((stream) => stream.codec_type !== "audio" && stream.codec_type !== "video");
|
|
176
|
+
}
|
|
177
|
+
get hasNonAudioOrVideoStreams() {
|
|
178
|
+
return this.data.streams.some(
|
|
179
|
+
(stream) => stream.codec_type !== "audio" && stream.codec_type !== "video"
|
|
180
|
+
);
|
|
170
181
|
}
|
|
171
182
|
get hasAudio() {
|
|
172
183
|
return this.audioStreams.length > 0;
|
|
@@ -266,6 +277,7 @@ class Probe {
|
|
|
266
277
|
}
|
|
267
278
|
export {
|
|
268
279
|
AudioStreamSchema,
|
|
280
|
+
DataStreamSchema,
|
|
269
281
|
Probe,
|
|
270
282
|
VideoStreamSchema
|
|
271
283
|
};
|