ugcinc 4.21.0 → 4.23.0
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 +36 -0
- package/dist/automations/nodes/index.d.ts +1 -1
- package/dist/automations/nodes/remotion-composition.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -1
- package/dist/media-analysis.d.ts +3865 -222
- package/dist/media-analysis.js +56 -2
- package/dist/media.d.ts +8 -2
- package/dist/media.js +15 -1
- package/dist/render/compositions/IMessageDmComposition/types.d.ts +4 -4
- package/dist/render/types/remotion-composition.d.ts +8 -8
- package/dist/tools/media.js +4 -0
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -362,3 +362,39 @@ than caching by URL. Results include source SHA-256, encoded/display dimensions,
|
|
|
362
362
|
rotation, time base, source starting PTS, decoded frame count and an owned manifest.
|
|
363
363
|
Video URLs must be public HTTPS sources. Limits: 100 MB, 30 minutes, 4096 pixels per
|
|
364
364
|
encoded dimension, 120,000 decoded frames. Unsupported/malformed media fails explicitly.
|
|
365
|
+
|
|
366
|
+
### Image and video OCR
|
|
367
|
+
|
|
368
|
+
Quick reference: `client.media.readImageText({url})`, `client.media.readVideoText({url, mode, range?, intervalMs?})`; agent tools `read_image_text` and `read_video_text`. Both use the authenticated analysis job/status flow above.
|
|
369
|
+
|
|
370
|
+
```ts
|
|
371
|
+
const imageText = await client.media.readImageText({url: imageUrl});
|
|
372
|
+
const sampledText = await client.media.readVideoText({url: videoUrl, mode: 'fast', intervalMs: 1000});
|
|
373
|
+
const everyFrame = await client.media.readVideoText({url: videoUrl, mode: 'frame_scan', range: {startMs: 0, endMs: 5000}});
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
`POST /media/analysis/read-image-text` accepts an HTTPS image URL. Results contain `regions` (raw recognized text, four-point polygon, enclosing box, model confidence, readable/unreadable status), inferred `lines` with region IDs and reading order, source dimensions/hash, model details, `previewUrl` and `manifestUrl`. Coordinates are pixels after EXIF orientation; transparent pixels are composited on white. English recognition only; no guaranteed reading order for columns or inverted text. Low-confidence candidates retain `rawText` but return `text: null`. Undetected text cannot be marked unreadable, and empty output does not prove absence. Images must be static, at most 4096 pixels per axis /16 megapixels, and at most 100 MiB.
|
|
377
|
+
|
|
378
|
+
`POST /media/analysis/read-video-text` accepts a video URL, `mode` (`fast` default or `frame_scan`), optional `{startMs,endMs}` range and optional `intervalMs` (fast only, default1000, minimum100). Range end is exclusive; range defaults to the whole clip. A request may cover at most120 seconds and inspect at most240 frames; split longer frame scans into ranges. Invalid/excessive requests fail explicitly, never silently truncate. Times are relative to the first displayed frame; original `sourcePts` and time base are retained. The frame displayed at a partial range's start is included, so its source timestamp can precede `startMs`.
|
|
379
|
+
|
|
380
|
+
Results include per-frame regions/lines, up to eight annotated frame previews, heuristic text `tracks` with observed boxes, and `coverage.inspected` plus `coverage.uninspected`. `coverage.complete` means all displayed frames within the range were inspected, not that OCR found every word. A track's `firstObservedMs` / `lastObservedEndMs` bounds observations; it does not prove uninterrupted visibility between sampled frames. Fast mode can miss brief text entirely. Fully scanned recognized single-frame text retains its decoded frame interval. Recognition scores are not calibrated probabilities. Track identity, scene-change rejection and line grouping are estimates; use individual observations and polygons for evidence.
|
|
381
|
+
|
|
382
|
+
Both methods return `ApiResponse<MediaAnalysisJob>`, waiting through up to180 two-second status polls. A pending/processing response retains `jobId`; resume with `getMediaAnalysis({jobId})`. Job results include model/runtime versions and SHA-256 checksums. These CPU jobs share the existing bounded analysis queue. A failed job does not return partial OCR as complete.
|
|
383
|
+
|
|
384
|
+
### Local speech transcription and audio levels
|
|
385
|
+
|
|
386
|
+
Quick reference: `client.media.transcribeAudio({url})`, `client.media.measureAudioLevels({url})`; agent tools `transcribe_audio`, `measure_audio_levels`. Both use the authenticated media-analysis job/status flow.
|
|
387
|
+
|
|
388
|
+
```ts
|
|
389
|
+
const transcript = await client.media.transcribeAudio({url: videoUrl, language: 'en', timing: 'word'});
|
|
390
|
+
const levels = await client.media.measureAudioLevels({url: videoUrl, windowMs: 100, silenceThresholdDbfs: -50});
|
|
391
|
+
const excerpt = await client.media.transcribeAudio({url: videoUrl, range: {startMs: 5000, endMs: 15000}, channel: 0});
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
`POST /media/analysis/transcribe-audio` runs an owned CPU int8 Whisper Small model through faster-whisper. There is no hosted transcription call. Inputs: HTTPS audio/video URL; optional range, `timing: 'word' | 'segment'` (default word), language (auto default; en/es/fr/de/it/pt/ja/ko/zh/ar/hi/ru), and channel0 or1. Without a channel, native channels are arithmetically averaged; opposite-phase stereo can cancel. Results contain raw recognized text, segments/words with source-relative millisecond timestamps, model scores, detected language, pinned model revision/hashes and a mono16kHz WAV preview. Segment and word timings are explicitly **estimated**, not forced alignment. Segment mode leaves words empty and word timing unavailable. Speaker labels are unavailable; overlapping voices are not separated. Empty output means no speech recognized, not proof of no speech. Silence and files without audio return explicit successful statuses.
|
|
395
|
+
|
|
396
|
+
`POST /media/analysis/measure-audio-levels` uses native channels/sample rate. Inputs: URL; optional range, `windowMs`20–5000 (default100), `silenceThresholdDbfs`−100 to−10 (default−50). Results contain per-channel RMS/sample peak levels in dBFS, near-full-scale sample counts, estimated true peaks in dBTP, integrated LUFS, a100ms momentary/short-term LUFS timeline, measured silence ranges and a waveform preview. Silence means all channels' window RMS is below the threshold; boundaries have window resolution. Near-full-scale samples (absolute amplitude>=1−1/32768) indicate possible clipping, not proven distortion. `intersampleOvershoot` distinguishes a true-peak estimate above0dBTP while sample peaks remain below0dBFS. Zero levels, gated/too-short loudness and unavailable metrics return null, never infinity. Momentary loudness needs400ms of history; short-term needs3seconds. FFmpeg summary LUFS/true peak values have0.1dB display precision.
|
|
397
|
+
|
|
398
|
+
Both operations accept mono/stereo8–192kHz, source files<=100MiB and source duration<=30minutes. Each request covers at most120seconds; larger sources require an explicit smaller range. Range end is exclusive. Times are relative to the first displayed video frame, or the first decoded audio frame for audio-only files. Original audio PTS/timebase, audio offset, native channel layout and source hash are retained. Coverage distinguishes intervals with audio from video intervals without an audio stream; missing audio is not measured silence. Boundaries are rounded inward to decoded samples with the tolerance reported. Unsupported discontinuous audio timestamps fail explicitly. No source gain normalization is applied to level measurement.
|
|
399
|
+
|
|
400
|
+
Both return `ApiResponse<MediaAnalysisJob>`, with the existing polling behavior and `getMediaAnalysis({jobId})` continuation. Owned JSON manifests retain results. Failed jobs never return incomplete analysis as complete. Recognition can miss words under music/overlap; timing precision and recognition accuracy must be evaluated separately.
|
|
@@ -340,7 +340,7 @@ export declare const nodeDefinitions: {
|
|
|
340
340
|
selectionMode: null;
|
|
341
341
|
outputType: "video" | "image";
|
|
342
342
|
inputs: {
|
|
343
|
-
type: "number" | "boolean" | "object" | "video" | "image" | "
|
|
343
|
+
type: "number" | "boolean" | "object" | "video" | "image" | "text" | "audio";
|
|
344
344
|
id: string;
|
|
345
345
|
isArray: boolean;
|
|
346
346
|
required: boolean;
|
|
@@ -11,7 +11,7 @@ declare const defaults: {
|
|
|
11
11
|
selectionMode: null;
|
|
12
12
|
outputType: "video" | "image";
|
|
13
13
|
inputs: {
|
|
14
|
-
type: "number" | "boolean" | "object" | "video" | "image" | "
|
|
14
|
+
type: "number" | "boolean" | "object" | "video" | "image" | "text" | "audio";
|
|
15
15
|
id: string;
|
|
16
16
|
isArray: boolean;
|
|
17
17
|
required: boolean;
|
|
@@ -28,7 +28,7 @@ declare const _default: import("./types").NodeDefinition<"remotion-composition",
|
|
|
28
28
|
selectionMode: null;
|
|
29
29
|
outputType: "video" | "image";
|
|
30
30
|
inputs: {
|
|
31
|
-
type: "number" | "boolean" | "object" | "video" | "image" | "
|
|
31
|
+
type: "number" | "boolean" | "object" | "video" | "image" | "text" | "audio";
|
|
32
32
|
id: string;
|
|
33
33
|
isArray: boolean;
|
|
34
34
|
required: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -86,5 +86,5 @@ export type { SuccessResponse, ErrorResponse, ApiResponse, } from './types';
|
|
|
86
86
|
export type { CropBoundary, CropAxisConfig, DynamicCropConfig, BorderRadiusConfig, VerticalAnchor, HorizontalAnchor, HorizontalSelfAnchor, VerticalSelfAnchor, RelativePositionConfigX, RelativePositionConfigY, } from './render/types';
|
|
87
87
|
export type { PublicPostFailureCode, PublicPostRecovery, PublicPostNextAction, PublicPostFailure } from './post-failure';
|
|
88
88
|
export type { ListProfilePostsParams, ListProfilePostsResult, DownloadSocialPostParams, DownloadSocialPostResult, SocialReferencePost, SocialReferenceAsset } from './social-acquisition';
|
|
89
|
-
export type { ExtractFramesParams, DetectScenesParams, FramesResult, ScenesResult, MediaAnalysisResult, MediaAnalysisJob } from "./media-analysis";
|
|
90
|
-
export { extractFramesSchema, detectScenesSchema, mediaAnalysisStatusSchema, mediaAnalysisResultSchema } from "./media-analysis";
|
|
89
|
+
export type { TranscribeAudioParams, MeasureAudioLevelsParams, AudioTranscriptResult, AudioLevelsResult, ReadImageTextParams, ReadVideoTextParams, ImageTextResult, VideoTextResult, ExtractFramesParams, DetectScenesParams, FramesResult, ScenesResult, MediaAnalysisResult, MediaAnalysisJob } from "./media-analysis";
|
|
90
|
+
export { transcribeAudioSchema, measureAudioLevelsSchema, audioTranscriptResultSchema, audioLevelsResultSchema, readImageTextSchema, readVideoTextSchema, imageTextResultSchema, videoTextResultSchema, extractFramesSchema, detectScenesSchema, mediaAnalysisStatusSchema, mediaAnalysisResultSchema } from "./media-analysis";
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.hasMissingTriggerError = exports.getPortErrorsForNode = exports.getErrorNodeIds = exports.validateWorkflow = exports.getCapturedNodes = exports.getNodesDownstreamOfSet = exports.getDownstreamNodes = exports.checkCrossContextViolation = exports.getForEachContext = exports.getConnectedSource = exports.cleanupStaleConnections = exports.removeNodeConnections = exports.removeConnection = exports.addConnection = exports.deriveConnections = exports.createNode = exports.getOutputSchema = exports.getNodeByType = exports.getAllNodes = exports.getInputPreviewValue = exports.computeAllNodePortsWithPreviews = exports.computeAllNodePorts = exports.computePortsWithPreviews = exports.computePortsForNode = exports.areTypesCompatible = exports.parseRemotionPropsJson = exports.REMOTION_COMPOSITION_IMPORTS = exports.remotionCompositionPortSchema = exports.remotionCompositionNodeSchema = exports.remotionCompositionSchema = exports.submitIMessageDmRenderJob = exports.submitInstagramDmRenderJob = exports.submitAutoCaptionRenderJob = exports.submitRemotionCompositionRenderJob = exports.submitScreenshotAnimationRenderJob = exports.submitSceneSplitJob = exports.submitDeduplicationJob = exports.getRenderJobStatus = exports.submitVideoRenderJob = exports.submitImageRenderJob = exports.BillingClient = exports.CommentsClient = exports.MediaClient = exports.AutomationsClient = exports.OrganizationClient = exports.StatsClient = exports.PostsClient = exports.TasksClient = exports.AccountsClient = exports.UGCClient = void 0;
|
|
9
9
|
exports.parseOpenAPIOutputPath = exports.parseOpenAPIInputs = exports.mapOpenAPIType = exports.nodeConfigToCaptionStyle = exports.HttpMethods = exports.prepareImageComposerInput = exports.substituteVariables = exports.processTemplate = exports.extractTemplateVariables = exports.PortIdSchema = exports.normalizeToPortId = exports.portIdToTitle = exports.isValidPortId = exports.portId = exports.selectFromPool = exports.getModelDurations = exports.getModelAspectRatios = exports.ALL_VIDEO_MODELS = exports.getAvailableInputModes = exports.hasReferenceVariant = exports.getReferenceModelId = exports.hasFirstLastFrameVariant = exports.getFirstLastFrameModelId = exports.hasImageToVideoVariant = exports.getImageToVideoModelId = exports.isImageToVideoModel = exports.IMAGE_ASPECT_RATIOS = exports.ALL_IMAGE_MODELS = exports.getEditModelId = exports.isEditModel = exports.getCapturedSourceNodeTypes = exports.getFlowControlNodeTypes = exports.getAllNodeDefinitions = exports.getNodeDefinition = exports.isPortType = exports.formatPortType = exports.isAsyncExecutor = exports.internalNodeTypes = exports.nodeDefinitions = exports.extractWorkflowConfig = exports.generateNodeName = exports.shuffleNodePreview = exports.getPreviewValue = exports.removePreviewForConnection = exports.updatePreviewMapForConnection = exports.computePreviewMap = exports.computeAllNodePreviews = exports.resolveNodePreview = exports.getWorkflowOutputSchema = exports.hasMissingTerminalError = void 0;
|
|
10
|
-
exports.mediaAnalysisResultSchema = exports.mediaAnalysisStatusSchema = exports.detectScenesSchema = exports.extractFramesSchema = exports.prepareVideoComposerInput = exports.formatDateTag = exports.outputFieldsToZod = exports.outputFieldToZod = exports.LLMProviders = exports.applyLogicOperator = exports.IfLogicOperators = exports.resolvePath = exports.indexExpressionToString = exports.indexExpressionToIndexes = exports.resolveUnknownPath = exports.getOutputTypeFromCategory = void 0;
|
|
10
|
+
exports.mediaAnalysisResultSchema = exports.mediaAnalysisStatusSchema = exports.detectScenesSchema = exports.extractFramesSchema = exports.videoTextResultSchema = exports.imageTextResultSchema = exports.readVideoTextSchema = exports.readImageTextSchema = exports.audioLevelsResultSchema = exports.audioTranscriptResultSchema = exports.measureAudioLevelsSchema = exports.transcribeAudioSchema = exports.prepareVideoComposerInput = exports.formatDateTag = exports.outputFieldsToZod = exports.outputFieldToZod = exports.LLMProviders = exports.applyLogicOperator = exports.IfLogicOperators = exports.resolvePath = exports.indexExpressionToString = exports.indexExpressionToIndexes = exports.resolveUnknownPath = exports.getOutputTypeFromCategory = void 0;
|
|
11
11
|
// =============================================================================
|
|
12
12
|
// Client Exports
|
|
13
13
|
// =============================================================================
|
|
@@ -175,6 +175,14 @@ Object.defineProperty(exports, "formatDateTag", { enumerable: true, get: functio
|
|
|
175
175
|
var video_composer_1 = require("./automations/nodes/video-composer");
|
|
176
176
|
Object.defineProperty(exports, "prepareVideoComposerInput", { enumerable: true, get: function () { return video_composer_1.prepareVideoComposerInput; } });
|
|
177
177
|
var media_analysis_1 = require("./media-analysis");
|
|
178
|
+
Object.defineProperty(exports, "transcribeAudioSchema", { enumerable: true, get: function () { return media_analysis_1.transcribeAudioSchema; } });
|
|
179
|
+
Object.defineProperty(exports, "measureAudioLevelsSchema", { enumerable: true, get: function () { return media_analysis_1.measureAudioLevelsSchema; } });
|
|
180
|
+
Object.defineProperty(exports, "audioTranscriptResultSchema", { enumerable: true, get: function () { return media_analysis_1.audioTranscriptResultSchema; } });
|
|
181
|
+
Object.defineProperty(exports, "audioLevelsResultSchema", { enumerable: true, get: function () { return media_analysis_1.audioLevelsResultSchema; } });
|
|
182
|
+
Object.defineProperty(exports, "readImageTextSchema", { enumerable: true, get: function () { return media_analysis_1.readImageTextSchema; } });
|
|
183
|
+
Object.defineProperty(exports, "readVideoTextSchema", { enumerable: true, get: function () { return media_analysis_1.readVideoTextSchema; } });
|
|
184
|
+
Object.defineProperty(exports, "imageTextResultSchema", { enumerable: true, get: function () { return media_analysis_1.imageTextResultSchema; } });
|
|
185
|
+
Object.defineProperty(exports, "videoTextResultSchema", { enumerable: true, get: function () { return media_analysis_1.videoTextResultSchema; } });
|
|
178
186
|
Object.defineProperty(exports, "extractFramesSchema", { enumerable: true, get: function () { return media_analysis_1.extractFramesSchema; } });
|
|
179
187
|
Object.defineProperty(exports, "detectScenesSchema", { enumerable: true, get: function () { return media_analysis_1.detectScenesSchema; } });
|
|
180
188
|
Object.defineProperty(exports, "mediaAnalysisStatusSchema", { enumerable: true, get: function () { return media_analysis_1.mediaAnalysisStatusSchema; } });
|