@transloadit/node 4.10.6 → 4.10.7
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/alphalib/object.d.ts +3 -0
- package/dist/alphalib/object.d.ts.map +1 -1
- package/dist/alphalib/object.js +11 -0
- package/dist/alphalib/object.js.map +1 -1
- package/dist/alphalib/types/assemblyStatus.d.ts +8572 -4
- package/dist/alphalib/types/assemblyStatus.d.ts.map +1 -1
- package/dist/alphalib/types/assemblyStatus.js +17 -0
- package/dist/alphalib/types/assemblyStatus.js.map +1 -1
- package/dist/alphalib/types/robots/_instructions-primitives.d.ts +14 -9
- package/dist/alphalib/types/robots/_instructions-primitives.d.ts.map +1 -1
- package/dist/alphalib/types/robots/_instructions-primitives.js +34 -36
- package/dist/alphalib/types/robots/_instructions-primitives.js.map +1 -1
- package/dist/alphalib/types/robots/assembly-savejson.d.ts +79 -0
- package/dist/alphalib/types/robots/assembly-savejson.d.ts.map +1 -1
- package/dist/alphalib/types/robots/assembly-savejson.js +7 -0
- package/dist/alphalib/types/robots/assembly-savejson.js.map +1 -1
- package/dist/alphalib/types/robots/file-filter.d.ts +2 -0
- package/dist/alphalib/types/robots/file-filter.d.ts.map +1 -1
- package/dist/alphalib/types/robots/file-filter.js +2 -1
- package/dist/alphalib/types/robots/file-filter.js.map +1 -1
- package/dist/alphalib/types/robots/http-import.d.ts +12 -0
- package/dist/alphalib/types/robots/http-import.d.ts.map +1 -1
- package/dist/alphalib/types/robots/http-import.js +8 -0
- package/dist/alphalib/types/robots/http-import.js.map +1 -1
- package/dist/alphalib/types/robots/image-facedetect.d.ts +28 -0
- package/dist/alphalib/types/robots/image-facedetect.d.ts.map +1 -1
- package/dist/alphalib/types/robots/image-facedetect.js +19 -1
- package/dist/alphalib/types/robots/image-facedetect.js.map +1 -1
- package/dist/alphalib/types/robots/speech-transcribe.d.ts +38 -8
- package/dist/alphalib/types/robots/speech-transcribe.d.ts.map +1 -1
- package/dist/alphalib/types/robots/speech-transcribe.js +60 -5
- package/dist/alphalib/types/robots/speech-transcribe.js.map +1 -1
- package/dist/alphalib/types/robots/video-encode.d.ts.map +1 -1
- package/dist/alphalib/types/robots/video-encode.js +2 -0
- package/dist/alphalib/types/robots/video-encode.js.map +1 -1
- package/package.json +1 -1
- package/src/alphalib/object.ts +26 -0
- package/src/alphalib/types/assemblyStatus.ts +20 -0
- package/src/alphalib/types/robots/_instructions-primitives.ts +63 -56
- package/src/alphalib/types/robots/assembly-savejson.ts +21 -0
- package/src/alphalib/types/robots/file-filter.ts +12 -1
- package/src/alphalib/types/robots/http-import.ts +8 -0
- package/src/alphalib/types/robots/image-facedetect.ts +24 -1
- package/src/alphalib/types/robots/speech-transcribe.ts +60 -5
- package/src/alphalib/types/robots/video-encode.ts +2 -0
|
@@ -7,6 +7,7 @@ export const assemblyBusyCodeSchema = z.enum([
|
|
|
7
7
|
'ASSEMBLY_EXECUTING',
|
|
8
8
|
'ASSEMBLY_REPLAYING',
|
|
9
9
|
])
|
|
10
|
+
export type AssemblyBusyCode = z.infer<typeof assemblyBusyCodeSchema>
|
|
10
11
|
|
|
11
12
|
export const assemblyStatusOkCodeSchema = z.enum([
|
|
12
13
|
'ASSEMBLY_CANCELED',
|
|
@@ -19,6 +20,7 @@ export const assemblyStatusOkCodeSchema = z.enum([
|
|
|
19
20
|
// 'ASSEMBLY_FILE_ACCEPTED',
|
|
20
21
|
// 'ASSEMBLY_FILE_RESERVED',
|
|
21
22
|
])
|
|
23
|
+
export type AssemblyStatusOkCode = z.infer<typeof assemblyStatusOkCodeSchema>
|
|
22
24
|
|
|
23
25
|
export const assemblyStatusErrCodeSchema = z.enum([
|
|
24
26
|
'ADMIN_PERMISSIONS_REQUIRED',
|
|
@@ -351,6 +353,7 @@ export const assemblyStatusErrCodeSchema = z.enum([
|
|
|
351
353
|
'YOUTUBE_STORE_PROBLEM_SENDING_FILE',
|
|
352
354
|
'YOUTUBE_STORE_VALIDATION',
|
|
353
355
|
])
|
|
356
|
+
export type AssemblyStatusErrCode = z.infer<typeof assemblyStatusErrCodeSchema>
|
|
354
357
|
|
|
355
358
|
const assemblyStatusMetaSchema = z
|
|
356
359
|
.object({
|
|
@@ -455,6 +458,22 @@ const assemblyStatusMetaSchema = z
|
|
|
455
458
|
num_subtitles: z.union([z.number(), z.null()]).optional(),
|
|
456
459
|
bit_depth: z.union([z.number(), z.null()]).optional(),
|
|
457
460
|
seekable: z.union([z.boolean(), z.null()]).optional(),
|
|
461
|
+
interlaced: z.boolean().nullable().optional(),
|
|
462
|
+
field_order: z.string().nullable().optional(),
|
|
463
|
+
interlace_detection: z
|
|
464
|
+
.object({
|
|
465
|
+
sampled_frames: z.number().optional(),
|
|
466
|
+
tff: z.number().optional(),
|
|
467
|
+
bff: z.number().optional(),
|
|
468
|
+
progressive: z.number().optional(),
|
|
469
|
+
undetermined: z.number().optional(),
|
|
470
|
+
confidence: z.number().optional(),
|
|
471
|
+
method: z.string().optional(),
|
|
472
|
+
ffprobe_field_order: z.string().nullable().optional(),
|
|
473
|
+
})
|
|
474
|
+
.passthrough()
|
|
475
|
+
.nullable()
|
|
476
|
+
.optional(),
|
|
458
477
|
pixel_format: z.union([z.string(), z.null()]).optional(),
|
|
459
478
|
reference_count: z.union([z.number(), z.null()]).optional(),
|
|
460
479
|
time_base: z.union([z.string(), z.null()]).optional(),
|
|
@@ -740,6 +759,7 @@ export const assemblyStatusBaseSchema = z.object({
|
|
|
740
759
|
notify_status: z.string().nullable().optional(),
|
|
741
760
|
notify_response_code: z.number().nullable().optional(),
|
|
742
761
|
notify_response_data: z.string().nullable().optional(),
|
|
762
|
+
notify_error: z.string().nullable().optional(),
|
|
743
763
|
notify_duration: z.number().nullable().optional(),
|
|
744
764
|
last_job_completed: z.string().nullable().optional(),
|
|
745
765
|
fields: z.record(z.unknown()).optional(),
|
|
@@ -1682,59 +1682,59 @@ export const filterExpression = z.union([
|
|
|
1682
1682
|
z.array(z.union([z.string(), z.number(), z.null()])),
|
|
1683
1683
|
])
|
|
1684
1684
|
|
|
1685
|
-
export type
|
|
1686
|
-
export const
|
|
1687
|
-
z.
|
|
1688
|
-
z.
|
|
1689
|
-
z.
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
),
|
|
1727
|
-
z
|
|
1728
|
-
.literal('!empty')
|
|
1729
|
-
.describe(
|
|
1730
|
-
'Check if the left element is an array with members, an object with at least one property, a non-empty string, a number that does not equal zero or the boolean true. Leave the third element of the array to be an empty string. It won’t be evaluated.',
|
|
1731
|
-
),
|
|
1732
|
-
]),
|
|
1733
|
-
filterExpression,
|
|
1734
|
-
]),
|
|
1735
|
-
),
|
|
1685
|
+
export type FilterConditionOperator = z.infer<typeof filterConditionOperatorSchema>
|
|
1686
|
+
export const filterConditionOperatorSchema = z.union([
|
|
1687
|
+
z.literal('=').describe('Equals without type check'),
|
|
1688
|
+
z.literal('==').describe('Equals without type check'),
|
|
1689
|
+
z.literal('===').describe('Strict equals with type check'),
|
|
1690
|
+
z.literal('<').describe('Less than'),
|
|
1691
|
+
z.literal('>').describe('Greater than'),
|
|
1692
|
+
z.literal('<=').describe('Less or equal'),
|
|
1693
|
+
z.literal('>=').describe('Greater or equal'),
|
|
1694
|
+
z.literal('!=').describe('Simple inequality check without type check'),
|
|
1695
|
+
z.literal('!==').describe('Strict inequality check with type check'),
|
|
1696
|
+
z
|
|
1697
|
+
.literal('regex')
|
|
1698
|
+
.describe(
|
|
1699
|
+
'Case-insensitive regular expression based on [RE2](https://github.com/google/re2) `.match()`',
|
|
1700
|
+
),
|
|
1701
|
+
z
|
|
1702
|
+
.literal('!regex')
|
|
1703
|
+
.describe(
|
|
1704
|
+
'Case-insensitive regular expression based on [RE2](https://github.com/google/re2) `!.match()`',
|
|
1705
|
+
),
|
|
1706
|
+
z
|
|
1707
|
+
.literal('includes')
|
|
1708
|
+
.describe(
|
|
1709
|
+
'Check if the right element is included in the array, which is represented by the left element',
|
|
1710
|
+
),
|
|
1711
|
+
z
|
|
1712
|
+
.literal('!includes')
|
|
1713
|
+
.describe(
|
|
1714
|
+
'Check if the right element is not included in the array, which is represented by the left element',
|
|
1715
|
+
),
|
|
1716
|
+
z
|
|
1717
|
+
.literal('empty')
|
|
1718
|
+
.describe(
|
|
1719
|
+
'Check if the left element is an empty array, an object without properties, an empty string, the number zero or the boolean false. Leave the third element of the array to be an empty string. It won’t be evaluated.',
|
|
1720
|
+
),
|
|
1721
|
+
z
|
|
1722
|
+
.literal('!empty')
|
|
1723
|
+
.describe(
|
|
1724
|
+
'Check if the left element is an array with members, an object with at least one property, a non-empty string, a number that does not equal zero or the boolean true. Leave the third element of the array to be an empty string. It won’t be evaluated.',
|
|
1725
|
+
),
|
|
1736
1726
|
])
|
|
1737
1727
|
|
|
1728
|
+
export type FilterConditionPart = z.infer<typeof filterConditionPartSchema>
|
|
1729
|
+
export const filterConditionPartSchema = z.tuple([
|
|
1730
|
+
filterExpression,
|
|
1731
|
+
filterConditionOperatorSchema,
|
|
1732
|
+
filterExpression,
|
|
1733
|
+
])
|
|
1734
|
+
|
|
1735
|
+
export type FilterCondition = z.infer<typeof filterCondition>
|
|
1736
|
+
export const filterCondition = z.union([z.null(), z.string(), z.array(filterConditionPartSchema)])
|
|
1737
|
+
|
|
1738
1738
|
/**
|
|
1739
1739
|
* Parameters specific to the /video/encode robot. Useful for typing robots that pass files to /video/encode.
|
|
1740
1740
|
*/
|
|
@@ -1913,10 +1913,17 @@ Delta to apply to segment duration. This is optional and allows fine-tuning of s
|
|
|
1913
1913
|
})
|
|
1914
1914
|
.strict()
|
|
1915
1915
|
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1916
|
+
export type NormalizedUseStepName = string | undefined
|
|
1917
|
+
|
|
1918
|
+
export interface NormalizedUseStep {
|
|
1919
|
+
as?: unknown[]
|
|
1920
|
+
fields?: unknown[]
|
|
1921
|
+
name: NormalizedUseStepName
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1920
1924
|
export interface NormalizedUse {
|
|
1921
|
-
|
|
1925
|
+
bundle_steps: boolean
|
|
1926
|
+
fields: true | unknown[]
|
|
1927
|
+
group_by_original: boolean
|
|
1928
|
+
steps: NormalizedUseStep[]
|
|
1922
1929
|
}
|
|
@@ -46,9 +46,20 @@ TODO: Add robot description here
|
|
|
46
46
|
})
|
|
47
47
|
.strict()
|
|
48
48
|
|
|
49
|
+
export const robotAssemblySavejsonInstructionsWithHiddenFieldsSchema =
|
|
50
|
+
robotAssemblySavejsonInstructionsSchema.extend({
|
|
51
|
+
assembly_id: z.string().optional(),
|
|
52
|
+
expiry: z.string().optional(),
|
|
53
|
+
instance: z.string().optional(),
|
|
54
|
+
status: z.unknown().optional(),
|
|
55
|
+
})
|
|
56
|
+
|
|
49
57
|
export type RobotAssemblySavejsonInstructions = z.infer<
|
|
50
58
|
typeof robotAssemblySavejsonInstructionsSchema
|
|
51
59
|
>
|
|
60
|
+
export type RobotAssemblySavejsonInstructionsWithHiddenFields = z.infer<
|
|
61
|
+
typeof robotAssemblySavejsonInstructionsWithHiddenFieldsSchema
|
|
62
|
+
>
|
|
52
63
|
|
|
53
64
|
export const interpolatableRobotAssemblySavejsonInstructionsSchema = interpolateRobot(
|
|
54
65
|
robotAssemblySavejsonInstructionsSchema,
|
|
@@ -59,3 +70,13 @@ export type InterpolatableRobotAssemblySavejsonInstructions =
|
|
|
59
70
|
export type InterpolatableRobotAssemblySavejsonInstructionsInput = z.input<
|
|
60
71
|
typeof interpolatableRobotAssemblySavejsonInstructionsSchema
|
|
61
72
|
>
|
|
73
|
+
|
|
74
|
+
export const interpolatableRobotAssemblySavejsonInstructionsWithHiddenFieldsSchema =
|
|
75
|
+
interpolateRobot(robotAssemblySavejsonInstructionsWithHiddenFieldsSchema)
|
|
76
|
+
export type InterpolatableRobotAssemblySavejsonInstructionsWithHiddenFields = z.infer<
|
|
77
|
+
typeof interpolatableRobotAssemblySavejsonInstructionsWithHiddenFieldsSchema
|
|
78
|
+
>
|
|
79
|
+
|
|
80
|
+
export type InterpolatableRobotAssemblySavejsonInstructionsWithHiddenFieldsInput = z.input<
|
|
81
|
+
typeof interpolatableRobotAssemblySavejsonInstructionsWithHiddenFieldsSchema
|
|
82
|
+
>
|
|
@@ -9,6 +9,17 @@ import {
|
|
|
9
9
|
robotUse,
|
|
10
10
|
} from './_instructions-primitives.ts'
|
|
11
11
|
|
|
12
|
+
export type {
|
|
13
|
+
FilterCondition,
|
|
14
|
+
FilterConditionOperator,
|
|
15
|
+
FilterConditionPart,
|
|
16
|
+
} from './_instructions-primitives.ts'
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
filterConditionOperatorSchema,
|
|
20
|
+
filterConditionPartSchema,
|
|
21
|
+
} from './_instructions-primitives.ts'
|
|
22
|
+
|
|
12
23
|
export const meta: RobotMetaInput = {
|
|
13
24
|
bytescount: 0,
|
|
14
25
|
discount_factor: 0,
|
|
@@ -71,7 +82,7 @@ Passing JavaScript allows you to implement logic as complex as you wish, however
|
|
|
71
82
|
The \`accepts\` and \`declines\` parameters can each be set to an array of arrays with three members:
|
|
72
83
|
|
|
73
84
|
1. A value or job variable, such as \`\${file.mime}\`
|
|
74
|
-
2. One of the following operators: \`==\`, \`===\`, \`<\`, \`>\`, \`<=\`, \`>=\`, \`!=\`, \`!==\`, \`regex\`, \`!regex\`, \`includes\`, \`!includes\`
|
|
85
|
+
2. One of the following operators: \`=\`, \`==\`, \`===\`, \`<\`, \`>\`, \`<=\`, \`>=\`, \`!=\`, \`!==\`, \`regex\`, \`!regex\`, \`includes\`, \`!includes\`, \`empty\`, \`!empty\`
|
|
75
86
|
3. A value or job variable, such as \`50\` or \`"foo"\`
|
|
76
87
|
|
|
77
88
|
Examples:
|
|
@@ -103,6 +103,14 @@ Setting this to \`"meta"\` will still import the file on metadata extraction err
|
|
|
103
103
|
.default(false)
|
|
104
104
|
.describe(`
|
|
105
105
|
Disable the internal retry mechanism, and fail immediately if a resource can't be imported. This can be useful for performance critical applications.
|
|
106
|
+
`),
|
|
107
|
+
max_file_size: z
|
|
108
|
+
.number()
|
|
109
|
+
.int()
|
|
110
|
+
.positive()
|
|
111
|
+
.optional()
|
|
112
|
+
.describe(`
|
|
113
|
+
Maximum allowed size in bytes for each imported file. If the remote server reports a larger file size, the import is rejected before the download starts. If the remote server does not report a size upfront, the download is aborted once this limit is exceeded.
|
|
106
114
|
`),
|
|
107
115
|
return_file_stubs,
|
|
108
116
|
range: z
|
|
@@ -9,6 +9,29 @@ import {
|
|
|
9
9
|
robotUse,
|
|
10
10
|
} from './_instructions-primitives.ts'
|
|
11
11
|
|
|
12
|
+
export const imageFacedetectFaceSelectionModes = [
|
|
13
|
+
'each',
|
|
14
|
+
'group',
|
|
15
|
+
'max-confidence',
|
|
16
|
+
'max-size',
|
|
17
|
+
] as const
|
|
18
|
+
|
|
19
|
+
export const imageFacedetectFaceSelectionModeSchema = z.enum(imageFacedetectFaceSelectionModes)
|
|
20
|
+
|
|
21
|
+
export const imageFacedetectFaceCoordinatesSchema = z
|
|
22
|
+
.object({
|
|
23
|
+
confidence: z.number().optional(),
|
|
24
|
+
height: z.number(),
|
|
25
|
+
width: z.number(),
|
|
26
|
+
x1: z.number(),
|
|
27
|
+
x2: z.number().optional(),
|
|
28
|
+
y1: z.number(),
|
|
29
|
+
y2: z.number().optional(),
|
|
30
|
+
})
|
|
31
|
+
.passthrough()
|
|
32
|
+
|
|
33
|
+
export type ImageFacedetectFaceCoordinates = z.infer<typeof imageFacedetectFaceCoordinatesSchema>
|
|
34
|
+
|
|
12
35
|
export const meta: RobotMetaInput = {
|
|
13
36
|
bytescount: 1,
|
|
14
37
|
discount_factor: 1,
|
|
@@ -104,7 +127,7 @@ The default value \`"preserve"\` means that the input image format is re-used.
|
|
|
104
127
|
Specifies the minimum confidence that a detected face must have. Only faces which have a higher confidence value than this threshold will be included in the result.
|
|
105
128
|
`),
|
|
106
129
|
faces: z
|
|
107
|
-
.union([
|
|
130
|
+
.union([imageFacedetectFaceSelectionModeSchema, z.number().int()])
|
|
108
131
|
.default('each')
|
|
109
132
|
.describe(`
|
|
110
133
|
Determines which of the detected faces should be returned. Valid values are:
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
robotUse,
|
|
10
10
|
} from './_instructions-primitives.ts'
|
|
11
11
|
|
|
12
|
-
const speechTranscribeProviderSchema = z.enum(['aws', 'gcp', 'replicate']).
|
|
12
|
+
const speechTranscribeProviderSchema = z.enum(['aws', 'gcp', 'replicate']).optional()
|
|
13
13
|
const speechTranscribeProviderWithHiddenFieldsSchema = z
|
|
14
14
|
.enum(['aws', 'gcp', 'replicate', 'transloadit'])
|
|
15
|
-
.
|
|
15
|
+
.optional()
|
|
16
16
|
|
|
17
17
|
export const meta: RobotMetaInput = {
|
|
18
18
|
bytescount: 1,
|
|
@@ -68,11 +68,48 @@ export const robotSpeechTranscribeInstructionsSchema = robotBase
|
|
|
68
68
|
You can use the text that we return in your application, or you can pass the text down to other <dfn>Robots</dfn> to filter audio or video files that contain (or do not contain) certain content, or burn the text into images or video for example.
|
|
69
69
|
|
|
70
70
|
Another common use case is automatically subtitling videos, or making audio searchable.
|
|
71
|
+
|
|
72
|
+
Set \`speaker_labels\` to \`true\` when you want JSON or meta transcription output to distinguish
|
|
73
|
+
recurring speakers:
|
|
74
|
+
|
|
75
|
+
\`\`\`json
|
|
76
|
+
{
|
|
77
|
+
"steps": {
|
|
78
|
+
"transcribed": {
|
|
79
|
+
"use": ":original",
|
|
80
|
+
"robot": "/speech/transcribe",
|
|
81
|
+
"provider": "aws",
|
|
82
|
+
"format": "json",
|
|
83
|
+
"speaker_labels": true,
|
|
84
|
+
"max_speakers": 3
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
\`\`\`
|
|
89
|
+
|
|
90
|
+
Speaker labels are currently supported by the \`aws\` and \`gcp\` providers. If you enable
|
|
91
|
+
\`speaker_labels\` without setting \`provider\`, Transloadit uses \`aws\` for that <dfn>Step</dfn>. Labels
|
|
92
|
+
are normalized as \`speaker_1\`, \`speaker_2\`, and so on:
|
|
93
|
+
|
|
94
|
+
\`\`\`json
|
|
95
|
+
{
|
|
96
|
+
"text": "Hello there. Hi!",
|
|
97
|
+
"words": [
|
|
98
|
+
{ "text": "Hello", "startTime": 0, "endTime": 0.5, "speaker": "speaker_1" },
|
|
99
|
+
{ "text": "there", "startTime": 0.6, "endTime": 1, "speaker": "speaker_1" },
|
|
100
|
+
{ "text": "Hi!", "startTime": 1.2, "endTime": 1.8, "speaker": "speaker_2" }
|
|
101
|
+
],
|
|
102
|
+
"segments": [
|
|
103
|
+
{ "text": "Hello there", "startTime": 0, "endTime": 1, "speaker": "speaker_1" },
|
|
104
|
+
{ "text": "Hi!", "startTime": 1.2, "endTime": 1.8, "speaker": "speaker_2" }
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
\`\`\`
|
|
71
108
|
`),
|
|
72
109
|
provider: speechTranscribeProviderSchema.describe(`
|
|
73
110
|
Which AI provider to leverage.
|
|
74
111
|
|
|
75
|
-
Defaults to \`"replicate"\`, which currently uses our highest-quality deployed transcription path while ElevenLabs Scribe support is being prepared.
|
|
112
|
+
Defaults to \`"replicate"\`, which currently uses our highest-quality deployed transcription path while ElevenLabs Scribe support is being prepared. When \`speaker_labels\` is \`true\` and \`provider\` is omitted, Transloadit defaults to \`"aws"\`, because speaker labels are currently supported by the \`aws\` and \`gcp\` providers.
|
|
76
113
|
|
|
77
114
|
Transloadit abstracts the interface so you can expect the same data structures, but different latencies and information being returned. Different cloud vendors have different areas they shine in, and we recommend to try out and see what yields the best results for your use case.
|
|
78
115
|
`),
|
|
@@ -86,9 +123,26 @@ Whether to return a full response (\`"full"\`), or a flat list of descriptions (
|
|
|
86
123
|
Output format for the transcription.
|
|
87
124
|
|
|
88
125
|
- \`"text"\` outputs a plain text file that you can store and process.
|
|
89
|
-
- \`"json"\` outputs a JSON file containing timestamped words.
|
|
126
|
+
- \`"json"\` outputs a JSON file containing timestamped words. When \`speaker_labels\` is enabled, words can include \`speaker\` labels and the JSON can also include grouped \`segments\` by speaker.
|
|
90
127
|
- \`"srt"\` and \`"webvtt"\` output subtitle files of those respective file types, which can be stored separately or used in other encoding <dfn>Steps</dfn>.
|
|
91
|
-
- \`"meta"\` does not return a file, but stores the data inside
|
|
128
|
+
- \`"meta"\` does not return a file, but stores the data inside Transloadit's file object (under \`\${file.meta.transcription.text}\`, \`\${file.meta.transcription.words}\`, and, when speaker labels are available, \`\${file.meta.transcription.segments}\`) that's passed around between encoding <dfn>Steps</dfn>, so that you can use the values to burn the data into videos, filter on them, etc.
|
|
129
|
+
`),
|
|
130
|
+
speaker_labels: z
|
|
131
|
+
.boolean()
|
|
132
|
+
.default(false)
|
|
133
|
+
.describe(`
|
|
134
|
+
When enabled, Transloadit asks the transcription provider to distinguish different speakers. JSON and meta output can then include \`speaker\` labels such as \`"speaker_1"\` on individual words, plus grouped \`segments\` by speaker. Text, SRT, and WebVTT output behavior is unchanged.
|
|
135
|
+
|
|
136
|
+
Speaker labels identify recurring voices, not real person names. Accuracy depends on audio quality, background noise, overlapping speech, and the number of speakers.
|
|
137
|
+
`),
|
|
138
|
+
max_speakers: z
|
|
139
|
+
.number()
|
|
140
|
+
.int()
|
|
141
|
+
.min(1)
|
|
142
|
+
.max(10)
|
|
143
|
+
.default(10)
|
|
144
|
+
.describe(`
|
|
145
|
+
The maximum number of speakers to detect when \`speaker_labels\` is enabled.
|
|
92
146
|
`),
|
|
93
147
|
// TODO determine the list of languages
|
|
94
148
|
source_language: z
|
|
@@ -113,6 +167,7 @@ The language should be specified in the [BCP-47](https://www.rfc-editor.org/rfc/
|
|
|
113
167
|
|
|
114
168
|
export const robotSpeechTranscribeInstructionsWithHiddenFieldsSchema =
|
|
115
169
|
robotSpeechTranscribeInstructionsSchema.extend({
|
|
170
|
+
model: z.enum(['whisper-large-v3']).optional(),
|
|
116
171
|
provider: speechTranscribeProviderWithHiddenFieldsSchema,
|
|
117
172
|
result: z
|
|
118
173
|
.union([z.literal('debug'), robotSpeechTranscribeInstructionsSchema.shape.result])
|
|
@@ -95,6 +95,8 @@ You can add text overlays to videos using FFmpeg's \`drawtext\` filter through t
|
|
|
95
95
|
- Use the \`font\` attribute to reference a font by family name with FFmpeg's \`drawtext\`
|
|
96
96
|
- FFmpeg font family names typically do not contain dashes (e.g. \`Times New Roman\`), while
|
|
97
97
|
ImageMagick uses dashed names (e.g. \`Times-New-Roman\`).
|
|
98
|
+
- File-loading \`drawtext\` options such as \`textfile\` and \`fontfile\` are not supported. Use
|
|
99
|
+
inline \`text\` and a font family name instead.
|
|
98
100
|
- Preserve the source audio by setting \`"codec:a": "copy"\`.
|
|
99
101
|
- Position text with the \`x\` and \`y\` expressions. The example above centers the text.
|
|
100
102
|
|