| 1 | import type * as mediaconvert from "@distilled.cloud/aws/mediaconvert"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `mediaconvert:Probe` — analyze an input media file in |
| 7 | * S3 (or over HTTPS) and get back its container, codecs, frame rate, |
| 8 | * resolution, track layout, and captions, to drive transcoding decisions at |
| 9 | * runtime. |
| 10 | * |
| 11 | * The binding takes no arguments and grants `mediaconvert:Probe` on `*`. |
| 12 | * Note the probing itself reads the file with the *caller's* credentials — |
| 13 | * the Function also needs S3 read access to the probed object (bind an |
| 14 | * `AWS.S3.GetObject` capability on the bucket). |
| 15 | * Provide the implementation with `Effect.provide(AWS.MediaConvert.ProbeHttp)`. |
| 16 | * |
| 17 | * ### Inspecting Inputs |
| 18 | * **Example:** Probe an Uploaded File |
| 19 | * ```typescript |
| 20 | * // init |
| 21 | * const probe = yield* AWS.MediaConvert.Probe(); |
| 22 | * |
| 23 | * // runtime |
| 24 | * const { ProbeResults } = yield* probe({ |
| 25 | * InputFiles: [{ FileUrl: `s3://${bucket}/${key}` }], |
| 26 | * }); |
| 27 | * const video = ProbeResults?.[0]?.TrackMappings; |
| 28 | * ``` |
| 29 | * |
| 30 | * @binding |
| 31 | */ |
| 32 | export interface Probe extends Binding.Service< |
| 33 | Probe, |
| 34 | "AWS.MediaConvert.Probe", |
| 35 | () => Effect.Effect< |
| 36 | ( |
| 37 | request: mediaconvert.ProbeRequest, |
| 38 | ) => Effect.Effect<mediaconvert.ProbeResponse, mediaconvert.ProbeError> |
| 39 | > |
| 40 | > {} |
| 41 | export const Probe = Binding.Service<Probe>("AWS.MediaConvert.Probe"); |