@vivix-labs/media-tools 1.0.0-beta.2 → 1.0.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/README.md +38 -12
- package/dist/assets/1-1-WUUPNDJP.svg +7 -0
- package/dist/assets/16-9-BAFQTZK7.svg +9 -0
- package/dist/assets/2-3-WPG3UQBV.svg +7 -0
- package/dist/assets/3-2-YZTSUZ37.svg +7 -0
- package/dist/assets/3-4-7YROL4JU.svg +7 -0
- package/dist/assets/4-3-YG4LTLGD.svg +7 -0
- package/dist/assets/9-16-CYXX6QAR.svg +9 -0
- package/dist/assets/add-circle-RPMXNTWW.svg +4 -0
- package/dist/assets/captions-16-55I6JRWY.svg +5 -0
- package/dist/assets/captions-24-4YNDEZZX.svg +5 -0
- package/dist/assets/chevrons-up-down-KDZMS6DI.svg +3 -0
- package/dist/assets/collapse-diagonal-16-2IRQGCLB.svg +6 -0
- package/dist/assets/collapse-diagonal-24-GHD6Z54K.svg +6 -0
- package/dist/assets/copy-document-EF4PHM7F.svg +10 -0
- package/dist/assets/crop-5JXWHIPN.svg +6 -0
- package/dist/assets/delete-4Y3OUMEL.svg +8 -0
- package/dist/assets/download-16-QVS2YNPN.svg +4 -0
- package/dist/assets/download-24-ARCWU2MF.svg +4 -0
- package/dist/assets/download-VTKCEAZG.svg +6 -0
- package/dist/assets/expand-diagonal-16-QUIZSPJN.svg +10 -0
- package/dist/assets/expand-diagonal-24-XPK72ILY.svg +10 -0
- package/dist/assets/favorite-6GMNHJCN.svg +5 -0
- package/dist/assets/favorite-filled-FR74TEBM.svg +3 -0
- package/dist/assets/filter-JSDZZVGN.svg +5 -0
- package/dist/assets/freeform-E5MLUKDE.svg +18 -0
- package/dist/assets/fullscreen-exit-ADYOPBYH.svg +3 -0
- package/dist/assets/grid-16-POIO22HZ.svg +6 -0
- package/dist/assets/grid-24-U6IRT56K.svg +6 -0
- package/dist/assets/inria-serif-latin-400-italic-ZCFRMMVP.woff2 +0 -0
- package/dist/assets/inria-serif-latin-700-italic-UNRIXGAH.woff2 +0 -0
- package/dist/assets/inter-latin-900-normal-FKACR3DR.woff2 +0 -0
- package/dist/assets/list-16-YAVTLHXZ.svg +8 -0
- package/dist/assets/list-24-O6WDB6WJ.svg +8 -0
- package/dist/assets/original-LBKLUQVV.svg +18 -0
- package/dist/assets/pause-16-444PD7SY.svg +4 -0
- package/dist/assets/pause-24-WQXRNLW3.svg +4 -0
- package/dist/assets/play-16-5B2LZITW.svg +3 -0
- package/dist/assets/play-24-3IPXXAC4.svg +3 -0
- package/dist/assets/refresh-WQ3CTB57.svg +3 -0
- package/dist/assets/replace-PJXDOQDX.svg +3 -0
- package/dist/assets/{search-JUOSGQRM.svg → search-FMYQZJWA.svg} +1 -1
- package/dist/assets/select-items-GJZIVO37.svg +6 -0
- package/dist/assets/trim-LQMHHN2M.svg +9 -0
- package/dist/assets/upload-U5RZT5QI.svg +5 -0
- package/dist/assets/volume-16-ENYWJAGG.svg +5 -0
- package/dist/assets/volume-24-MVQ6CAXW.svg +5 -0
- package/dist/assets/volume-off-16-ALKG7632.svg +4 -0
- package/dist/assets/volume-off-24-2R4VED3N.svg +4 -0
- package/dist/client.bundle.js +1444 -252
- package/dist/client.css +2368 -181
- package/dist/server.d.ts +1 -1
- package/dist/server.js +257 -63
- package/dist/shared.d.ts +188 -3
- package/dist/shared.js +86 -3
- package/{skills/SKILL.md → docs/operations.md} +7 -7
- package/package.json +5 -4
- package/studio-plugin.json +1 -4
- package/dist/assets/player-cover-shade-LLH6KOCQ.png +0 -0
- /package/{skills/references → docs}/processing.md +0 -0
package/dist/shared.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { CallContext as CallContext$1, z } from 'vivix-studio/sdk/shared';
|
|
3
4
|
import { MenuItem } from '@vivix-labs/ui-system';
|
|
4
5
|
|
|
5
6
|
type Scope = {
|
|
@@ -78,6 +79,17 @@ interface StagedFile {
|
|
|
78
79
|
originalName: string;
|
|
79
80
|
details: Record<string, any>;
|
|
80
81
|
}
|
|
82
|
+
interface UploadChunk {
|
|
83
|
+
uploadId: string;
|
|
84
|
+
originalName: string;
|
|
85
|
+
totalBytes: number;
|
|
86
|
+
offset: number;
|
|
87
|
+
bytes: Uint8Array;
|
|
88
|
+
}
|
|
89
|
+
interface UploadProgress {
|
|
90
|
+
nextOffset: number;
|
|
91
|
+
staged?: StagedFile;
|
|
92
|
+
}
|
|
81
93
|
type SqlScalar = null | string | number;
|
|
82
94
|
interface SqlInput {
|
|
83
95
|
sql: string;
|
|
@@ -133,6 +145,14 @@ interface Transaction {
|
|
|
133
145
|
removeRelations(sourceObjectId: string, kind: 'reference'): void;
|
|
134
146
|
relation(sourceObjectId: string, sourceVersionId: string | null, target: VersionRef, kind: 'source' | 'input' | 'reference'): void;
|
|
135
147
|
}
|
|
148
|
+
/** Bytes supplied by an installed plugin, with build-time media metadata and digest. */
|
|
149
|
+
interface BundledFile {
|
|
150
|
+
fileId: string;
|
|
151
|
+
originalName: string;
|
|
152
|
+
mimeType: string;
|
|
153
|
+
sha256: string;
|
|
154
|
+
bytes: Uint8Array;
|
|
155
|
+
}
|
|
136
156
|
interface DataAPI {
|
|
137
157
|
readonly storeId: string;
|
|
138
158
|
readonly scope: Scope;
|
|
@@ -141,6 +161,7 @@ interface DataAPI {
|
|
|
141
161
|
items: RecordValue[];
|
|
142
162
|
nextOffset: number | null;
|
|
143
163
|
};
|
|
164
|
+
countVersionedRecords?(typeId: string): number;
|
|
144
165
|
query(input: SqlInput): Promise<SqlRow[]>;
|
|
145
166
|
mutate(input: MutationInput, call: CallContext): Promise<MutationResult>;
|
|
146
167
|
versions(id: string): VersionValue[];
|
|
@@ -160,7 +181,10 @@ interface DataAPI {
|
|
|
160
181
|
observedCount: number;
|
|
161
182
|
}[];
|
|
162
183
|
stage(source: AsyncIterable<Uint8Array>, originalName: string, actorId: string, options?: StageOptions): Promise<StagedFile>;
|
|
184
|
+
prepareBundledFiles(operationId: string, files: BundledFile[]): Promise<FileValue[]>;
|
|
163
185
|
stageText(text: string, actorId: string): Promise<StagedFile>;
|
|
186
|
+
/** Bounded JSON transport into the existing staging area; does not publish a version. */
|
|
187
|
+
stageChunk(input: UploadChunk, actorId: string): Promise<UploadProgress>;
|
|
164
188
|
publish(stagingIds: string[], objectId: string, versionId: string, operationId: string, actorId: string, fileRoles?: string[]): Promise<{
|
|
165
189
|
files: FileValue[];
|
|
166
190
|
details: any;
|
|
@@ -253,6 +277,16 @@ declare const sequenceVideoInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
253
277
|
}, z.core.$strict>;
|
|
254
278
|
}, z.core.$strict>], "kind">;
|
|
255
279
|
type SequenceVideoInput = z.infer<typeof sequenceVideoInput>;
|
|
280
|
+
declare const colorAdjustment: z.ZodObject<{
|
|
281
|
+
brightness: z.ZodNumber;
|
|
282
|
+
contrast: z.ZodNumber;
|
|
283
|
+
saturation: z.ZodNumber;
|
|
284
|
+
}, z.core.$strict>;
|
|
285
|
+
declare const neutralColor: {
|
|
286
|
+
readonly brightness: 0;
|
|
287
|
+
readonly contrast: 1;
|
|
288
|
+
readonly saturation: 1;
|
|
289
|
+
};
|
|
256
290
|
declare const recipe: z.ZodObject<{
|
|
257
291
|
trim: z.ZodObject<{
|
|
258
292
|
inMs: z.ZodNumber;
|
|
@@ -264,8 +298,21 @@ declare const recipe: z.ZodObject<{
|
|
|
264
298
|
width: z.ZodNumber;
|
|
265
299
|
height: z.ZodNumber;
|
|
266
300
|
}, z.core.$strict>;
|
|
301
|
+
color: z.ZodOptional<z.ZodObject<{
|
|
302
|
+
brightness: z.ZodNumber;
|
|
303
|
+
contrast: z.ZodNumber;
|
|
304
|
+
saturation: z.ZodNumber;
|
|
305
|
+
}, z.core.$strict>>;
|
|
306
|
+
speed: z.ZodOptional<z.ZodNumber>;
|
|
267
307
|
}, z.core.$strict>;
|
|
268
308
|
type Recipe = z.infer<typeof recipe>;
|
|
309
|
+
declare function recipeDurationMs(value: Recipe): number;
|
|
310
|
+
declare const videoEditorTitles: {
|
|
311
|
+
readonly crop: "Crop Video";
|
|
312
|
+
readonly trim: "Trim Video";
|
|
313
|
+
readonly color: "Adjust Color";
|
|
314
|
+
readonly speed: "Video Speed";
|
|
315
|
+
};
|
|
269
316
|
declare const pixelRect: z.ZodObject<{
|
|
270
317
|
x: z.ZodNumber;
|
|
271
318
|
y: z.ZodNumber;
|
|
@@ -326,6 +373,12 @@ declare const editDescriptor: z.ZodObject<{
|
|
|
326
373
|
width: z.ZodNumber;
|
|
327
374
|
height: z.ZodNumber;
|
|
328
375
|
}, z.core.$strict>;
|
|
376
|
+
color: z.ZodOptional<z.ZodObject<{
|
|
377
|
+
brightness: z.ZodNumber;
|
|
378
|
+
contrast: z.ZodNumber;
|
|
379
|
+
saturation: z.ZodNumber;
|
|
380
|
+
}, z.core.$strict>>;
|
|
381
|
+
speed: z.ZodOptional<z.ZodNumber>;
|
|
329
382
|
}, z.core.$strict>;
|
|
330
383
|
geometry: z.ZodObject<{
|
|
331
384
|
displayWidth: z.ZodNumber;
|
|
@@ -400,6 +453,12 @@ declare const saveEdit: z.ZodObject<{
|
|
|
400
453
|
width: z.ZodNumber;
|
|
401
454
|
height: z.ZodNumber;
|
|
402
455
|
}, z.core.$strict>;
|
|
456
|
+
color: z.ZodOptional<z.ZodObject<{
|
|
457
|
+
brightness: z.ZodNumber;
|
|
458
|
+
contrast: z.ZodNumber;
|
|
459
|
+
saturation: z.ZodNumber;
|
|
460
|
+
}, z.core.$strict>>;
|
|
461
|
+
speed: z.ZodOptional<z.ZodNumber>;
|
|
403
462
|
}, z.core.$strict>;
|
|
404
463
|
editId: z.ZodOptional<z.ZodUUID>;
|
|
405
464
|
expectedRevision: z.ZodOptional<z.ZodNumber>;
|
|
@@ -431,6 +490,36 @@ declare const canvas: z.ZodObject<{
|
|
|
431
490
|
width: z.ZodNumber;
|
|
432
491
|
height: z.ZodNumber;
|
|
433
492
|
}, z.core.$strict>;
|
|
493
|
+
declare const exportFormat: z.ZodEnum<{
|
|
494
|
+
h264: "h264";
|
|
495
|
+
hevc: "hevc";
|
|
496
|
+
vp9: "vp9";
|
|
497
|
+
}>;
|
|
498
|
+
declare const exportSettings: z.ZodObject<{
|
|
499
|
+
format: z.ZodEnum<{
|
|
500
|
+
h264: "h264";
|
|
501
|
+
hevc: "hevc";
|
|
502
|
+
vp9: "vp9";
|
|
503
|
+
}>;
|
|
504
|
+
aspect: z.ZodEnum<{
|
|
505
|
+
source: "source";
|
|
506
|
+
"16:9": "16:9";
|
|
507
|
+
"9:16": "9:16";
|
|
508
|
+
"1:1": "1:1";
|
|
509
|
+
"4:3": "4:3";
|
|
510
|
+
"3:4": "3:4";
|
|
511
|
+
"21:9": "21:9";
|
|
512
|
+
}>;
|
|
513
|
+
resolution: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<480>, z.ZodLiteral<720>, z.ZodLiteral<1080>, z.ZodLiteral<2160>]>;
|
|
514
|
+
frameRate: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<24>, z.ZodLiteral<25>, z.ZodLiteral<30>, z.ZodLiteral<50>, z.ZodLiteral<60>]>;
|
|
515
|
+
quality: z.ZodEnum<{
|
|
516
|
+
small: "small";
|
|
517
|
+
high: "high";
|
|
518
|
+
standard: "standard";
|
|
519
|
+
}>;
|
|
520
|
+
audio: z.ZodBoolean;
|
|
521
|
+
}, z.core.$strict>;
|
|
522
|
+
type ExportSettings = z.infer<typeof exportSettings>;
|
|
434
523
|
declare const processSequence: z.ZodObject<{
|
|
435
524
|
inputs: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
436
525
|
kind: z.ZodLiteral<"source">;
|
|
@@ -456,6 +545,30 @@ declare const processSequence: z.ZodObject<{
|
|
|
456
545
|
width: z.ZodNumber;
|
|
457
546
|
height: z.ZodNumber;
|
|
458
547
|
}, z.core.$strict>;
|
|
548
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
549
|
+
format: z.ZodEnum<{
|
|
550
|
+
h264: "h264";
|
|
551
|
+
hevc: "hevc";
|
|
552
|
+
vp9: "vp9";
|
|
553
|
+
}>;
|
|
554
|
+
aspect: z.ZodEnum<{
|
|
555
|
+
source: "source";
|
|
556
|
+
"16:9": "16:9";
|
|
557
|
+
"9:16": "9:16";
|
|
558
|
+
"1:1": "1:1";
|
|
559
|
+
"4:3": "4:3";
|
|
560
|
+
"3:4": "3:4";
|
|
561
|
+
"21:9": "21:9";
|
|
562
|
+
}>;
|
|
563
|
+
resolution: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<480>, z.ZodLiteral<720>, z.ZodLiteral<1080>, z.ZodLiteral<2160>]>;
|
|
564
|
+
frameRate: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<24>, z.ZodLiteral<25>, z.ZodLiteral<30>, z.ZodLiteral<50>, z.ZodLiteral<60>]>;
|
|
565
|
+
quality: z.ZodEnum<{
|
|
566
|
+
small: "small";
|
|
567
|
+
high: "high";
|
|
568
|
+
standard: "standard";
|
|
569
|
+
}>;
|
|
570
|
+
audio: z.ZodBoolean;
|
|
571
|
+
}, z.core.$strict>>;
|
|
459
572
|
retryOfJobId: z.ZodOptional<z.ZodUUID>;
|
|
460
573
|
}, z.core.$strict>;
|
|
461
574
|
type ProcessVideo = z.infer<typeof processVideo>;
|
|
@@ -518,6 +631,30 @@ declare const mediaRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
518
631
|
width: z.ZodNumber;
|
|
519
632
|
height: z.ZodNumber;
|
|
520
633
|
}, z.core.$strict>;
|
|
634
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
635
|
+
format: z.ZodEnum<{
|
|
636
|
+
h264: "h264";
|
|
637
|
+
hevc: "hevc";
|
|
638
|
+
vp9: "vp9";
|
|
639
|
+
}>;
|
|
640
|
+
aspect: z.ZodEnum<{
|
|
641
|
+
source: "source";
|
|
642
|
+
"16:9": "16:9";
|
|
643
|
+
"9:16": "9:16";
|
|
644
|
+
"1:1": "1:1";
|
|
645
|
+
"4:3": "4:3";
|
|
646
|
+
"3:4": "3:4";
|
|
647
|
+
"21:9": "21:9";
|
|
648
|
+
}>;
|
|
649
|
+
resolution: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<480>, z.ZodLiteral<720>, z.ZodLiteral<1080>, z.ZodLiteral<2160>]>;
|
|
650
|
+
frameRate: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<24>, z.ZodLiteral<25>, z.ZodLiteral<30>, z.ZodLiteral<50>, z.ZodLiteral<60>]>;
|
|
651
|
+
quality: z.ZodEnum<{
|
|
652
|
+
small: "small";
|
|
653
|
+
high: "high";
|
|
654
|
+
standard: "standard";
|
|
655
|
+
}>;
|
|
656
|
+
audio: z.ZodBoolean;
|
|
657
|
+
}, z.core.$strict>>;
|
|
521
658
|
retryOfJobId: z.ZodOptional<z.ZodUUID>;
|
|
522
659
|
}, z.core.$strict>;
|
|
523
660
|
}, z.core.$strict>], "operation">;
|
|
@@ -598,6 +735,30 @@ declare const jobsQuery: z.ZodObject<{
|
|
|
598
735
|
width: z.ZodNumber;
|
|
599
736
|
height: z.ZodNumber;
|
|
600
737
|
}, z.core.$strict>;
|
|
738
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
739
|
+
format: z.ZodEnum<{
|
|
740
|
+
h264: "h264";
|
|
741
|
+
hevc: "hevc";
|
|
742
|
+
vp9: "vp9";
|
|
743
|
+
}>;
|
|
744
|
+
aspect: z.ZodEnum<{
|
|
745
|
+
source: "source";
|
|
746
|
+
"16:9": "16:9";
|
|
747
|
+
"9:16": "9:16";
|
|
748
|
+
"1:1": "1:1";
|
|
749
|
+
"4:3": "4:3";
|
|
750
|
+
"3:4": "3:4";
|
|
751
|
+
"21:9": "21:9";
|
|
752
|
+
}>;
|
|
753
|
+
resolution: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<480>, z.ZodLiteral<720>, z.ZodLiteral<1080>, z.ZodLiteral<2160>]>;
|
|
754
|
+
frameRate: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<24>, z.ZodLiteral<25>, z.ZodLiteral<30>, z.ZodLiteral<50>, z.ZodLiteral<60>]>;
|
|
755
|
+
quality: z.ZodEnum<{
|
|
756
|
+
small: "small";
|
|
757
|
+
high: "high";
|
|
758
|
+
standard: "standard";
|
|
759
|
+
}>;
|
|
760
|
+
audio: z.ZodBoolean;
|
|
761
|
+
}, z.core.$strict>>;
|
|
601
762
|
retryOfJobId: z.ZodOptional<z.ZodUUID>;
|
|
602
763
|
}, z.core.$strict>]>;
|
|
603
764
|
}, z.core.$strict>>;
|
|
@@ -606,9 +767,30 @@ interface JobPage {
|
|
|
606
767
|
items: MediaJob[];
|
|
607
768
|
nextOffset: number | null;
|
|
608
769
|
}
|
|
770
|
+
interface VideoExportProps {
|
|
771
|
+
title: string;
|
|
772
|
+
preview: React.ReactNode;
|
|
773
|
+
aspectRatio?: string;
|
|
774
|
+
canvas?: ProcessSequence['canvas'];
|
|
775
|
+
issue?: string;
|
|
776
|
+
legacyTracking?: {
|
|
777
|
+
jobId?: string;
|
|
778
|
+
pending?: {
|
|
779
|
+
key: string;
|
|
780
|
+
request: MediaRequest;
|
|
781
|
+
};
|
|
782
|
+
recoverIntent?(): Promise<{
|
|
783
|
+
key: string;
|
|
784
|
+
request: MediaRequest;
|
|
785
|
+
}>;
|
|
786
|
+
};
|
|
787
|
+
prepare(): Promise<Omit<ProcessSequence, 'outputName'>>;
|
|
788
|
+
resolveDownload(result: VideoFileRef, name?: string): Promise<string | null | undefined>;
|
|
789
|
+
onClose(): void;
|
|
790
|
+
}
|
|
609
791
|
interface VideoEditorProps {
|
|
610
792
|
input: VideoInput;
|
|
611
|
-
mode:
|
|
793
|
+
mode: keyof typeof videoEditorTitles;
|
|
612
794
|
onApply(saved: SavedEdit): Promise<void>;
|
|
613
795
|
onClose(): void;
|
|
614
796
|
}
|
|
@@ -630,7 +812,10 @@ interface VideoCompareProps {
|
|
|
630
812
|
label: string;
|
|
631
813
|
input: VideoInput;
|
|
632
814
|
context?: CompareSlot['context'];
|
|
815
|
+
preview?: ReactNode;
|
|
633
816
|
}[];
|
|
817
|
+
/** Allow an occupied candidate to exchange places with the target column. */
|
|
818
|
+
allowCandidateSwap?: boolean;
|
|
634
819
|
onRequestReplacement?(slotId: string): Promise<VideoInput | null>;
|
|
635
820
|
onOpenDetails(input: VideoInput, back: {
|
|
636
821
|
slots: CompareSlot[];
|
|
@@ -664,4 +849,4 @@ interface MediaToolsClient {
|
|
|
664
849
|
resolve(input: VideoInput): Promise<ResolvedVideo>;
|
|
665
850
|
}
|
|
666
851
|
|
|
667
|
-
export { type AcceptedJob, type CompareSlot, Config, type EditDescriptor, type EditReadData, type Geometry, type JobPage, type JobState, type MediaJob, type MediaJobsProps, type MediaRequest, type MediaToolsClient, type MediaToolsConfig, type MediaToolsService, type PixelRect, type ProcessSequence, type ProcessVideo, type Recipe, type ResolvedVideo, type SaveEdit, type SavedEdit, type SequenceVideoInput, type VideoCompareProps, type VideoEditorProps, type VideoFileRef, type VideoInput, type VideoMetadata, canvas, editDescriptor, geometry, jobStates, jobsQuery, mediaError, mediaRequest, metadata, normalizeRecipe, packageVersion, processSequence, processVideo, readSavedEdit, recipe, sameFile, saveEdit, versionRef, videoFileRef, videoInput };
|
|
852
|
+
export { type AcceptedJob, type CompareSlot, Config, type EditDescriptor, type EditReadData, type ExportSettings, type Geometry, type JobPage, type JobState, type MediaJob, type MediaJobsProps, type MediaRequest, type MediaToolsClient, type MediaToolsConfig, type MediaToolsService, type PixelRect, type ProcessSequence, type ProcessVideo, type Recipe, type ResolvedVideo, type SaveEdit, type SavedEdit, type SequenceVideoInput, type VideoCompareProps, type VideoEditorProps, type VideoExportProps, type VideoFileRef, type VideoInput, type VideoMetadata, canvas, colorAdjustment, editDescriptor, exportFormat, exportSettings, geometry, jobStates, jobsQuery, mediaError, mediaRequest, metadata, neutralColor, normalizeRecipe, packageVersion, processSequence, processVideo, readSavedEdit, recipe, recipeDurationMs, sameFile, saveEdit, versionRef, videoEditorTitles, videoFileRef, videoInput };
|
package/dist/shared.js
CHANGED
|
@@ -1,3 +1,36 @@
|
|
|
1
|
+
// packages/media-tools/src/export-settings.ts
|
|
2
|
+
var exportProfiles = {
|
|
3
|
+
h264: {
|
|
4
|
+
label: "MP4 \xB7 H.264",
|
|
5
|
+
extension: "mp4",
|
|
6
|
+
container: "mp4",
|
|
7
|
+
codec: "h264",
|
|
8
|
+
encoder: "libx264",
|
|
9
|
+
audio: "aac",
|
|
10
|
+
crf: [18, 23, 28]
|
|
11
|
+
},
|
|
12
|
+
hevc: {
|
|
13
|
+
label: "MP4 \xB7 H.265",
|
|
14
|
+
extension: "mp4",
|
|
15
|
+
container: "mp4",
|
|
16
|
+
codec: "hevc",
|
|
17
|
+
encoder: "libx265",
|
|
18
|
+
audio: "aac",
|
|
19
|
+
crf: [20, 25, 30]
|
|
20
|
+
},
|
|
21
|
+
vp9: {
|
|
22
|
+
label: "WebM \xB7 VP9",
|
|
23
|
+
extension: "webm",
|
|
24
|
+
container: "webm",
|
|
25
|
+
codec: "vp9",
|
|
26
|
+
encoder: "libvpx-vp9",
|
|
27
|
+
audio: "opus",
|
|
28
|
+
crf: [23, 31, 39]
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
var exportAspects = ["source", "16:9", "9:16", "1:1", "4:3", "3:4", "21:9"];
|
|
32
|
+
var exportQualities = ["high", "standard", "small"];
|
|
33
|
+
|
|
1
34
|
// packages/media-tools/src/shared.ts
|
|
2
35
|
import { z, PluginError } from "vivix-studio/sdk/shared";
|
|
3
36
|
var packageVersion = "0.1.22-ecommerce.20261110.1";
|
|
@@ -17,6 +50,12 @@ var sequenceVideoInput = z.discriminatedUnion("kind", [
|
|
|
17
50
|
sourceInput.extend({ trimEndMs: z.number().int().positive().optional() }),
|
|
18
51
|
editInput
|
|
19
52
|
]);
|
|
53
|
+
var colorAdjustment = z.object({
|
|
54
|
+
brightness: z.number().finite().min(-0.5).max(0.5),
|
|
55
|
+
contrast: z.number().finite().min(0).max(2),
|
|
56
|
+
saturation: z.number().finite().min(0).max(2)
|
|
57
|
+
}).strict();
|
|
58
|
+
var neutralColor = { brightness: 0, contrast: 1, saturation: 1 };
|
|
20
59
|
var recipe = z.object({
|
|
21
60
|
trim: z.object({ inMs: z.number().int().nonnegative(), outMs: z.number().int().positive() }).strict(),
|
|
22
61
|
crop: z.object({
|
|
@@ -24,13 +63,24 @@ var recipe = z.object({
|
|
|
24
63
|
y: z.number().finite().nonnegative(),
|
|
25
64
|
width: z.number().finite().positive().max(1),
|
|
26
65
|
height: z.number().finite().positive().max(1)
|
|
27
|
-
}).strict()
|
|
66
|
+
}).strict(),
|
|
67
|
+
color: colorAdjustment.optional(),
|
|
68
|
+
speed: z.number().finite().min(0.25).max(4).optional()
|
|
28
69
|
}).strict().superRefine((v, c) => {
|
|
29
70
|
if (v.trim.inMs >= v.trim.outMs)
|
|
30
71
|
c.addIssue({ code: "custom", message: "The selected interval must have positive duration." });
|
|
31
72
|
if (v.crop.x + v.crop.width > 1 + 1e-9 || v.crop.y + v.crop.height > 1 + 1e-9)
|
|
32
73
|
c.addIssue({ code: "custom", message: "The crop must remain inside the source picture." });
|
|
33
74
|
});
|
|
75
|
+
function recipeDurationMs(value) {
|
|
76
|
+
return Math.max(1, Math.round((value.trim.outMs - value.trim.inMs) / (value.speed ?? 1)));
|
|
77
|
+
}
|
|
78
|
+
var videoEditorTitles = {
|
|
79
|
+
crop: "Crop Video",
|
|
80
|
+
trim: "Trim Video",
|
|
81
|
+
color: "Adjust Color",
|
|
82
|
+
speed: "Video Speed"
|
|
83
|
+
};
|
|
34
84
|
var pixelRect = z.object({
|
|
35
85
|
x: z.number().int().nonnegative(),
|
|
36
86
|
y: z.number().int().nonnegative(),
|
|
@@ -75,10 +125,35 @@ var canvas = z.object({ width: z.number().int().min(2).max(3840), height: z.numb
|
|
|
75
125
|
(v) => v.width % 2 === 0 && v.height % 2 === 0 && Math.min(v.width, v.height) <= 2160,
|
|
76
126
|
"Canvas dimensions must be even and within 3840 by 2160."
|
|
77
127
|
);
|
|
128
|
+
var exportFormat = z.enum(
|
|
129
|
+
Object.keys(exportProfiles)
|
|
130
|
+
);
|
|
131
|
+
var exportSettings = z.object({
|
|
132
|
+
format: exportFormat,
|
|
133
|
+
aspect: z.enum(exportAspects),
|
|
134
|
+
resolution: z.union([
|
|
135
|
+
z.literal("source"),
|
|
136
|
+
z.literal(480),
|
|
137
|
+
z.literal(720),
|
|
138
|
+
z.literal(1080),
|
|
139
|
+
z.literal(2160)
|
|
140
|
+
]),
|
|
141
|
+
frameRate: z.union([
|
|
142
|
+
z.literal("source"),
|
|
143
|
+
z.literal(24),
|
|
144
|
+
z.literal(25),
|
|
145
|
+
z.literal(30),
|
|
146
|
+
z.literal(50),
|
|
147
|
+
z.literal(60)
|
|
148
|
+
]),
|
|
149
|
+
quality: z.enum(exportQualities),
|
|
150
|
+
audio: z.boolean()
|
|
151
|
+
}).strict();
|
|
78
152
|
var processSequence = z.object({
|
|
79
153
|
inputs: z.array(sequenceVideoInput).min(1).max(64),
|
|
80
154
|
outputName,
|
|
81
155
|
canvas,
|
|
156
|
+
settings: exportSettings.optional(),
|
|
82
157
|
retryOfJobId: z.uuid().optional()
|
|
83
158
|
}).strict();
|
|
84
159
|
var mediaRequest = z.discriminatedUnion("operation", [
|
|
@@ -132,7 +207,9 @@ function normalizeRecipe(raw, displayWidth, displayHeight, durationMs) {
|
|
|
132
207
|
y: y / displayHeight,
|
|
133
208
|
width: pixelRect2.width / displayWidth,
|
|
134
209
|
height: pixelRect2.height / displayHeight
|
|
135
|
-
}
|
|
210
|
+
},
|
|
211
|
+
...value.color ? { color: { ...value.color } } : {},
|
|
212
|
+
...value.speed === void 0 ? {} : { speed: value.speed }
|
|
136
213
|
},
|
|
137
214
|
geometry: { displayWidth, displayHeight, pixelRect: pixelRect2 }
|
|
138
215
|
};
|
|
@@ -190,28 +267,34 @@ function readSavedEdit(data, raw) {
|
|
|
190
267
|
file: value.file,
|
|
191
268
|
recipe: value.recipe,
|
|
192
269
|
geometry: value.geometry,
|
|
193
|
-
effectiveDurationMs: value.recipe
|
|
270
|
+
effectiveDurationMs: recipeDurationMs(value.recipe)
|
|
194
271
|
};
|
|
195
272
|
}
|
|
196
273
|
export {
|
|
197
274
|
Config,
|
|
198
275
|
canvas,
|
|
276
|
+
colorAdjustment,
|
|
199
277
|
editDescriptor,
|
|
278
|
+
exportFormat,
|
|
279
|
+
exportSettings,
|
|
200
280
|
geometry,
|
|
201
281
|
jobStates,
|
|
202
282
|
jobsQuery,
|
|
203
283
|
mediaError,
|
|
204
284
|
mediaRequest,
|
|
205
285
|
metadata,
|
|
286
|
+
neutralColor,
|
|
206
287
|
normalizeRecipe,
|
|
207
288
|
packageVersion,
|
|
208
289
|
processSequence,
|
|
209
290
|
processVideo,
|
|
210
291
|
readSavedEdit,
|
|
211
292
|
recipe,
|
|
293
|
+
recipeDurationMs,
|
|
212
294
|
sameFile,
|
|
213
295
|
saveEdit,
|
|
214
296
|
versionRef,
|
|
297
|
+
videoEditorTitles,
|
|
215
298
|
videoFileRef,
|
|
216
299
|
videoInput
|
|
217
300
|
};
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: vivix-media-tools
|
|
3
|
-
description: Trim or crop fixed Studio video versions, compare candidates, and process or export video through the installed media-tools queue. Use for saved edit recipes, actual edited previews, sequence exports, and original-job recovery. Selection and storyboards remain with the calling project/workbench.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
1
|
# Edit, compare, and export Studio video
|
|
7
2
|
|
|
8
3
|
Discover the configured media instance through `plugin list` and `plugin describe`
|
|
9
|
-
for the actual project. Read the
|
|
4
|
+
for the actual project. Read the unified `vivix-studio` Skill
|
|
10
5
|
for page opening and chat presentation. Resolve exact saved source versions through
|
|
11
6
|
the calling project's operations. Instance IDs and candidate order are caller data.
|
|
12
7
|
|
|
@@ -17,6 +12,11 @@ range and preserves an existing crop unless the user asks to change it. A Crop
|
|
|
17
12
|
request changes framing and preserves the existing time range. For "the first
|
|
18
13
|
8 seconds", use `[0,8000)` milliseconds when the source is long enough.
|
|
19
14
|
|
|
15
|
+
Color adjusts `recipe.color` (brightness -0.5–0.5, contrast 0–2, saturation 0–2).
|
|
16
|
+
Speed adjusts `recipe.speed` (0.25–4×), including pitch-preserving audio. Preserve
|
|
17
|
+
the other recipe fields. Missing color and speed fields mean unchanged colors and
|
|
18
|
+
1× playback. Browser color preview is approximate; verify the processed output.
|
|
19
|
+
|
|
20
20
|
`edits.save` saves an immutable recipe; it does not encode a video or select a
|
|
21
21
|
candidate. Bind the returned edit through the caller's operation with its observed
|
|
22
22
|
revisions. A conflict retains the draft and saved edit. Reconcile the intended
|
|
@@ -25,7 +25,7 @@ source and current selection before another bind.
|
|
|
25
25
|
To deliver a playable edited result, use `video.process` or the caller's whole-film
|
|
26
26
|
export through `sequence.process`. Read the exact input/output schema. Save the
|
|
27
27
|
original intent and key, follow the accepted durable job, and present only its
|
|
28
|
-
actual succeeded result. Read [processing and recovery](
|
|
28
|
+
actual succeeded result. Read [processing and recovery](processing.md)
|
|
29
29
|
for format, aspect, queue, cancellation, and uncertain-response details.
|
|
30
30
|
|
|
31
31
|
## Compare
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vivix-labs/media-tools",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.20",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"files": [
|
|
12
12
|
"dist",
|
|
13
13
|
"studio-plugin.json",
|
|
14
|
-
"
|
|
14
|
+
"README.md",
|
|
15
|
+
"docs"
|
|
15
16
|
],
|
|
16
17
|
"engines": {
|
|
17
18
|
"node": ">=22.12.0"
|
|
@@ -37,9 +38,9 @@
|
|
|
37
38
|
"react-dom": "^19.0.0"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
|
-
"@vivix-labs/ui-system": "
|
|
41
|
+
"@vivix-labs/ui-system": "workspace:*"
|
|
41
42
|
},
|
|
42
43
|
"scripts": {
|
|
43
44
|
"build": "node ../../scripts/build-product-packages.mjs media-tools"
|
|
44
45
|
}
|
|
45
|
-
}
|
|
46
|
+
}
|
package/studio-plugin.json
CHANGED
|
Binary file
|
|
File without changes
|