# Mediaseer docs --- title: Mediaseer API documentation description: "What a Mediaseer analysis returns, the ways to use Mediaseer, and where to start with the API." url: "https://mediaseer.ai/docs/" --- # Mediaseer API documentation Mediaseer analyses videos scene by scene. You upload a video and start its analysis; once the analysis is `FINISHED`, its result describes the video as a whole, each of its scenes, and the camera shots of each scene. The [result format](https://mediaseer.ai/docs/results/) page explains how to read it; the [API reference](https://mediaseer.ai/docs/api/) describes each field. The home page shows such an analysis for the short film *Meridian* ([the example](https://mediaseer.ai/#example)), and you can download its full output: [meridian-asset-description.json](https://mediaseer.ai/demo/meridian-asset-description.json). Derived from [*Meridian*](https://opencontent.netflix.com/#h.fzfk5hndrb9w) © Netflix, [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). ## Ways to use Mediaseer - **The app**, at [app.mediaseer.ai](https://mediaseer.ai/app/): upload a video, start the analysis and go through its scenes. You also create your API keys there. - **The API**: the [quickstart](https://mediaseer.ai/docs/guides/quickstart/) takes you from an API key to a first result with curl. [Accounts and auth](https://mediaseer.ai/docs/auth/) explains API keys, and the [API reference](https://mediaseer.ai/docs/api/) lists every public operation. Download the OpenAPI specification as [YAML](https://mediaseer.ai/docs/openapi.yaml) or [JSON](https://mediaseer.ai/docs/openapi.json) for the server address, authentication scheme and machine-readable schemas. - **The [CLI](https://mediaseer.ai/docs/cli/)**, the npm package `mediaseer`: the same steps from the shell. It resumes the upload and does the waiting for you. - **The [MCP server](https://mediaseer.ai/docs/mcp/)**, part of the CLI: gives an AI agent the same steps as tools. - **AI agents**: the [agent getting-started guide](https://mediaseer.ai/docs/guides/agents/) explains when to use Mediaseer and how to run the API workflow. A packaged agent skill is not out yet. The [llms.txt index](https://mediaseer.ai/llms.txt) links the developer resources; [full documentation as text](https://mediaseer.ai/docs/llms-full.txt) collects the docs in reading order. ## Guides The guides show one job each, end to end, with an example script: - [Upload a video](https://mediaseer.ai/docs/guides/upload/), and start the analysis - [Wait for the result](https://mediaseer.ai/docs/guides/wait/) - [Read and filter results](https://mediaseer.ai/docs/guides/read-results/) - [Watch an analysis](https://mediaseer.ai/docs/guides/watch/) - [API keys](https://mediaseer.ai/docs/guides/api-keys/): check and replace a key The [recipes](https://mediaseer.ai/docs/guides/recipes/) turn results into ad-break candidates, credit skip intervals, a review queue and catalogue metadata. The [FAQ](https://mediaseer.ai/docs/faq/) explains common errors and how to recover. ## Concepts The [glossary](https://mediaseer.ai/docs/glossary/) defines the terms used across the app and API. For analysis states, limits, authentication and data retention, see [Lifecycle](https://mediaseer.ai/docs/lifecycle/), [Limits and costs](https://mediaseer.ai/docs/limits/), [Accounts and auth](https://mediaseer.ai/docs/auth/) and [Your data](https://mediaseer.ai/docs/data/). --- title: Quickstart description: "Create a key, upload a video, start its analysis and read the results." url: "https://mediaseer.ai/docs/guides/quickstart/" --- # Quickstart ## Prepare Create an account in the [app](https://mediaseer.ai/app/) and an API key on its [API keys page](https://mediaseer.ai/app/api-keys). Creating and starting an analysis need a confirmed address: until then, both answer `403` `EMAIL_NOT_VERIFIED`, and a create makes nothing. The examples need bash, curl and jq. Set `MEDIASEER_API_URL` to `https://api.mediaseer.ai` and `MEDIASEER_API_KEY` to your key in your shell environment. For uploads, set `VIDEO_FILE` to a local video path. ## Check the key Run [check-key.sh](https://mediaseer.ai/docs/guides/api-keys/#check-a-key). It reads your usage without creating or starting an analysis. ## Upload and start Run [start.sh](https://mediaseer.ai/docs/guides/upload/#start) to upload the video and start its analysis. Uploading takes a slot; starting is paid work. Check [limits and costs](https://mediaseer.ai/docs/limits/) first. The script prints `created: `. Set `ANALYSIS_ID` to that id for the remaining examples. ## Wait Run [wait.sh](https://mediaseer.ai/docs/guides/wait/) until the analysis finishes. Stopping the wait leaves the analysis running. ## Read results Run [results.sh](https://mediaseer.ai/docs/guides/read-results/#filter-in-your-code) to read and filter the scenes. [Result format](https://mediaseer.ai/docs/results/) explains how to interpret them. ## Clean up [Delete](https://mediaseer.ai/docs/api/operations/deletevodanalysis/) analyses you no longer need to free their slots. The [data page](https://mediaseer.ai/docs/data/) explains retention and deletion. --- title: Mediaseer for AI agents description: "When to use Mediaseer, how to authenticate, and how to upload, analyse and read a video's scenes." url: "https://mediaseer.ai/docs/guides/agents/" --- # Mediaseer for AI agents ## When to use Mediaseer Use Mediaseer to turn a VOD video into structured scene metadata: timestamps, summaries, keywords, categories, content ratings and ad-break suggestions. The [result format](https://mediaseer.ai/docs/results/) explains the output; the [recipes](https://mediaseer.ai/docs/guides/recipes/) show how to use it for catalogue metadata, credit skip intervals and review queues. News and sports support is planned. Call the public REST API directly, or use the npm package `mediaseer`: its [CLI](https://mediaseer.ai/docs/cli/) runs the workflow below from a shell or script, and its [local MCP server](https://mediaseer.ai/docs/mcp/) gives an agent the same steps as tools. ## Discover and authenticate The API base URL is `https://api.mediaseer.ai/api/v1`. The [OpenAPI specification](https://mediaseer.ai/docs/openapi.yaml) declares its operations, schemas and authentication. The [API reference](https://mediaseer.ai/docs/api/) explains them for readers. Have the account owner create an account in the [app](https://mediaseer.ai/app/register) and create an API key on the [API keys page](https://mediaseer.ai/app/api-keys). Send that key in the `X-Api-Key` header. Keep it in the calling tool’s environment; do not put it in a prompt, URL or log. [Accounts and auth](https://mediaseer.ai/docs/auth/) explains the account requirements. Use the [check-key example](https://mediaseer.ai/docs/guides/api-keys/#check-a-key) to read usage before creating anything. Protected endpoints refuse requests without a valid key. ## Run an analysis - Follow the [quickstart](https://mediaseer.ai/docs/guides/quickstart/) to configure the API URL and key. - [Upload a video](https://mediaseer.ai/docs/guides/upload/). Creating an upload takes an analysis slot. Upload the file to the returned upload URL, then start its analysis. - [Wait for the result](https://mediaseer.ai/docs/guides/wait/). Poll its status until it finishes; stopping a local wait does not stop the analysis. Follow the [lifecycle](https://mediaseer.ai/docs/lifecycle/) when handling failures or cancellation. - [Read and filter results](https://mediaseer.ai/docs/guides/read-results/). Reuse finished results when they already answer the request. - Delete analyses you no longer need to free their slots, following the [quickstart’s cleanup step](https://mediaseer.ai/docs/guides/quickstart/#clean-up). ## Costs and private data Starting an analysis is paid work. Get the user’s approval for that cost before starting. Creating clips is also paid work. Uploading, reading results and checking status do not start an analysis. Check [limits and costs](https://mediaseer.ai/docs/limits/) before proceeding. Upload session URLs, playback tickets and signed download URLs are credentials. Keep them out of prompts and logs and use them only for the transfer they authorize. The [data page](https://mediaseer.ai/docs/data/) explains retention and deletion. Follow [Retries and recovery](https://mediaseer.ai/docs/guides/retries/) after uncertain responses or quota refusals; do not blindly repeat creation requests. The [llms.txt index](https://mediaseer.ai/llms.txt) links the public developer resources. The [compact docs index](https://mediaseer.ai/docs/llms.txt) links guides and operations; [full documentation](https://mediaseer.ai/docs/llms-full.txt) includes the schema pages too. The [API catalog](https://mediaseer.ai/.well-known/api-catalog) links the API and its public documentation. --- title: Result format description: "What an analysis result holds, from the video down to the shot, and what absent, empty and unknown values mean." url: "https://mediaseer.ai/docs/results/" --- # Result format An analysis result describes the video as a whole, its scenes, and the camera shots of each scene. This page shows the response shape, how to interpret values and a short example. ## Two shapes [`getVodAnalysisResults`](https://mediaseer.ai/docs/api/operations/getvodanalysisresults/) returns [`VodAnalysisResults`](https://mediaseer.ai/docs/api/schemas/vodanalysisresults/), a wrapper with two fields: `outputLanguageCodes` and `analysis`. The app’s **Download report (JSON)** button saves `analysis` exactly as the API served it, without the wrapper. To get from the API’s response to the download, take its `analysis` field, for example with `jq .analysis`. Everything inside `analysis` is the same in both. ## Translations There are no translated results today. `outputLanguageCodes` is always an empty list, and a request with a `language` parameter is answered with `400` `VALIDATION`. ## Absent, empty and unknown values - **`null` is never sent.** A field without a value is left out. A list without entries is sent empty, or, where the list is optional, it can be left out too. - **Absent** means the field is left out. That can have several causes: no value was available, as in [`SceneCharacter.playedBy`](https://mediaseer.ai/docs/api/schemas/scenecharacter/#SceneCharacter.playedBy); an optional list was empty and left out, as in [`SceneAnalysisDetails.inputLanguageCodes`](https://mediaseer.ai/docs/api/schemas/sceneanalysisdetails/#SceneAnalysisDetails.inputLanguageCodes) for input without audio; or the value is an enum value this API doesn’t know yet. A scene type this API doesn’t list yet leaves out [`Scene.type`](https://mediaseer.ai/docs/api/schemas/scene/#Scene.type). Inside [`Shot.shotAdvisories`](https://mediaseer.ai/docs/api/schemas/shot/#Shot.shotAdvisories), such a value removes the whole object, because a partial list of advisories would read as “nothing found”. - **A subject’s box and the copyright year** are sent as the analysis has them: [`MainSubject.box2d`](https://mediaseer.ai/docs/api/schemas/mainsubject/#MainSubject.box2d) as `[]` and [`Credits.copyright`](https://mediaseer.ai/docs/api/schemas/credits/#Credits.copyright) as `""` when the analysis found none. Results of analyses made before these fields existed leave them out, and some results leave out an empty one, so treat an absent box or year like an empty one. A box that isn’t a list of integers, or a year that isn’t text, is left out too. - **Empty** is an empty list, as in [`Scene.sensitiveTopics`](https://mediaseer.ai/docs/api/schemas/scene/#Scene.sensitiveTopics) or [`SceneContent.characters`](https://mediaseer.ai/docs/api/schemas/scenecontent/#SceneContent.characters), or an empty string for optional text, as in [`CharacterAppearance.distinguishingFeatures`](https://mediaseer.ai/docs/api/schemas/characterappearance/#CharacterAppearance.distinguishingFeatures). - **Free text** can say in words when the analysis couldn’t tell, with no fixed list of words and in any case: `unknown` or `Unknown` in [`SceneSetting.timeOfDay`](https://mediaseer.ai/docs/api/schemas/scenesetting/#SceneSetting.timeOfDay), `UNKNOWN` in [`CharacterAppearance.hairColor`](https://mediaseer.ai/docs/api/schemas/characterappearance/#CharacterAppearance.hairColor), and `none` in [`CharacterAppearance.distinguishingFeatures`](https://mediaseer.ai/docs/api/schemas/characterappearance/#CharacterAppearance.distinguishingFeatures). Such a word is a value, not an absent field. - **`UNKNOWN`** is a value of several enums: [`AgeRange`](https://mediaseer.ai/docs/api/schemas/agerange/), [`SceneTension`](https://mediaseer.ai/docs/api/schemas/scenetension/), [`ScenePacing`](https://mediaseer.ai/docs/api/schemas/scenepacing/), [`SceneType`](https://mediaseer.ai/docs/api/schemas/scenetype/), [`Department`](https://mediaseer.ai/docs/api/schemas/department/) and [`AdvisoryConfidence`](https://mediaseer.ai/docs/api/schemas/advisoryconfidence/). The analysis sends it as a value when it couldn’t decide; each value’s description says when. `UNKNOWN` and an absent field are not the same: check for both. - **Empty or absent alone doesn’t say whether the content was assessed.** An empty or missing list can mean the analysis found nothing, or that the step producing it gave no result. For advisories, [`ShotAdvisories.status`](https://mediaseer.ai/docs/api/schemas/shotadvisories/#ShotAdvisories.status) says whether the shot was assessed; an absent [`Shot.shotAdvisories`](https://mediaseer.ai/docs/api/schemas/shot/#Shot.shotAdvisories) means no assessment is available for that shot, or it held a value this API doesn’t know yet. - **`BLOCKED`** in [`ShotAdvisories.status`](https://mediaseer.ai/docs/api/schemas/shotadvisories/#ShotAdvisories.status) means the model declined to assess the shot. Its `TOBACCO` advisory with `UNKNOWN` confidence is a conservative marker, not a finding: review the shot yourself. ## Example ```json title="analysis" { "scenes": [ { "sensitiveTopics": [], "keywords": ["montage", "street", "building", "vehicle", "sign", "pedestrian", "city", "landmark"], "id": "2cf39ec2-147c-4e5c-9792-751754b5bd13", "title": "Los Angeles 1947 Opening Montage", "startInSeconds": 0.0, "endInSeconds": 29.7297, "content": { "characters": [], "objects": [ { "description": "Vintage automobile from the 1940s driving on the street.", "category": "Vehicle" }, { "description": "Historic period signage and title text displayed on screen.", "category": "Sign" } ], "settings": [ { "location": { "name": "Los Angeles Street", "description": "Bustling historic streets of Los Angeles in 1947 with vintage architecture and landmarks." }, "timeOfDay": "day", "atmosphere": { "mood": "nostalgic noir", "lighting": "bright hazy", "weather": "clear" } } ], "dynamics": { "tension": "LOW", "pacing": "MEASURED" } }, "summary": "An atmospheric noir-styled opening montage displays archival footage of Los Angeles in 1947 while a voiceover introduces the narrative.", "verboseSummary": "The cold open begins with a montage of archival footage showing Los Angeles in 1947, accompanied by an instrumental orchestral theme that evokes a classic noir atmosphere. The sequence opens with a high-angle shot looking down a bustling sunlit city street lined with vintage automobiles, trams, and multistory buildings bearing period signage such as J.C. Penney and a towering Hollywood sign in the distance. Overlaid white text reads, \"Los Angeles 1947.\" The montage cuts through a series of sweeping street scenes: a red truck hauling a bed full of sacks, pedestrians in 1940s attire crossing intersections, vintage sedans driving down wide multi-lane roads beneath a crisscross of overhead tram wires, and landmark facades including the Hollywood Hotel, the Earl Carroll Theatre with its iconic circular face portrait, Grauman's Chinese Theatre, and the Florentine Gardens. The camera glides steadily past classic storefronts and palm trees under a bright, hazy sky. As the visual tour continues across various historic avenues, the word \"Meridian\" appears centered on screen in clean white lettering over a shot of a grand stone building with arched windows and heavy foot traffic. Just as the title card settles, a male voiceover begins speaking in a calm, reflective tone, noting, \"So these guys just disappeared.\" No logos or branding are visible beyond the period street signs and on-screen title text; the moment serves as an atmospheric, noir-styled opening montage establishing the setting and tone before the main narrative begins.", "iab": { "contentTaxonomies": ["153", "19", "EZWB7V", "324"], "adOpportunityTaxonomies": ["1008", "1540"], "sensitiveTopicTaxonomies": [], "contentVersion": "3.1", "adProductVersion": "2.0" }, "type": "MAIN_CONTENT", "shots": [ { "startInSeconds": 0.0, "endInSeconds": 1.001, "detailedDescription": "The video shot is completely black, showing no visible content or objects.", "keywords": ["darkness", "black"], "mainSubjects": [] }, { "startInSeconds": 1.001, "endInSeconds": 5.188517, "detailedDescription": "An archival, colorized elevated shot of a busy Los Angeles street in 1947, featuring vintage cars, buildings with signage including J.C. Penney, and the Hollywood sign in the distance.", "keywords": ["street", "city", "building", "car", "sign", "history", "vehicle", "traffic"], "mainSubjects": [ { "classification": "Building", "description": "Historic J.C. Penney building on the left side of the street.", "appearanceTimeInSeconds": 0.0, "centerX": 19.15, "centerY": 50.05, "box2d": [2, 0, 999, 383] }, { "classification": "Car", "description": "Vintage car driving down the multi-lane street.", "appearanceTimeInSeconds": 0.0, "centerX": 67.55, "centerY": 81.4, "box2d": [771, 648, 857, 703] }, { "classification": "Billboard", "description": "Vertical Hollywood billboard in the upper right background.", "appearanceTimeInSeconds": 0.0, "centerX": 91.05, "centerY": 25.5, "box2d": [2, 891, 508, 930] } ] } ], "adOpportunityInformation": { "reason": "The cold open montage provides atmospheric context, and the cut signifies the transition from the teaser segment to the start of the program's primary narrative.", "score": 0.8 } } ], "description": "Detectives in 1947 Los Angeles investigate a bizarre missing person case involving a witness who encountered a mysterious woman on a stormy coastal cliff, leading to an eerie descent into supernatural dread.", "keywords": [ "detective", "noir", "los angeles", "storm", "cliff", "ocean", "car", "rain", "woman", "dress", "flashlighter", "gun", "cave", "office", "cigarette", "venetian blind", "dispatcher", "credit" ], "ratings": [ { "region": "EU", "system": "European Movie ratings", "rating": "S" }, { "region": "UK", "system": "BBFC (British Board of Film Classification) Movie Ratings", "rating": "15" }, { "region": "UK", "system": "BBFC (British Board of Film Classification) TV Ratings", "rating": "15" }, { "region": "US", "system": "MPAA (Motion Picture Association of America) Ratings", "rating": "R" }, { "region": "US", "system": "TV Parental Guidelines", "rating": "TV-MA" }, { "region": "CA", "system": "Canadian Movie Ratings", "rating": "14A" }, { "region": "CA", "system": "Canadian TV Ratings", "rating": "14+" }, { "region": "AU", "system": "Australian Classification Board Ratings", "rating": "MA15+" }, { "region": "AU", "system": "Australian TV Ratings", "rating": "MA15+" }, { "region": "NZ", "system": "NZ Classification Ratings", "rating": "R13" }, { "region": "NZ", "system": "NZ TV Ratings", "rating": "RP13" } ], "sensitiveTopics": ["suspense", "supernatural terror", "smoking"], "iabSensitiveTopicTaxonomies": [], "metadata": { "version": "1.62.0", "disclaimer": "Generated by Bitmovin AI" }, "duration": 719.02, "title": "Los Angeles 1947", "inputLanguageCodes": ["en"], "credits": { "persons": [ { "name": "Person 4", "role": "Director", "department": "DIRECTING" }, { "name": "Person 4", "role": "Screenplay", "department": "WRITING" }, { "name": "Person 5", "role": "Screenplay", "department": "WRITING" } ], "songs": [], "copyright": "2016" } } ``` An excerpt of `analysis` for *Meridian*: video metadata, the first scene and its first shots, with shortened credits and anonymised names. Derived from [*Meridian*](https://opencontent.netflix.com/#h.fzfk5hndrb9w) © Netflix, [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). ## Field reference The [schema reference](https://mediaseer.ai/docs/api/schemas/vodanalysisresults/) lists every field, its meaning and whether it is required. --- title: Recipes description: "Turn analysis results into ad-break candidates, credit skip intervals, a review queue and a search document." url: "https://mediaseer.ai/docs/guides/recipes/" --- # Recipes These recipes use the result of a `FINISHED` analysis. Mediaseer supplies descriptions, classifications and timestamps; your application decides how to use them. The example reads the result once and produces the sections below. It does not start an analysis or change your video. ## Ad break placement `adBreakCandidates` ranks scene ends by `adOpportunityInformation.score`, highest first, with earlier boundaries first on a tie. The score describes suitability at the **end** of the scene; a score of `0.5` can also mean the scene was not assessed. A zero score remains a candidate in this list; the script sets no acceptance threshold. The example requires a known video duration, scene end and score. It leaves out the beginning and end of the video; without the duration, the list is empty. Missing values do not become zero. Review the candidates, then apply your own spacing, duration and editorial rules. Your player or ad system inserts the ads; Mediaseer does not. See [AdOpportunity](https://mediaseer.ai/docs/api/schemas/adopportunity/) for the score and its explanation. ## Skip intro and credits `skipIntervals` contains scenes labelled `OPENING_CREDITS` or `END_CREDITS` with a valid start and a later end. It keeps them as separate intervals. These are predicted scene types, so review them before using them as skip markers; an opening scene need not cover the whole intro. Your player can show a button while playback is inside an accepted interval and seek to its end when clicked. You choose which intervals to offer and whether to join adjacent ones. Mediaseer returns no skip button and does not remove those scenes. Other scene types, such as `RECAP`, are separate choices for your application. See [SceneType](https://mediaseer.ai/docs/api/schemas/scenetype/) for the classifications. ## Review sensitive content `review` keeps the video’s and each scene’s `sensitiveTopics`, and builds a shot review queue. Topic phrases are broader than shot advisories: advisories cover **tobacco and vaping imagery today**, not every sensitive topic or policy. - An `ANALYZED` shot enters `shotsToReview` when it has detections, including low-confidence ones. Confidence helps prioritise review; it is not a reason to discard a detection. - A `BLOCKED` shot enters the queue without advisories: it was not assessed, so review it yourself. This does not mean your upload was blocked. - A shot with no advisory result enters the queue without a `status`. Missing results do not mean nothing was found. - `hasShotBreakdown: false` means the scene has no shot breakdown in this result. An empty queue then says nothing about its imagery. Only an `ANALYZED` shot with an empty advisory list means no advisory imagery was found in that assessment. Empty sensitive-topic lists can also mean the analysis did not produce them. This output helps organise human review; it is not a safety or compliance verdict. See [ShotAdvisories](https://mediaseer.ai/docs/api/schemas/shotadvisories/) and the [result interpretation](https://mediaseer.ai/docs/results/). ## Catalogue and search metadata `catalogue` contains the inferred video title, description, keywords and languages, plus each scene’s title, summary, keywords and time range when known. Unknown fields are left out. The script keeps video metadata separate from scene metadata and leaves out analysis software metadata. Map the analysis to your own asset identifier, review the generated text, then store or index the fields you need. Use scene timestamps to link a search hit to that part of your video. A scene identifier belongs to one result and can change when the same video is analysed again; it is not a catalogue-wide asset identifier. Mediaseer does not create a search index for you. ## Run the example Use bash, curl and jq, with `MEDIASEER_API_URL`, `MEDIASEER_API_KEY` and the finished `ANALYSIS_ID` from the [quickstart](https://mediaseer.ai/docs/guides/quickstart/#prepare). The script keeps the key off curl’s command line and ignores your curl configuration. Its output names, such as `adBreakCandidates` and `shotsToReview`, belong to this example, not the API response schema. ```bash title="recipes.sh" #!/usr/bin/env bash set -euo pipefail base="${MEDIASEER_API_URL:?the API origin, without /api/v1}" base="${base%/}/api/v1" : "${MEDIASEER_API_KEY:?your API key}" id="${ANALYSIS_ID:?the id of a finished analysis}" api() { curl -q -sS -H @- "$@" <<<"X-Api-Key: $MEDIASEER_API_KEY"; } tmp="$(mktemp -d)" trap 'rm -rf "$tmp"' EXIT status="$(api -o "$tmp/results.json" -w '%{http_code}' "$base/vod-analysis/$id/results")" || { echo "results got no answer: curl exit $?" >&2 exit 1 } if [[ "$status" != 200 ]]; then echo "results answered $status $(jq -r '.code // empty' "$tmp/results.json" 2>/dev/null || true)" >&2 exit 1 fi jq ' def known: with_entries(select(.value != null)); .analysis as $analysis | { adBreakCandidates: ([ $analysis.scenes[] | .adOpportunityInformation.score as $score | select(($score | type) == "number" and ($analysis.duration | type) == "number" and (.endInSeconds | type) == "number" and .endInSeconds > 0 and .endInSeconds < $analysis.duration) | {sceneId: .id, atInSeconds: .endInSeconds, score: $score, reason: .adOpportunityInformation.reason} | known ] | sort_by(-.score, .atInSeconds)), skipIntervals: [ $analysis.scenes[] | select(.type == "OPENING_CREDITS" or .type == "END_CREDITS") | select((.startInSeconds | type) == "number" and (.endInSeconds | type) == "number" and .startInSeconds >= 0 and .endInSeconds > .startInSeconds) | {sceneId: .id, type, startInSeconds, endInSeconds} | known ], review: { videoTopics: $analysis.sensitiveTopics, scenes: [ $analysis.scenes[] | {sceneId: .id, sensitiveTopics, hasShotBreakdown: ((.shots // [] | length) > 0), shotsToReview: [ (.shots // [])[] | .shotAdvisories as $assessment | select($assessment.status != "ANALYZED" or ($assessment.advisories | length) > 0) | {startInSeconds, endInSeconds, status: $assessment.status, advisories: (if $assessment.status == "ANALYZED" then $assessment.advisories else null end)} | known ]} | known ] }, catalogue: ($analysis | {title, description, keywords, inputLanguageCodes, scenes: [.scenes[] | {id, title, summary, keywords, startInSeconds, endInSeconds} | known]} | known) } ' "$tmp/results.json" ``` --- title: FAQ and troubleshooting description: "Recover from refused keys, quota errors, expired uploads and failed analyses." url: "https://mediaseer.ai/docs/faq/" --- # FAQ and troubleshooting For an API error, branch on `code` and any `details[].field`, not the wording of `message`. The [error schema](https://mediaseer.ai/docs/api/schemas/error/) describes the response. A failed analysis has its own `error` on the analysis record; it is different from a refused HTTP request. ## Why is analytics off after I gave permission? Browser recording also needs website permission, a confirmed current session or owned anonymous identity, and an available production configuration. Unknown sessions, storage problems and unsupported browser coordination keep it off. Reopen [analytics settings](https://mediaseer.ai/docs/guides/analytics/) to check permission separately from availability. ## Does an accepted erasure mean deletion completed? No. `REQUESTED` or `RUNNING` means pending work, and `FAILED` is not completion. Keep the old browser proof for status. A newer identity can have permission while an older erasure is still pending; checking that status does not revoke the newer permission. Losing storage does not prove provider deletion. ## Why is my key refused? `401` `UNAUTHENTICATED` means the API did not accept your authentication. Send an active API key in `X-Api-Key`; check that it has not been revoked or copied with extra whitespace. The [API-key guide](https://mediaseer.ai/docs/guides/api-keys/) shows how to check and replace it. Never put the key in a URL or share it in an error report. `403` `EMAIL_NOT_VERIFIED` on create or start means you must confirm your account’s email address in the app before retrying. A valid API key does not bypass that requirement. See [confirmed email](https://mediaseer.ai/docs/auth/#confirmed-email). ## What does a quota refusal mean? `429` `QUOTA_EXCEEDED` has **no `Retry-After` header**. Read `details[].field`: - `jobs`: [delete an unneeded analysis](https://mediaseer.ai/docs/lifecycle/#stop-and-delete) to free an analysis slot. - `sizeBytes`: use a smaller file, within the [file-size limit](https://mediaseer.ai/docs/limits/#file-size-and-video-length). - `storage`: your storage for source videos is full, or the file does not fit into what is left of your plan’s [storage limit](https://mediaseer.ai/docs/limits/#storage). Delete analyses you no longer need; clips do not count. - `minutes` (start) or `clips` (clip job): the analysed minutes or the clips of this period are used up. Wait until `period.end` in usage; deleting gives none back. See [minutes and clips](https://mediaseer.ai/docs/limits/#minutes-and-clips). - `dailyStarts`: try again on the next UTC day. Creating an analysis can already refuse for this reason, before you request a start. For another quota refusal, follow the response’s guidance and try again later. Do not assume that retrying immediately will help. [Limits and costs](https://mediaseer.ai/docs/limits/) describes your account’s allowances. ## When should I use Retry-After? `429` `RATE_LIMITED` includes `Retry-After`, in seconds. Wait at least that long before retrying. This code comes from account and authentication endpoints: sign-in, registration, resend verification, forgot password and change password. Registration’s daily limit uses it too. It is different from an analysis quota refusal. ## My upload is missing or expired `409` `UPLOAD_INCOMPLETE` on start means no completed upload was found. Finish the upload, then start again. The upload URL works for 6 days from its issue time; check `upload.expiresAt`. If that URL has expired before you completed the upload, [create a new analysis and upload again](https://mediaseer.ai/docs/guides/upload/). The start window lasts 7 days from analysis creation. `409` `INVALID_STATE` after that window means create a new analysis. An already completed upload can still start after its upload URL expires, while the start window remains open. `INVALID_STATE` can also mean the analysis is in a final state; check its current `state`. See [link lifetimes](https://mediaseer.ai/docs/limits/#how-long-links-last) and [starting](https://mediaseer.ai/docs/lifecycle/#starting). ## Why did my analysis fail? `FAILED` is a final analysis state. Read its `error.message` for the reason and check the [supported file size and video length](https://mediaseer.ai/docs/limits/#file-size-and-video-length). An unsupported video length can be a reason for failure. A failed analysis cannot restart; correct the cause and create a new one. Stopping or deleting does not refund a start that ran. ## What should I do after an upstream error? `502` `UPSTREAM_ERROR` means an upstream service failed. Retry later. For a start or an uncertain response, check the analysis state first; [starting and recovery](https://mediaseer.ai/docs/lifecycle/#starting) explains safe start retries. If a create request had an uncertain outcome, check your analysis list before creating another, so you do not leave duplicate uploads behind. --- title: Mediaseer CLI description: "The mediaseer command: install, configuration, commands, output, exit codes, costs and security." url: "https://mediaseer.ai/docs/cli/" --- # Mediaseer CLI `mediaseer` uploads videos to Mediaseer, starts the AI scene analysis and reads the results: from the shell as `mediaseer`, and from AI agents through a local MCP server on stdio (`mediaseer mcp`). It is a client of the Mediaseer API, authenticated with your API key; quotas, limits and costs are the API’s. ## Requirements - Node.js 22 (22.23.4 or newer), 24 (24.22.1 or newer), or 26 (26.12.1 or newer). - An API key. Create one on the API keys page of the web app (`https://app.mediaseer.ai/api-keys`); it is shown once. The Node.js engine requirement is advisory: npm and npx can warn but still run the CLI on an unsupported runtime. There, `mediaseer` and its MCP server print a warning on stderr when they start, and run anyway. Check `node --version` and use a supported patched release. ## Install ```bash npm install -g mediaseer@0.1 ``` Export your API key, then check it: ```bash export MEDIASEER_API_KEY=… # not in your shell profile if an agent runs commands there, see Security considerations mediaseer usage # free; exit code 3 when the API does not accept the key ``` ## Configuration Only environment variables. There is no config file, and the API key is never a command-line argument. | Variable | Default | Meaning | | - | - | - | | `MEDIASEER_API_KEY` | – | Your API key. | | `MEDIASEER_API_URL` | `https://api.mediaseer.ai` | API address; a trailing `/api/v1` is accepted. HTTPS is required except on localhost. | | `MEDIASEER_ALLOW_START` | `true` | `false`: nothing starts an analysis, which costs money (see [Costs](https://mediaseer.ai/docs/cli/#costs)). | | `MEDIASEER_UPLOAD_DIRS` | – | MCP server only: directories `upload_video` may read besides the project directory, separated by `:` (`;` on Windows), absolute; `~` is the home directory. See [Files the MCP server reads](https://mediaseer.ai/docs/mcp/#files-the-mcp-server-reads). | | `CLAUDE_PROJECT_DIR` | – | Set by Claude Code: the MCP server’s project directory. `upload_video` reads files in it and resolves relative paths against it. | ## Commands ```text mediaseer upload [--title ] [--start [--wait [--timeout <duration>]]] mediaseer start <id> [--wait [--timeout <duration>]] mediaseer status <id> [--wait [--timeout <duration>]] mediaseer list [--limit <n>] [--offset <n>] mediaseer scenes <id> [--query <text>] [--type <type>]… [--from <time>] [--to <time>] [--fields compact|full] mediaseer results <id> mediaseer stop <id> mediaseer delete <id> --yes mediaseer usage mediaseer plans mediaseer analytics-status mediaseer mcp mediaseer clip-create <id> --mode <mode> [--prompt <text>] [--subtitles true|false] [--wait [--timeout <duration>]] mediaseer clip-list <id> [--limit <n>] [--offset <n>] mediaseer clip-status <id> [--wait [--timeout <duration>]] mediaseer clip-delete <id> --yes mediaseer clip-media <id> <episode> [--edited] [--output <path>] ``` Every command takes `--json` and `-h`/`--help`; `mediaseer --version` prints the version. An argument that starts with `-` goes after `--`: `mediaseer upload -- -clip.mp4`. | Command | What it does | JSON on stdout | | - | - | - | | `upload` | Checks the file, creates an analysis and uploads the video. Free, but the analysis holds one of your analysis slots for up to 7 days, until it is started or stopped. Starts nothing without `--start`. | `{id, state, fileName, sizeBytes, contentType}`; with `--start` the analysis | | `start` | Starts the analysis of an uploaded video. Costs money and uses quota. Starting one that is `QUEUED` or `PROCESSING` changes nothing. | the analysis | | `status` | The analysis: its state (`UPLOADING`, `QUEUED`, `PROCESSING`, `FINISHED`, `FAILED`, `CANCELLED`), and why it `FAILED`. | the analysis | | `list` | Your analyses, newest first. `--limit` 1 to 100 (default 20), `--offset` 0 to 2147483647 (default 0). | `{items, total, limit, offset}` | | `scenes` | The scenes of a `FINISHED` analysis, filtered; every matching scene at once. | `{video, total, truncated, scenes}` | | `results` | All results of a `FINISHED` analysis as the API returns them, as JSON in a terminal too. | the API’s results | | `stop` | An `UPLOADING` analysis is deleted with its file, a `QUEUED` or `PROCESSING` one is `CANCELLED` and keeps no results; either way its slot is free. An analysis that has ended cannot be stopped (exit code 10). | `{id, deleted: true}`, or the analysis | | `delete` | Removes the analysis from your account in any state. Needs `--yes`; without it nothing is sent (exit code 2). See [data retention](https://mediaseer.ai/docs/data/). | `{id, deleted: true}` | | `usage` | Your plan (`plan`), your analysis slots (`jobs`), the [analysed minutes and clips](https://mediaseer.ai/docs/limits/#minutes-and-clips) of this period against your plan’s limits (`minutes`, `clips`, no `limitSeconds` or `limit` without one) and when they reset (`period`), the storage your source videos (`sourceBytes`) and clips (`clipBytes`) take and the [limit](https://mediaseer.ai/docs/limits/#storage) your plan sets for the source videos (`storage`, no `limitBytes` without one; clips have no limit) and the limits per video (`limits`). Analysed minutes are the length of each uploaded video, for finished analyses only; clips are finished clips, and deleted ones still count. In a terminal without `--json`, warns when the minutes, the clips or the source videos’ storage are nearly used up. Shows subscription details (`subscription`) when present. Free; the quickest check of the API key. | `{jobs, limits, storage, plan, period, minutes, clips, subscription?}` | | `plans` | List plan limits and available prices; no purchase offer without a price. Read-only. | `{items}` | | `analytics-status` | Reads the key owner’s account analytics permission and gives Account settings guidance. Read-only; does not indicate collection availability. | `{accountAnalyticsEnabled, settingsUrl?}` | | `mcp` | Serves the MCP tools on stdin and stdout, see [MCP server](https://mediaseer.ai/docs/mcp/#mcp-server). | – | | `clip-create` | Creates clips from a finished analysis. `--mode` is required: `FULL_VERTICAL_CROP`, `PROMPTED_CLIPS`, or `MICRODRAMA`. Only `PROMPTED_CLIPS` takes and requires `--prompt` (nonblank, at most 1000 characters). `--subtitles` takes true or false and defaults to true. `--wait` waits for `READY`; `FAILED` exits 12. Costs money and uses clip quota. | the clip job | | `clip-list` | An analysis’s clip jobs, newest first. `--limit` 1 to 100, default 20; `--offset` 0 to 2147483647, default 0. | `{items, total, limit, offset}` | | `clip-status` | A clip job. `--wait` waits for `READY` or exits 12 for `FAILED`; unknown states keep waiting. | the clip job | | `clip-delete` | Permanently removes a job and its clips in any state; stops work if needed. Requires `--yes`. No quota is refunded. | `{id, deleted: true}` | | `clip-media` | Signed watch, poster (when available), and download URLs for a ready job’s episode. With `--edited`, those of its newest edit from the web app’s editor (its `editedAt`), exit 4 without one. With `--output <path>`, downloads the MP4 to a new file without overwriting. | `{episodeUrl, posterUrl?, downloadUrl, expiresAt}`, or `{id, episode, path}` | Options: - `--wait`: wait until the analysis is `FINISHED` (exit code 0), `FAILED` or `CANCELLED` (exit code 7), asking about every 10 s; state changes are noted on stderr. An `UPLOADING` analysis does not change until it is started. On `upload`, `--wait` needs `--start`. - `--timeout <duration>`: with `--wait` only; how long to wait, default `30m`. `90s`, `30m`, `1h`, `1.5h`, `1h30m`, `2m30s`; a plain number is seconds. Each unit once, the larger first; `0` asks once. When it runs out the exit code is 8, and the analysis goes on. - `--title <title>` (upload): the analysis’s title. Without one, the analysis names the video once it has run. - `--start` (upload): start the analysis right after the upload, which costs money. `MEDIASEER_ALLOW_START` is checked before the upload begins. - `--query <text>` (scenes): scenes whose title, summary, verbose summary, keywords, objects (category and description, e.g. on-screen text), characters or settings contain the text. One case-insensitive substring, no ranking. - `--type <type>` (scenes): repeat it or separate types with commas for any of several; `--type ADS --type END_CREDITS` is the same as `--type ADS,END_CREDITS`. Case-insensitive. Types: `MAIN_CONTENT`, `ADS`, `OPENING_CREDITS`, `END_CREDITS`, `LOGO_IDENT`, `RECAP`, `PREVIEW_THIS_TITLE`, `PROMOTION_OTHER_TITLE`, `BREAK_BUMPER`, `UNKNOWN`. A type this version does not know is fine when a scene of the video has it, otherwise an error (exit code 2). - `--from <time>`, `--to <time>` (scenes): scenes still on screen at `--from` or later, and already on screen at `--to` or earlier. Seconds (`90`, `90.5`), `MM:SS` or `HH:MM:SS`, the seconds with a fraction if need be (`01:30.5`); the first part may be any size (`90:00` is an hour and a half). `--from` after `--to` is an error. - `--fields compact|full` (scenes): `compact` (default) has what helps to choose scenes: `id`, `startInSeconds` and `endInSeconds` with `startTimecode`/`endTimecode` (HH:MM:SS), `type`, `title`, `summary`, `keywords`, `content.objects` and `adOpportunityInformation` (`score` 0 to 1, higher is a better ad break, `0.5` also when the scene was not assessed; the `reason` may argue against one). `full` has every field as the API sends it. Text output shows the compact fields. Before anything is created, `upload` checks the file: a regular file (symbolic links are followed) with a video extension (`.mp4`, `.m4v`, `.mov`, `.mkv`, `.webm`, `.avi`, `.ts`, `.mts`, `.m2ts`, `.mpg`, `.mpeg`, `.wmv`, `.flv`, `.ogv`), a video container in its first bytes, and no larger than `limits.maxFileSizeBytes` of `usage`. Network and Windows device paths are refused (exit code 2). Copy the video to a local disk first, or map the share to a drive letter. Upload progress appears on stderr in a terminal. Uploads resume after temporary network errors within the same process; after a longer outage, upload the file again. An upload error identifies its analysis with `analysisId`; `mediaseer stop <id>` frees its slot. An uncertain create may instead report `candidateAnalysisId`, which can belong to another upload. Check it before stopping it: stopping an `UPLOADING` analysis deletes its uploaded file. Upload, start and wait, read the scenes: ```bash id=$(mediaseer upload clip.mp4 | jq -r .id) && mediaseer start "$id" --wait && mediaseer scenes "$id" ``` If the upload fails, `$id` is empty, and `start` refuses it (exit code 2) without sending anything. Clip jobs return `SUBMITTING`, `PROCESSING`, `READY` or `FAILED`. Newer states, failure codes and analysis clip-unavailability reasons pass through. Clip waits use the same timeout as analysis waits; Ctrl-C or a timeout leaves the job running. A status read without waiting returns a failed job as data. Clips are edited only in the web app. A ready job says whether they can be edited there now (`editable`), and an edited episode when its newest edit finished (`editedAt`); `clip-media --edited` gets that edit. Signed media URLs are credentials: keep the requested output private. They are never written to logs. Downloads send no API key to the media host, refuse redirects and remove partial files on failure. Active transfers have no total time limit; a stalled transfer times out. Creating and deleting clip jobs are never retried. If a create answer is lost, use `clip-list` before creating another job. If a delete answer is lost, `clip-status` returning `NOT_FOUND` confirms deletion. Requests that are safe to repeat (reads, `start`, `stop`) are retried after timeouts, network errors and HTTP 502, 503 or 504, and after `RATE_LIMITED` with a `Retry-After` of up to 30 s; creating and deleting an analysis never are. ## Analytics permission `mediaseer analytics-status` and `get_analytics_status` explicitly read only the API key owner’s account analytics permission. The boolean `accountAnalyticsEnabled` is permission, not a claim that collection is available or active; website permission, service configuration and collection availability are separate. An unavailable backend or a malformed response is an error, never a disabled-permission result. These clients send no client telemetry: no command/tool activity, result-view or download signals, telemetry-only calls or headers. Ordinary commands, tool discovery and server initialization never check analytics status. Ordinary backend operations inherit the key owner’s consent. A shared API key does not identify the human using it; unknown attribution remains unknown. These clients cannot grant or withdraw consent, request erasure or link identities. The optional `settingsUrl` links to the app’s Account analytics section (`/account#analytics`), without a key, account ID or query string. Authentication advice links to the API keys page (`/api-keys`). With the default production API it uses the production app. With a custom API, explicitly set `MEDIASEER_APP_URL` to that API’s app base URL, including any path prefix. Without it, the unverified settings link is omitted; text output gives configuration guidance, and CLI JSON mode puts that guidance on stderr. Missing-key guidance and MCP authentication advice follow the same verified-app policy. No API-to-app hostname mapping is inferred. Account consent and erasure controls belong in the app; this read-only status does not imply that those controls or collection are available in the deployed version. `usage` and `get_usage` also show the subscription status, renewal, cancellation and scheduled plan change when present. See [Plans and billing](https://mediaseer.ai/docs/billing/). Purchases and changes stay in the signed-in web app: while a plan has a price, the text output of `usage` and `plans` ends with its Billing page, linked under the same verified-app policy as `settingsUrl`. Text `usage` reads the plans for this; JSON output does not. ```bash mediaseer analytics-status ``` ```json { "accountAnalyticsEnabled": false } ``` The example shows the form returned for a custom API without `MEDIASEER_APP_URL`; a verified app configuration also includes `settingsUrl`. ## Output - **JSON mode**: when stdout is not a terminal (a pipe, a file, an agent’s tool), or with `--json`. stdout then carries the result and nothing else, one JSON document on one line; notes, retries and progress go to stderr. - In a terminal without `--json`, results are text for people, not a format to parse. - **Errors** go to stderr, in JSON mode as `{"error": {…}}` on the last line: | Field | Set | Meaning | | - | - | - | | `code` | always | What scripts branch on, never `message`. The API’s codes (`VALIDATION`, `NOT_FOUND`, `QUOTA_EXCEEDED`, …) are passed on as they are, also ones this version does not know. | | `message` | always | For people. | | `limit` | `QUOTA_EXCEEDED` | Which limit: `jobs`, `dailyStarts`, `sizeBytes`, `storage` (in a terminal without `--json` followed by how to make room), `minutes` (start), `clips` (clip-create; both in a terminal without `--json` followed by when they reset), or a newer one. | | `httpStatus` | the API answered | The HTTP status. | | `requestId` | the API answered | Give this identifier to support when reporting a problem. | | `retryAfterSeconds` | `RATE_LIMITED` | When the API takes requests again. | | `analysisId` | an analysis is concerned | The analysis the command was about, or the one an upload created; that one holds a slot unless `stopped`. | | `stopped` | an upload failed after creating one | `true`: mediaseer stopped that analysis, and it holds no slot. | | `candidateAnalysisId` | create got no clear answer | An analysis that may be the one the create made after all, or another upload’s (see above). | | `clipJobId` | waiting for a clip job failed | The clip job the error concerns. | | `clipErrorCode` | `CLIP_JOB_FAILED` | The API’s failure code, including newer values. | | `analysisErrorCode` | `ANALYSIS_FAILED` | The analysis’s error code, when available. | ### Exit codes Stable: scripts may branch on them, and a number never changes its meaning. Unknown codes are the codes this version does not know, from a newer API, and `UNEXPECTED_RESPONSE`, an answer not in the API’s format: they map by their HTTP status. | Exit | Meaning | `code` | | - | - | - | | 0 | OK | | | 1 | A bug in mediaseer, or an unknown code whose HTTP status says nothing more | `UNEXPECTED_ERROR`; unknown codes otherwise | | 2 | Wrong arguments or configuration, a file that cannot be uploaded, starting switched off, or the API rejected the input | `USAGE`, `INVALID_CONFIG`, `START_NOT_ALLOWED`, `FILE_NOT_FOUND`, `NOT_A_FILE`, `FILE_NOT_READABLE`, `NOT_A_VIDEO`, `FILE_CHANGED`, `VALIDATION` | | 3 | No API key, or the API does not accept it | `MISSING_API_KEY`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`; unknown codes with HTTP 401 or 403 | | 4 | Not found | `NOT_FOUND` | | 5 | An account limit was hit, or the file is larger than the limit per video | `QUOTA_EXCEEDED`, `FILE_TOO_LARGE` | | 6 | Too many requests, or the API is busy or starting up | `RATE_LIMITED`; unknown codes with HTTP 429 | | 7 | The analysis ended `FAILED` or `CANCELLED` | `ANALYSIS_FAILED`, `ANALYSIS_CANCELLED` | | 8 | `--wait` timed out; the analysis goes on | `WAIT_TIMEOUT` | | 9 | The API was unreachable, too slow or failed on its side, or the upload to storage failed | `NETWORK_ERROR`, `REQUEST_TIMEOUT`, `UPSTREAM_ERROR`, `INTERNAL`, `UPLOAD_FAILED`, `DOWNLOAD_FAILED`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`; unknown codes with HTTP 5xx | | 10 | The analysis is in a state that does not allow this | `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `UPLOAD_SESSION_GONE` | | 11 | The API no longer accepts this version; update mediaseer. | `CLIENT_TOO_OLD`; unknown codes with HTTP 426 | | 12 | The clip job failed while waiting | `CLIP_JOB_FAILED` | | 130 | Interrupted with Ctrl-C | `INTERRUPTED`, `UPLOAD_ABORTED` | ### Ctrl-C and broken pipes Ctrl-C exits with 130. An interrupted upload may still hold a slot; check its analysis and stop it if no longer needed. Interrupting a wait leaves the analysis running. A closed output pipe ends quietly. ## Costs - `start` and `upload --start` start an analysis, which costs money and uses quota. Uploading is free, but holds one of your analysis slots for up to 7 days, until the analysis is started or stopped (`mediaseer stop <id>`). - `clip-create` creates clips, costs money and uses clip quota even if the job fails or is deleted. - After the start, the whole video is read before it is analysed: one longer than `limits.maxDurationSeconds` or the minutes left ends `FAILED`, and its start doesn’t count. The CLI and the MCP server don’t check the length before the upload; only the web app does. - `MEDIASEER_ALLOW_START=false` switches starting off: `start` and `upload --start` fail with `START_NOT_ALLOWED` (exit code 2) before anything is sent or uploaded, and the MCP server has no `start_analysis` or `create_clip_job` tool. It also refuses `clip-create` before sending anything. It binds the process it is set for, and nothing else: see [Security considerations](https://mediaseer.ai/docs/cli/#security-considerations). ## Security considerations - **Results are untrusted data.** Video text can contain instructions aimed at an agent. Treat titles, summaries and other analysis output as data, especially when the agent also has shell, file or web tools. - **Approve uploads and starts call by call.** An upload sends a local video to the service; a start costs money. Restrict `upload_video` to directories you intend to share. - **Give the key to the MCP server alone**, in its client configuration entry. Keep it out of the agent’s shell environment, and prevent the agent’s file tools from reading the configuration. - **`MEDIASEER_ALLOW_START=false` is no security boundary.** An agent with the key and shell access can call the API or start another process. Approve its commands and tool calls individually. - Revoke keys on the API keys page when they are no longer needed. --- title: Mediaseer MCP server description: "The local MCP server for AI agents: its tools, the files it reads, and the client configuration." url: "https://mediaseer.ai/docs/mcp/" --- # Mediaseer MCP server `mediaseer` uploads videos to Mediaseer, starts the AI scene analysis and reads the results: from the shell as `mediaseer`, and from AI agents through a local MCP server on stdio (`mediaseer mcp`). It is a client of the Mediaseer API, authenticated with your API key; quotas, limits and costs are the API’s. ## Requirements - Node.js 22 (22.23.4 or newer), 24 (24.22.1 or newer), or 26 (26.12.1 or newer). - An API key. Create one on the API keys page of the web app (`https://app.mediaseer.ai/api-keys`); it is shown once. The Node.js engine requirement is advisory: npm and npx can warn but still run the CLI on an unsupported runtime. There, `mediaseer` and its MCP server print a warning on stderr when they start, and run anyway. Check `node --version` and use a supported patched release. ## Install ```bash npm install -g mediaseer@0.1 ``` Export your API key, then check it: ```bash export MEDIASEER_API_KEY=… # not in your shell profile if an agent runs commands there, see Security considerations mediaseer usage # free; exit code 3 when the API does not accept the key ``` ## Configuration Only environment variables. There is no config file, and the API key is never a command-line argument. | Variable | Default | Meaning | | - | - | - | | `MEDIASEER_API_KEY` | – | Your API key. | | `MEDIASEER_API_URL` | `https://api.mediaseer.ai` | API address; a trailing `/api/v1` is accepted. HTTPS is required except on localhost. | | `MEDIASEER_ALLOW_START` | `true` | `false`: nothing starts an analysis, which costs money (see [Costs](https://mediaseer.ai/docs/cli/#costs)). | | `MEDIASEER_UPLOAD_DIRS` | – | MCP server only: directories `upload_video` may read besides the project directory, separated by `:` (`;` on Windows), absolute; `~` is the home directory. See [Files the MCP server reads](https://mediaseer.ai/docs/mcp/#files-the-mcp-server-reads). | | `CLAUDE_PROJECT_DIR` | – | Set by Claude Code: the MCP server’s project directory. `upload_video` reads files in it and resolves relative paths against it. | ## Analytics permission `mediaseer analytics-status` and `get_analytics_status` explicitly read only the API key owner’s account analytics permission. The boolean `accountAnalyticsEnabled` is permission, not a claim that collection is available or active; website permission, service configuration and collection availability are separate. An unavailable backend or a malformed response is an error, never a disabled-permission result. These clients send no client telemetry: no command/tool activity, result-view or download signals, telemetry-only calls or headers. Ordinary commands, tool discovery and server initialization never check analytics status. Ordinary backend operations inherit the key owner’s consent. A shared API key does not identify the human using it; unknown attribution remains unknown. These clients cannot grant or withdraw consent, request erasure or link identities. The optional `settingsUrl` links to the app’s Account analytics section (`/account#analytics`), without a key, account ID or query string. Authentication advice links to the API keys page (`/api-keys`). With the default production API it uses the production app. With a custom API, explicitly set `MEDIASEER_APP_URL` to that API’s app base URL, including any path prefix. Without it, the unverified settings link is omitted; text output gives configuration guidance, and CLI JSON mode puts that guidance on stderr. Missing-key guidance and MCP authentication advice follow the same verified-app policy. No API-to-app hostname mapping is inferred. Account consent and erasure controls belong in the app; this read-only status does not imply that those controls or collection are available in the deployed version. `usage` and `get_usage` also show the subscription status, renewal, cancellation and scheduled plan change when present. See [Plans and billing](https://mediaseer.ai/docs/billing/). Purchases and changes stay in the signed-in web app: while a plan has a price, the text output of `usage` and `plans` ends with its Billing page, linked under the same verified-app policy as `settingsUrl`. Text `usage` reads the plans for this; JSON output does not. ```bash mediaseer analytics-status ``` ```json { "accountAnalyticsEnabled": false } ``` The example shows the form returned for a custom API without `MEDIASEER_APP_URL`; a verified app configuration also includes `settingsUrl`. ## Output - **JSON mode**: when stdout is not a terminal (a pipe, a file, an agent’s tool), or with `--json`. stdout then carries the result and nothing else, one JSON document on one line; notes, retries and progress go to stderr. - In a terminal without `--json`, results are text for people, not a format to parse. - **Errors** go to stderr, in JSON mode as `{"error": {…}}` on the last line: | Field | Set | Meaning | | - | - | - | | `code` | always | What scripts branch on, never `message`. The API’s codes (`VALIDATION`, `NOT_FOUND`, `QUOTA_EXCEEDED`, …) are passed on as they are, also ones this version does not know. | | `message` | always | For people. | | `limit` | `QUOTA_EXCEEDED` | Which limit: `jobs`, `dailyStarts`, `sizeBytes`, `storage` (in a terminal without `--json` followed by how to make room), `minutes` (start), `clips` (clip-create; both in a terminal without `--json` followed by when they reset), or a newer one. | | `httpStatus` | the API answered | The HTTP status. | | `requestId` | the API answered | Give this identifier to support when reporting a problem. | | `retryAfterSeconds` | `RATE_LIMITED` | When the API takes requests again. | | `analysisId` | an analysis is concerned | The analysis the command was about, or the one an upload created; that one holds a slot unless `stopped`. | | `stopped` | an upload failed after creating one | `true`: mediaseer stopped that analysis, and it holds no slot. | | `candidateAnalysisId` | create got no clear answer | An analysis that may be the one the create made after all, or another upload’s (see above). | | `clipJobId` | waiting for a clip job failed | The clip job the error concerns. | | `clipErrorCode` | `CLIP_JOB_FAILED` | The API’s failure code, including newer values. | | `analysisErrorCode` | `ANALYSIS_FAILED` | The analysis’s error code, when available. | ### Exit codes Stable: scripts may branch on them, and a number never changes its meaning. Unknown codes are the codes this version does not know, from a newer API, and `UNEXPECTED_RESPONSE`, an answer not in the API’s format: they map by their HTTP status. | Exit | Meaning | `code` | | - | - | - | | 0 | OK | | | 1 | A bug in mediaseer, or an unknown code whose HTTP status says nothing more | `UNEXPECTED_ERROR`; unknown codes otherwise | | 2 | Wrong arguments or configuration, a file that cannot be uploaded, starting switched off, or the API rejected the input | `USAGE`, `INVALID_CONFIG`, `START_NOT_ALLOWED`, `FILE_NOT_FOUND`, `NOT_A_FILE`, `FILE_NOT_READABLE`, `NOT_A_VIDEO`, `FILE_CHANGED`, `VALIDATION` | | 3 | No API key, or the API does not accept it | `MISSING_API_KEY`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`; unknown codes with HTTP 401 or 403 | | 4 | Not found | `NOT_FOUND` | | 5 | An account limit was hit, or the file is larger than the limit per video | `QUOTA_EXCEEDED`, `FILE_TOO_LARGE` | | 6 | Too many requests, or the API is busy or starting up | `RATE_LIMITED`; unknown codes with HTTP 429 | | 7 | The analysis ended `FAILED` or `CANCELLED` | `ANALYSIS_FAILED`, `ANALYSIS_CANCELLED` | | 8 | `--wait` timed out; the analysis goes on | `WAIT_TIMEOUT` | | 9 | The API was unreachable, too slow or failed on its side, or the upload to storage failed | `NETWORK_ERROR`, `REQUEST_TIMEOUT`, `UPSTREAM_ERROR`, `INTERNAL`, `UPLOAD_FAILED`, `DOWNLOAD_FAILED`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`; unknown codes with HTTP 5xx | | 10 | The analysis is in a state that does not allow this | `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `UPLOAD_SESSION_GONE` | | 11 | The API no longer accepts this version; update mediaseer. | `CLIENT_TOO_OLD`; unknown codes with HTTP 426 | | 12 | The clip job failed while waiting | `CLIP_JOB_FAILED` | | 130 | Interrupted with Ctrl-C | `INTERRUPTED`, `UPLOAD_ABORTED` | ## MCP server `mediaseer mcp` serves the tools below over stdio. Your client starts it with the same environment variables as the CLI. | Tool | Arguments | What it does | | - | - | - | | `list_plans` | – | List plan limits and available prices. Read-only. | | `get_usage` | – | The plan, free analysis slots, the analysed minutes and clips of this period against the plan’s limits and when they reset, the storage the source videos take against the plan’s limit and the clips’ storage, which has no limit, and the limits per video; warns when the minutes, the clips or the source videos’ storage are nearly used up. Free; checks the API key. Read-only. | | `get_analytics_status` | – | Reads account analytics permission and gives Account settings guidance; does not indicate collection availability. Sends no client telemetry and changes no consent or erasure state. Read-only. | | `upload_video` | `path`, `title?` | Uploads a video file from the project directory or `MEDIASEER_UPLOAD_DIRS` and creates an analysis; does not start it. Free, but holds a slot for up to 7 days until started or stopped. Answers within 45 s, with progress notifications meanwhile; a larger file goes on uploading in the background. | | `start_analysis` | `id` | Starts the analysis: costs money and uses quota. Idempotent. Refuses while this server is still uploading the video. Not offered with `MEDIASEER_ALLOW_START=false`. | | `get_status` | `id`, `waitSeconds?` (0 to 50) | The state, and the error message when it `FAILED`; for an upload of this server, how far it is. Waits up to `waitSeconds` for the analysis to end (or the upload to be complete); answers within 55 s in all. Read-only. | | `list_analyses` | `limit?` (1 to 50, default 20), `offset?` (0 to 2147483647) | The account’s analyses, newest first, as many as fit into one answer; `nextOffset` when more follow. Read-only. | | `get_scenes` | `id`, `query?`, `type?` (one or a list), `fromSeconds?`, `toSeconds?`, `fields?` (`compact`, `full`), `cursor?` | The scenes of a `FINISHED` analysis with the filters of `mediaseer scenes`, as many as fit into one answer; `nextCursor` when more follow. Read-only. | | `stop_analysis` | `id` | Deletes an `UPLOADING` analysis with its file, or cancels a `QUEUED` or `PROCESSING` one; either way its slot is free. Ends an upload of it this server is still sending. Destructive. | | `create_clip_job` | `analysisId`, `mode`, `prompt?`, `subtitles?` | Creates vertical clips; costs money and uses quota. Never retried. Not offered with `MEDIASEER_ALLOW_START=false`. | | `list_clip_jobs` | `analysisId`, `limit?`, `offset?` | Lists clip jobs, newest first, as many as fit in one answer; pass nextOffset as offset when present. Read-only. | | `get_clip_job` | `id`, `waitSeconds?` | Reads a job; optionally waits for READY or FAILED within the status request budget. Returns failed jobs as data. Read-only. | | `get_clip_media` | `id`, `episode`, `version?` | Signed watch, poster and download URLs, with version=EDITED of the newest edit from the web app; credentials for the requesting user only. Writes no local file. Read-only. | | `delete_clip_job` | `id`, `confirm` | Permanently deletes a job and its clips. Requires user confirmation and confirm=true. Destructive. Never retried. | There is no tool that deletes an analysis; that is `mediaseer delete` or the app. Every tool acts on the account of the API key and nothing else. Errors give guidance followed by the CLI’s error JSON. When an analysis failed, report its message rather than guessing. **Cache**: `get_scenes` may serve cached results for up to 5 minutes after an analysis is deleted. ### Files the MCP server reads `upload_video` reads only files in the project directory and in the directories of `MEDIASEER_UPLOAD_DIRS`. The path comes from a model, a prompt injection can name any file, and whatever `upload_video` reads leaves the computer. The CLI has no such limit: there you type the path yourself. - **Project directory**: `CLAUDE_PROJECT_DIR`, which Claude Code sets to the directory it runs in (run in your home directory, that is all of it). Relative paths are relative to it. - **`MEDIASEER_UPLOAD_DIRS`**: more directories, absolute, separated by `:` (`;` on Windows); `~` is your home directory. Entries that are no absolute paths are left out, and the error for a refused path says so. Set it in the `env` of the server’s entry in the client’s configuration. - **Neither**: only Claude Code sets `CLAUDE_PROJECT_DIR`. Without it and without `MEDIASEER_UPLOAD_DIRS` (Claude Desktop, Cursor and other clients, unless you set it), `upload_video` reads no files at all and says which variable to set. The server’s working directory does not count: in Claude Desktop it means nothing, and it may be `/` or your home directory. - Symbolic links that lead outside the allowed directories are refused. - A refused path comes back as `PATH_NOT_ALLOWED`, with the advice for the model to ask the user, not to copy the file elsewhere. Network and Windows device paths are refused as in the CLI (`NOT_A_FILE`). ### Uploads in the background - `upload_video` answers within 45 s. - Larger uploads continue in the background. Use `get_status` to follow their progress. - Ending the server cancels active uploads and attempts to stop their analyses. A background upload may not have an analysis id yet. If the server is killed, an `UPLOADING` analysis can remain: find it with `mediaseer list`, then use `mediaseer stop <id>` to free its slot. Uploads do not resume across server restarts; upload the file again. ### Client configuration **Claude Code**: give the key to the server alone, in its entry, rather than exporting it in your shell profile, where the shell commands the agent runs see it too (see [Security considerations](https://mediaseer.ai/docs/mcp/#security-considerations)): ```bash claude mcp add --scope user mediaseer --env MEDIASEER_API_KEY=… -- npx -y mediaseer@0.1 mcp ``` The key is then in `~/.claude.json`; the command, key included, also lands in your shell history. Claude Code sets `CLAUDE_PROJECT_DIR`, so `upload_video` reads files in the project; add more directories with `--env MEDIASEER_UPLOAD_DIRS=…`. For a project, in `.mcp.json`, with the key from each person’s environment (which then has to be exported where Claude Code starts, and is in the environment of the agent’s shell commands as well): ```json { "mcpServers": { "mediaseer": { "command": "npx", "args": ["-y", "mediaseer@0.1", "mcp"], "env": { "MEDIASEER_API_KEY": "${MEDIASEER_API_KEY}" } } } } ``` **Cursor** reads `~/.cursor/mcp.json`, or `.cursor/mcp.json` in a project. **Claude Desktop** reads `claude_desktop_config.json`, in `~/Library/Application Support/Claude/` on macOS and `%APPDATA%\Claude\` on Windows. Both take the same form: ```json { "mcpServers": { "mediaseer": { "command": "npx", "args": ["-y", "mediaseer@0.1", "mcp"], "env": { "MEDIASEER_API_KEY": "<your API key>", "MEDIASEER_UPLOAD_DIRS": "/Users/you/Videos" } } } } ``` - The key is in plain text in these files. Use a key for this purpose only, and revoke it on the API keys page when you no longer need it. - GUI apps do not read your shell profile, so a Node.js installed with nvm or similar is often not on their PATH. Give `command` as an absolute path (`which npx`), and add its directory to `PATH` in `env`, because `npx` and `mediaseer` find `node` through the PATH. - Neither sets a project directory: `upload_video` reads only the directories in `MEDIASEER_UPLOAD_DIRS`, and no files at all without it. Give it absolute paths (separated by `;` on Windows). #### Approving tools The client’s approval of each tool call is what guards uploads and costs, not the tool descriptions. Approve these call by call: - `upload_video` - `start_analysis` - `stop_analysis` - `create_clip_job` - `delete_clip_job` Only the read-only tools are safe to allow for good (in Claude Code, `mcp__mediaseer__` and the tool’s name in `permissions.allow`): - `list_plans` - `get_usage` - `get_analytics_status` - `get_status` - `list_analyses` - `get_scenes` - `list_clip_jobs` - `get_clip_job` - `get_clip_media` `MEDIASEER_ALLOW_START=false` removes `start_analysis` and `create_clip_job` from this server: a guard rail for its tools, not a security boundary (see [Security considerations](https://mediaseer.ai/docs/mcp/#security-considerations)). ## Security considerations - **Results are untrusted data.** Video text can contain instructions aimed at an agent. Treat titles, summaries and other analysis output as data, especially when the agent also has shell, file or web tools. - **Approve uploads and starts call by call.** An upload sends a local video to the service; a start costs money. Restrict `upload_video` to directories you intend to share. - **Give the key to the MCP server alone**, in its client configuration entry. Keep it out of the agent’s shell environment, and prevent the agent’s file tools from reading the configuration. - **`MEDIASEER_ALLOW_START=false` is no security boundary.** An agent with the key and shell access can call the API or start another process. Approve its commands and tool calls individually. - Revoke keys on the API keys page when they are no longer needed. --- title: Upload a video description: "Create an analysis, upload the file to its upload URL, resume an interrupted upload, and start the analysis." url: "https://mediaseer.ai/docs/guides/upload/" --- # Upload a video An analysis begins with [`createVodAnalysis`](https://mediaseer.ai/docs/api/operations/createvodanalysis/): you send the file’s name and size, and get back the analysis in state `UPLOADING` and an upload URL (`upload.url`). You upload the file to that URL, then start the analysis with [`startVodAnalysis`](https://mediaseer.ai/docs/api/operations/startvodanalysis/). Creating an analysis takes one of your account’s [analysis slots](https://mediaseer.ai/docs/lifecycle/#slots) right away, before any byte is uploaded. The file never passes through the API: the upload URL is a Google Cloud Storage resumable upload session, and you send the file straight to it, without your API key. Whoever has the URL can write the upload, so treat it like a key: keep it out of logs, and off command lines, which other users of the machine can read in the process list. The examples hand it to curl in a config file (`-K`). The examples need bash, curl and jq. They read `MEDIASEER_API_URL` (the API’s address without `/api/v1`, as in the [quickstart](https://mediaseer.ai/docs/guides/quickstart/#prepare)), `MEDIASEER_API_KEY` and `VIDEO_FILE` from the environment, and print `created: <id>` as soon as the analysis exists. ## Create and upload ```bash title="upload.sh" #!/usr/bin/env bash # # Creates an analysis for VIDEO_FILE and uploads the file to its upload URL the resumable way: it asks # the upload session how much it holds, then sends the rest. It doesn't start the analysis. set -euo pipefail base="${MEDIASEER_API_URL:?the API origin, without /api/v1}" base="${base%/}/api/v1" : "${MEDIASEER_API_KEY:?your API key}" file="${VIDEO_FILE:?the video file to upload}" api() { curl -q -sS -H @- "$@" <<<"X-Api-Key: $MEDIASEER_API_KEY"; } storage() { curl -q -s --globoff -K "$tmp/upload-url" "$@"; } tmp="$(mktemp -d)" trap 'rm -rf "$tmp"' EXIT name="$(basename "$file")" size="$(wc -c <"$file" | tr -d ' ')" case "$name" in *.mp4 | *.m4v) type=video/mp4 ;; *.mov) type=video/quicktime ;; *.webm) type=video/webm ;; *.mkv) type=video/x-matroska ;; *) type="" ;; esac # Create the analysis. It takes a slot, and its answer holds the upload URL. jq -n --arg name "$name" --argjson size "$size" --arg type "$type" \ '{fileName: $name, sizeBytes: $size} + (if $type == "" then {} else {contentType: $type} end)' \ >"$tmp/create.json" status="$(api -o "$tmp/created.json" -w '%{http_code}' -H 'Content-Type: application/json' \ --data-binary @"$tmp/create.json" "$base/vod-analysis")" || { echo "create got no answer: curl exit $?" >&2 exit 1 } if [[ "$status" != 201 ]]; then echo "create answered $status $(jq -r '.code // empty' "$tmp/created.json" 2>/dev/null || true)" >&2 exit 1 fi id="$(jq -r .analysis.id "$tmp/created.json")" echo "created: $id" # The upload URL is a credential: it goes into curl's config file and nowhere else. jq -r '"url = \(.upload.url | tojson)"' "$tmp/created.json" >"$tmp/upload-url" # Ask the session how much it holds. 308 means "not complete", with "Range: bytes=0-<last byte>" once # it holds anything; 200 or 201 means it already has the whole file. status="$(storage -o /dev/null -D "$tmp/headers" -w '%{http_code}' -X PUT \ -H 'Content-Length: 0' -H "Content-Range: bytes */$size")" || { echo "the upload failed: curl exit $?" >&2 exit 1 } if [[ "$status" == 308 ]]; then last="$(awk 'tolower($0) ~ /^range: bytes=0-/ { sub(/^[^-]*-/, ""); sub(/\r$/, ""); print }' "$tmp/headers")" if [[ -n "$last" && ! "$last" =~ ^(0|[1-9][0-9]*)$ ]]; then echo "the upload answered 308 with an unexpected Range header" >&2 exit 1 fi offset=$((${last:--1} + 1)) status="$(tail -c "+$((offset + 1))" "$file" | storage -o /dev/null -w '%{http_code}' --upload-file - \ -H "Transfer-Encoding:" -H "Content-Length: $((size - offset))" -H "Content-Range: bytes $offset-$((size - 1))/$size")" || { echo "the upload failed: curl exit $?" >&2 exit 1 } fi if [[ "$status" != 200 && "$status" != 201 ]]; then echo "the upload answered $status" >&2 exit 1 fi echo "uploaded: $id" ``` - The size you declare in `sizeBytes` is checked against the [size limit](https://mediaseer.ai/docs/limits/#file-size-and-video-length) when you create the analysis, and the uploaded file again when you start it. - Check the [upload URL and start deadlines](https://mediaseer.ai/docs/limits/#how-long-links-last). After the start deadline, create a new analysis. - If a step after the create fails, the analysis still holds its slot. Delete it with [`deleteVodAnalysis`](https://mediaseer.ai/docs/api/operations/deletevodanalysis/), or upload the file and start it. ## Resume an interrupted upload How an upload resumes depends on the client: - The app remembers an upload in your browser. Pick the same file again, also after a reload, and the upload goes on where it stopped. - The CLI resumes an upload after network errors only while it runs. Once the process has ended, nothing resumes it: upload the file again, as a new analysis. - With the API, it is your code that resumes, with the upload URL. Keep the URL until the upload has finished. To find out where to go on, send a `PUT` without a body to the upload URL, with `Content-Range: bytes */<size>`, as the example does before it sends anything: - `308` with `Range: bytes=0-<last>`: the session holds the bytes up to `<last>`. Send the rest from the next byte, with its `Content-Range`. - `308` without `Range`: the session holds nothing yet. Send the whole file. - `200` or `201`: the session has the whole file. - `404` or `410`: the session is gone. Create a new analysis. ## Not from your own web page Browser uploads work only from Mediaseer’s app; upload from your server or a native client. ## Start ```bash title="start.sh" #!/usr/bin/env bash # # Creates an analysis for VIDEO_FILE, uploads the file in one request and starts the analysis. The # start is paid: it runs an encoding and a scene analysis. set -euo pipefail base="${MEDIASEER_API_URL:?the API origin, without /api/v1}" base="${base%/}/api/v1" : "${MEDIASEER_API_KEY:?your API key}" file="${VIDEO_FILE:?the video file to analyse}" api() { curl -q -sS -H @- "$@" <<<"X-Api-Key: $MEDIASEER_API_KEY"; } storage() { curl -q -s --globoff -K "$tmp/upload-url" "$@"; } tmp="$(mktemp -d)" trap 'rm -rf "$tmp"' EXIT name="$(basename "$file")" size="$(wc -c <"$file" | tr -d ' ')" # Create the analysis: it takes a slot, and its answer holds the upload URL. jq -n --arg name "$name" --argjson size "$size" '{fileName: $name, sizeBytes: $size}' >"$tmp/create.json" status="$(api -o "$tmp/created.json" -w '%{http_code}' -H 'Content-Type: application/json' \ --data-binary @"$tmp/create.json" "$base/vod-analysis")" || { echo "create got no answer: curl exit $?" >&2 exit 1 } if [[ "$status" != 201 ]]; then echo "create answered $status $(jq -r '.code // empty' "$tmp/created.json" 2>/dev/null || true)" >&2 exit 1 fi id="$(jq -r .analysis.id "$tmp/created.json")" echo "created: $id" # Upload the whole file in one request. The upload URL goes into curl's config file and nowhere else. jq -r '"url = \(.upload.url | tojson)"' "$tmp/created.json" >"$tmp/upload-url" status="$(storage -o /dev/null -w '%{http_code}' --upload-file "$file" \ -H "Content-Range: bytes 0-$((size - 1))/$size")" || { echo "the upload failed: curl exit $?" >&2 exit 1 } if [[ "$status" != 200 && "$status" != 201 ]]; then echo "the upload answered $status" >&2 exit 1 fi # Start the analysis. From here on it costs money, also when you stop or delete it later. status="$(api -o "$tmp/started.json" -w '%{http_code}' -X POST -H 'Content-Length: 0' \ "$base/vod-analysis/$id/start")" || { echo "start got no answer: curl exit $?" >&2 exit 1 } if [[ "$status" != 202 ]]; then echo "start answered $status $(jq -r '.code // empty' "$tmp/started.json" 2>/dev/null || true)" >&2 exit 1 fi state="$(jq -r .state "$tmp/started.json")" echo "state: $state" ``` Starting is the step that costs money: it runs an encoding and a scene analysis, and counts against your [starts per day](https://mediaseer.ai/docs/limits/#starts-per-day). Stopping or deleting the analysis later doesn’t give the start back. The answer is `202` with the analysis in `QUEUED`. If the upload hasn’t finished yet, the start answers `409` `UPLOAD_INCOMPLETE` and the analysis stays `UPLOADING`; start it again once the upload is done. All of a start’s refusals are on the [limits page](https://mediaseer.ai/docs/limits/#when-create-and-start-refuse). To follow the analysis from here, see [Wait for the result](https://mediaseer.ai/docs/guides/wait/). --- title: Wait for the result description: "Poll an analysis until it finishes, fails or is cancelled." url: "https://mediaseer.ai/docs/guides/wait/" --- # Wait for the result Ask for the analysis with [getVodAnalysis](https://mediaseer.ai/docs/api/operations/getvodanalysis/) until it is `FINISHED`, `FAILED` or `CANCELLED`. See [lifecycle](https://mediaseer.ai/docs/lifecycle/) for the states. An accepted start also returns this status resource in the `Location` header. Resolve the URI reference against that request’s URL and authenticate the status request as usual. The response body still contains the analysis ID; the web app, CLI and local MCP server continue polling by that ID. Set `MEDIASEER_API_URL`, `MEDIASEER_API_KEY` and `ANALYSIS_ID` as described in the [quickstart](https://mediaseer.ai/docs/guides/quickstart/#prepare). The script exits with `0` for `FINISHED`, or `1` for failure, cancellation or timeout. The examples keep credentials out of curl’s command line and ignore your curl configuration. ```bash title="wait.sh" #!/usr/bin/env bash # # Asks for the analysis ANALYSIS_ID until it is final, at the CLI's interval and up to its timeout. Exits # 0 when it is FINISHED, 1 when it is FAILED or CANCELLED or the timeout has passed. set -euo pipefail base="${MEDIASEER_API_URL:?the API origin, without /api/v1}" base="${base%/}/api/v1" : "${MEDIASEER_API_KEY:?your API key}" id="${ANALYSIS_ID:?the id of an analysis}" api() { curl -q -sS -H @- "$@" <<<"X-Api-Key: $MEDIASEER_API_KEY"; } tmp="$(mktemp -d)" trap 'rm -rf "$tmp"' EXIT POLL_SECONDS=10 TIMEOUT_SECONDS=1800 deadline=$((SECONDS + TIMEOUT_SECONDS)) previous="" while true; do # No request outlasts the timeout: each one gets the time that is left. left=$((deadline - SECONDS)) if ((left <= 0)); then echo "still ${previous:-unknown} at the timeout; the analysis goes on without us" >&2 exit 1 fi status="$(api --max-time "$left" -o "$tmp/analysis.json" -w '%{http_code}' "$base/vod-analysis/$id")" || { echo "get failed or timed out: curl exit $?" >&2 exit 1 } if [[ "$status" != 200 ]]; then echo "get answered $status $(jq -r '.code // empty' "$tmp/analysis.json" 2>/dev/null || true)" >&2 exit 1 fi state="$(jq -r .state "$tmp/analysis.json")" if [[ "$state" != "$previous" ]]; then echo "state: $state" previous="$state" fi case "$state" in FINISHED) exit 0 ;; FAILED | CANCELLED) jq -r '.error.message // empty' "$tmp/analysis.json" >&2 exit 1 ;; esac if ((SECONDS + POLL_SECONDS > deadline)); then echo "still $state at the timeout; the analysis goes on without us" >&2 exit 1 fi sleep "$POLL_SECONDS" done ``` ## How often to ask The script polls every 10 seconds and waits up to 30 minutes. An analysis keeps running after you stop waiting. Mediaseer does not send webhook notifications to your code; poll for changes. --- title: Read and filter results description: "Get the full result of an analysis, filter it in your own code, and what the language parameter does today." url: "https://mediaseer.ai/docs/guides/read-results/" --- # Read and filter results Once an analysis is `FINISHED`, [`getVodAnalysisResults`](https://mediaseer.ai/docs/api/operations/getvodanalysisresults/) returns its full result: the video as a whole, its scenes, and the camera shots of each scene. The [result format](https://mediaseer.ai/docs/results/) page has the shape, what an absent or `UNKNOWN` value means, and how the API’s answer differs from the app’s JSON download ([two shapes](https://mediaseer.ai/docs/results/#two-shapes)). The examples need bash, curl and jq, and read `MEDIASEER_API_URL`, `MEDIASEER_API_KEY` and `ANALYSIS_ID` from the environment; see the [quickstart](https://mediaseer.ai/docs/guides/quickstart/#prepare). The examples keep credentials off curl’s command line and ignore your curl configuration. ## Optional browser observations Fetching results through an API, CLI or MCP tool is not a browser view or download signal. With effective permission, the web app records a foreground rendered-results view once per navigation and explicit JSON-report or `MP4`-clip download intent. Polling, URL refreshes, retries and late opt-in do not replay a view or imply a saved download. See [analytics settings](https://mediaseer.ai/docs/guides/analytics/). ## Filter in your code The API has no filter: no parameter picks scenes, scene types or a time range. You get the whole result and filter it in your own code. The example keeps the scenes that start in the first half of the video: ```bash title="results.sh" #!/usr/bin/env bash # # Gets the result of the analysis ANALYSIS_ID and keeps the scenes that start in the first half of the # video, each with its id, title, type, start and end. The API has no filter: this happens here. set -euo pipefail base="${MEDIASEER_API_URL:?the API origin, without /api/v1}" base="${base%/}/api/v1" : "${MEDIASEER_API_KEY:?your API key}" id="${ANALYSIS_ID:?the id of a finished analysis}" api() { curl -q -sS -H @- "$@" <<<"X-Api-Key: $MEDIASEER_API_KEY"; } tmp="$(mktemp -d)" trap 'rm -rf "$tmp"' EXIT status="$(api -o "$tmp/results.json" -w '%{http_code}' "$base/vod-analysis/$id/results")" || { echo "results got no answer: curl exit $?" >&2 exit 1 } if [[ "$status" != 200 ]]; then echo "results answered $status $(jq -r '.code // empty' "$tmp/results.json" 2>/dev/null || true)" >&2 exit 1 fi # A field without a value is left out, never null, so a scene can lack a start. Without the video's # duration, every scene with a start is kept. jq '.analysis | (if .duration then .duration / 2 else infinite end) as $half | [.scenes[] | select(.startInSeconds != null and .startInSeconds < $half) | {id, title, type, startInSeconds, endInSeconds} | with_entries(select(.value != null))]' "$tmp/results.json" ``` Other filters work the same way over `analysis.scenes`, for example `select(.type == "ADS")` for the scenes the analysis took for advertisements. A field without a value is left out, not sent as `null`, so a filter has to allow for missing fields. The result doesn’t change once the analysis is `FINISHED`: read it once and keep it. ## No translations Translated results are not available; see [result format](https://mediaseer.ai/docs/results/#translations). --- title: Watch an analysis description: Play a finished analysis in the app or a native player. url: "https://mediaseer.ai/docs/guides/watch/" --- # Watch an analysis The app plays a finished analysis next to its scenes. Through the API, [getVodAnalysisStream](https://mediaseer.ai/docs/api/operations/getvodanalysisstream/) returns `playlistUrl`; give it to a player unchanged. Set `MEDIASEER_API_URL`, `MEDIASEER_API_KEY` and `ANALYSIS_ID` as described in the [quickstart](https://mediaseer.ai/docs/guides/quickstart/#prepare). Playback URLs and playlists are credentials. Keep them out of logs. The examples pass URLs through curl configuration files and ignore your curl configuration. ```bash title="stream.sh" #!/usr/bin/env bash # # Gets a playback ticket for the analysis ANALYSIS_ID and loads its playlist, as a native player would. set -euo pipefail base="${MEDIASEER_API_URL:?the API origin, without /api/v1}" base="${base%/}/api/v1" : "${MEDIASEER_API_KEY:?your API key}" id="${ANALYSIS_ID:?the id of a finished analysis}" api() { curl -q -sS -H @- "$@" <<<"X-Api-Key: $MEDIASEER_API_KEY"; } player() { curl -q -s --globoff -K "$tmp/playlist-url" "$@"; } tmp="$(mktemp -d)" trap 'rm -rf "$tmp"' EXIT status="$(api -o "$tmp/stream.json" -w '%{http_code}' "$base/vod-analysis/$id/stream")" || { echo "stream got no answer: curl exit $?" >&2 exit 1 } if [[ "$status" != 200 ]]; then echo "stream answered $status $(jq -r '.code // empty' "$tmp/stream.json" 2>/dev/null || true)" >&2 exit 1 fi # The ticket in playlistUrl is a credential, and the playlists list signed URLs: neither goes to the output. # The URL goes into curl's config file and nowhere else. jq -r '"url = \(.playlistUrl | tojson)"' "$tmp/stream.json" >"$tmp/playlist-url" # The player's request: no API key, the ticket in the URL is enough. status="$(player -o "$tmp/master.m3u8" -w '%{http_code}')" || { echo "loading the playlist failed: curl exit $?" >&2 exit 1 } first="$(head -n 1 "$tmp/master.m3u8" | tr -d '\r')" if [[ "$status" != 200 || "$first" != "#EXTM3U" ]]; then echo "the playlist answered $status, or is no HLS playlist" >&2 exit 1 fi expires="$(jq -r .expiresAt "$tmp/stream.json")" echo "playlist: #EXTM3U" echo "ticket expires at $expires" ``` Request a new playback URL when it expires; see [link lifetimes](https://mediaseer.ai/docs/limits/#how-long-links-last). ## Native players, not your own web page A player on your own web page is blocked; use a native player or your server. This example uses ffplay from FFmpeg. ffplay and ffprobe expose the playback URL in the process list, so run them only on a machine you trust. ```bash title="play.sh" #!/usr/bin/env bash # # Plays the analysis ANALYSIS_ID in ffplay (FFmpeg's player): a native player, which the API's CORS rules # don't apply to. Needs FFmpeg's ffprobe and ffplay, and a display. set -euo pipefail base="${MEDIASEER_API_URL:?the API origin, without /api/v1}" base="${base%/}/api/v1" : "${MEDIASEER_API_KEY:?your API key}" id="${ANALYSIS_ID:?the id of a finished analysis}" api() { curl -q -sS -H @- "$@" <<<"X-Api-Key: $MEDIASEER_API_KEY"; } if ! command -v ffprobe >/dev/null || ! command -v ffplay >/dev/null; then echo "play.sh needs ffprobe and ffplay, which come with FFmpeg" >&2 exit 1 fi tmp="$(mktemp -d)" trap 'rm -rf "$tmp"' EXIT status="$(api -o "$tmp/stream.json" -w '%{http_code}' "$base/vod-analysis/$id/stream")" || { echo "stream got no answer: curl exit $?" >&2 exit 1 } if [[ "$status" != 200 ]]; then echo "stream answered $status $(jq -r '.code // empty' "$tmp/stream.json" 2>/dev/null || true)" >&2 exit 1 fi playlist="$(jq -r .playlistUrl "$tmp/stream.json")" # ffprobe and ffplay take the playlist URL only on their command line: while they run, other users of this # machine can see it, the ticket included, in the process list. Play on a machine only you use. # They also name their input in their log lines, and ffplay in its window title. So their output is off, and # the window gets a title of its own. # ffplay exits with 0 also when it can't open the stream, so ffprobe reads it first: it fails if the # playlists or the segments can't be loaded. probed=0 ffprobe -v quiet "$playlist" </dev/null >/dev/null 2>&1 || probed=$? if [[ "$probed" != 0 ]]; then echo "playback failed: ffprobe can't read the stream, exit $probed" >&2 exit 1 fi played=0 ffplay -hide_banner -loglevel quiet -autoexit -window_title Mediaseer "$playlist" </dev/null >/dev/null 2>&1 || played=$? if [[ "$played" != 0 ]]; then echo "playback failed: ffplay exited with $played" >&2 exit 1 fi ``` --- title: API keys description: Check a key and replace it without interrupting your integration. url: "https://mediaseer.ai/docs/guides/api-keys/" --- # API keys Create and revoke keys on the [API keys page](https://mediaseer.ai/app/api-keys). [Accounts and auth](https://mediaseer.ai/docs/auth/#api-keys) explains their permissions and shared quota. ## Analytics permission Ordinary backend operations inherit the owning account’s analytics permission. A shared key does not identify the human using it. The CLI and MCP server send no client telemetry; their explicit analytics-status operation reads permission only and cannot change consent or request erasure. Manage those controls in [Account → Analytics](https://mediaseer.ai/app/account#analytics); see [analytics settings](https://mediaseer.ai/docs/guides/analytics/). ## Check a key Set `MEDIASEER_API_URL` and `MEDIASEER_API_KEY` as described in the [quickstart](https://mediaseer.ai/docs/guides/quickstart/#prepare). The example reads your usage and starts nothing. It keeps the key off curl’s command line and ignores your curl configuration. ```bash title="check-key.sh" #!/usr/bin/env bash # # Checks that MEDIASEER_API_KEY works, without creating or starting anything: it asks for the account's # usage. Run it with a new key before you revoke the old one. set -euo pipefail base="${MEDIASEER_API_URL:?the API origin, without /api/v1}" base="${base%/}/api/v1" : "${MEDIASEER_API_KEY:?the API key to check}" api() { curl -q -sS -H @- "$@" <<<"X-Api-Key: $MEDIASEER_API_KEY"; } tmp="$(mktemp -d)" trap 'rm -rf "$tmp"' EXIT status="$(api -o "$tmp/usage.json" -w '%{http_code}' "$base/usage")" || { echo "usage got no answer: curl exit $?" >&2 exit 1 } if [[ "$status" != 200 ]]; then code="$(jq -r '.code // empty' "$tmp/usage.json" 2>/dev/null || true)" echo "the key doesn't work: usage answered $status $code" >&2 exit 1 fi jq -r '.jobs | "the key works: \(.used) of \(.limit) analysis slots used, \(.remaining) left"' "$tmp/usage.json" ``` ## Replace a key - Create a new key and switch your integration to it. - Check the new key with the example. - Confirm every job uses the new key before revoking the old one. `lastUsedAt` in the app is a delayed hint, not proof. - Revoke the old key; its next request returns `401` `UNAUTHENTICATED`. If a key leaked, revoke it first, then create a replacement. --- title: Analytics settings description: "Choose website and account permissions, withdraw, and request or check analytics erasure." url: "https://mediaseer.ai/docs/guides/analytics/" --- # Analytics settings ## Choose or reopen settings Use **Analytics settings** on the website, docs or app, or open [app-hosted settings](https://mediaseer.ai/app/analytics-settings). Yes and no are each one click and last 30 days in this browser on the app origin. After expiry, browser recording is off until a fresh voluntary choice. Saying no does not affect registration, uploads, analyses, results or downloads. While this browser has no choice and recording is switched on, the website and docs ask in a box at the bottom of the page, with Allow and Don’t allow side by side; closing it without a choice leaves recording off. Only the necessary preference is stored before opt-in. The website and docs coordinate with a dedicated app-origin bridge. Analytics identities, ownership proofs, bearer and refresh credentials and API keys stay off the website origin, URLs and shared-domain cookies. Staging and unrelated origins do not contact the production bridge. Permission is separate from availability. The canonical app runtime for its environment is the only collection authority; a website cannot supply a project key or turn collection on. Unsupported browser coordination, storage failure, unknown sessions, unavailable permissions or SDK initialization failure keep recording off. Controls and owned erasure remain available when collection is disabled. New browser identities have a separate release gate and remain unavailable until that gate is enabled. ## Website and account permission An anonymous visitor needs website permission and a server-owned browser identity. When signed in, browser recording requires **both** website and account permission. In [Account → Analytics](https://mediaseer.ai/app/account#analytics) one choice sets both; while they differ, for example after allowing on another device, neither option shows and a line says which one allows. The app links an owned visitor only after both permissions hold and its owner proof is verified. Logging out or changing accounts closes the old context; it is never reused as an anonymous visitor or silently linked to another account. Website withdrawal stops browser recording; it does not erase history or change account permission. Account permission also controls server events for ordinary operations, including operations made with the account’s API keys. Keys cannot grant consent. A shared key attributes activity to its owning account, not to an identified human. The CLI and MCP server send no client telemetry. Their explicit analytics-status operation reads account permission only; it does not measure collection availability. ## What browser observations mean The browser catalogue contains a fixed list of pages, validated registration and upload intent, actually rendered foreground results and explicit JSON-report or `MP4`-clip download intent. A request is not proof that registration, upload or a saved download succeeded. Hidden renders, polling, cache refreshes, repeated focus, later opt-in and retries never replay a previous view. Demo interactions and sharing are outside this catalogue. Page observations use PostHog’s standard `$pageview` event for its pageview and active-user metrics. A pageview includes an SDK-generated session ID held only in memory while that consent context is active, and the page’s path from that list: the path of a website, docs or app page, or a fixed template where the address holds an ID or a reference page’s name, such as `/app/analyses/:id` or `/docs/api/schemas/:schema`. A page that is not on the list is not recorded. A new SDK context or page load starts a new session; sessions are not persisted across those boundaries. These paths never contain an analysis ID, visited URL or query string. The boundary excludes names, email addresses, filenames, media contents, full URLs, query strings, referrers, free-text errors and profile updates. SDK automatic capture, replay, heatmaps, performance collection and remote flags are disabled. Its configured ingestion path is PostHog EU. Network traffic still has an IP address; provider IP-discard policy is a separate activation requirement, not a claim of network anonymity. Where available, a small owned inactivity control carries the original observation time and permission revisions, not event details or arbitrary subject identifiers. It never writes success, productive-return or quota history; permission reads and polling are not productive use. An acknowledgement may be a no-op. Optional analytics never makes the product action wait for provider completion. ## Withdraw or erase Withdrawal stops further recording and keeps existing history. Account recording stays off while a No request is pending or its outcome is unknown. A confirmed No also blocks an older Allow request that reaches the server later; allowing again requires a new explicit choice. **Delete analytics data** requests erasure of the account’s analytics and covered linked visitor identities, and of the anonymous records this browser holds. A retained browser proof also offers anonymous erasure and status without signing in. These actions do not delete the product account, analyses or media. An account request covers its current identity even when an older inactivity erasure is still pending. Repeating that account request while it is pending returns its fixed request; it never widens an older deletion snapshot. Acceptance retires the affected identities and closes old queued or retrying captures. Already dispatched requests cannot be recalled. `REQUESTED` and `RUNNING` mean deletion is pending; `FAILED` is not completion. `COMPLETED` is the API’s reported completion state, not an independently verified provider result from this page. No exact physical deletion deadline is promised. A fresh opt-in uses a fresh identity after erasure and does not cancel older deletion. An older pending-erasure status does not imply that a newer identity’s permission is off. Retired ownership proofs remain useful for status; no browser proof-expiry or eviction policy is implied by the preference lifetime. Losing app-origin browser storage can lose anonymous erasure access. A lost identity response is not automatically retried and cannot recover its missing proof. ## Availability and privacy requirements Inactivity cleanup and provider event retention are different policies. Provider Free-plan caps, retention, IP-discard, deletion verification and feature-specific privacy acceptance remain activation requirements. The existing general privacy-policy link alone does not verify those requirements. Analytics operations remain outside the public API reference while delivery gates are open. The separately gated minimal first-success history is not enabled by an analytics choice. Its design distinguishes known from unknown legacy history, survives analysis deletion and is cleared by analytics erasure; activation and privacy approval remain separate. Voluntary analytics cohorts are not a whole-population denominator. --- title: Retries and recovery description: "Reconcile uncertain requests, distinguish quota refusals from authentication throttles, and avoid duplicate paid work." url: "https://mediaseer.ai/docs/guides/retries/" --- # Retries and recovery ## Check what happened first A timeout or lost response does not tell you whether a request took effect. Read the resource, or list its jobs, before repeating a mutation. Keep the resource ID once you receive it. Treat a structured refusal separately from an answer you never received. The API does not support an `Idempotency-Key` header. Sending one does not deduplicate creation requests. | Operation | After an uncertain answer | | - | - | | [Create an analysis](https://mediaseer.ai/docs/api/operations/createvodanalysis/) | Inspect [your analyses](https://mediaseer.ai/docs/api/operations/listvodanalyses/) before creating another. Repeating an accepted create takes another slot. A matching filename alone does not establish that a resource is the same upload. | | [Start an analysis](https://mediaseer.ai/docs/api/operations/startvodanalysis/) | Read [its status](https://mediaseer.ai/docs/api/operations/getvodanalysis/). Start is idempotent while queued or processing: another call returns that resource without starting more work. A terminal resource cannot restart. | | [Stop an analysis](https://mediaseer.ai/docs/api/operations/stopvodanalysis/) | Read its status first. A retry can report that the resource is gone after an upload was abandoned, or that cancellation has already happened. | | [Create clips](https://mediaseer.ai/docs/api/operations/createclipjob/) | Inspect [that analysis’s clip jobs](https://mediaseer.ai/docs/api/operations/listclipjobs/) before creating another. Repeating an accepted create makes another job and consumes quota again. | | [Delete an analysis](https://mediaseer.ai/docs/api/operations/deletevodanalysis/) or [clip job](https://mediaseer.ai/docs/api/operations/deleteclipjob/) | Read it to reconcile an uncertain delete. Confirmed absence completes the cleanup; an authentication error does not establish absence. | An explicit refusal that creates nothing differs from an uncertain response: follow the operation’s documented error and recovery action. Do not turn a network failure during creation into an automatic second create. For reads after transient network or server errors, use bounded backoff with jitter rather than a tight loop. [Waiting for results](https://mediaseer.ai/docs/guides/wait/) describes normal status polling. ## Quota refusals For `QUOTA_EXCEEDED`, inspect `details[].field`. These quota refusals do not include `Retry-After`; retrying an unchanged request repeatedly does not free capacity. | Field | Recovery | | - | - | | `jobs` | Delete an analysis you no longer need to free an analysis slot. | | `storage` | Delete analyses you no longer need. Clips do not count against the storage limit; a successful analysis deletion frees storage at once. | | `sizeBytes` | Use a smaller file. | | `dailyStarts` | Wait until the next UTC day. Stopping or deleting an analysis does not refund a start. | | `activeClipJobs` | Wait for a job to finish, reading its status, or delete an unwanted job to free its active slot. | | `dailyClipJobs` | Wait until the next UTC day. A failed or deleted clip job still counts. | | `minutes` | Wait until `period.end` in usage, then start again. Deleting an analysis gives no minutes back. | | `clips` | Wait until `period.end` in usage. Deleted clips still count. | Follow the response’s guidance for another refusal. [Limits and costs](https://mediaseer.ai/docs/limits/) explains account limits and [the lifecycle](https://mediaseer.ai/docs/lifecycle/) explains analysis slots and state changes. Get the user’s approval before paid work or deleting their data. ## Authentication throttles Account authentication operations can return `RATE_LIMITED` with `Retry-After`, expressed in seconds. Honor that wait when it is present. This is different from the quota refusals above; do not assume every rate-limit response has that header. An invalid or revoked API key needs [replacement](https://mediaseer.ai/docs/guides/api-keys/), not repeated attempts. --- title: Glossary description: "What accounts, analyses, uploads, encodings, slots, starts, scenes and shots mean in Mediaseer." url: "https://mediaseer.ai/docs/glossary/" --- # Glossary These terms have the same meaning in the app, API, CLI and MCP server. Mediaseer is the product; Bitmovin AI Scene Analysis is the technology that analyses the video. ## Account The owner of analyses and API keys. See [Accounts and auth](https://mediaseer.ai/docs/auth/) for access and quota rules, and [API keys](https://mediaseer.ai/docs/guides/api-keys/) for managing keys. ## Analysis The resource that tracks a video upload, its processing state and access to its result and playback. Its analysis id identifies the resource throughout its [lifecycle](https://mediaseer.ai/docs/lifecycle/). ## Upload session The resumable transfer used to send the source file to storage. The upload URL is its credential. See [Upload a video](https://mediaseer.ai/docs/guides/upload/) for sending the file, resuming a transfer and starting the analysis. Use “upload session” for this transfer, and “sign-in session” for access to the account through the app. ## Encoding Preparation of the video for playback, performed as part of processing an analysis. Scene analysis describes the video’s content. You start and follow the analysis through Mediaseer. See [Starting](https://mediaseer.ai/docs/lifecycle/#starting). ## Analysis result The description of the video, its scenes and their shots. See [Result format](https://mediaseer.ai/docs/results/) for response shapes and value meanings, and [Read and filter results](https://mediaseer.ai/docs/guides/read-results/) for retrieving it. ## Analysis slot Capacity to hold an analysis in the account, separate from the daily start allowance. See [Slots](https://mediaseer.ai/docs/lifecycle/#slots) for which analyses count and when a slot is freed, and [Analysis slots](https://mediaseer.ai/docs/limits/#analysis-slots) for the allowance and usage report. ## Start Admission of an uploaded analysis to processing, counted against your account’s daily start allowance. See [Starting](https://mediaseer.ai/docs/lifecycle/#starting) for retry behavior and [Starts per day](https://mediaseer.ai/docs/limits/#starts-per-day) for the allowance and refund rules. ## Scene and shot A scene is a section of the video described by the analysis. A shot is an individual camera shot listed under a scene; it can cross the scene’s boundary, and the result may omit shots or the whole breakdown. Scene and shot start and end times are measured from the beginning of the video; the scenes need not cover the video without gaps. See [Scene](https://mediaseer.ai/docs/api/schemas/scene/) and [Shot](https://mediaseer.ai/docs/api/schemas/shot/). ## Ad opportunity An assessment of how suitable the end of a scene is for an ad break, in `adOpportunityInformation`. It describes a possible placement. A scene classified as `ADS` instead describes advertising already in the source video. See [AdOpportunity](https://mediaseer.ai/docs/api/schemas/adopportunity/) and [SceneType](https://mediaseer.ai/docs/api/schemas/scenetype/). --- title: Lifecycle description: "Analysis states, occupied slots, starting, stopping and deleting." url: "https://mediaseer.ai/docs/lifecycle/" --- # Lifecycle An [analysis](https://mediaseer.ai/docs/glossary/#analysis) is the resource that tracks a video from upload through processing to its result. Finishing the upload leaves it `UPLOADING` until you call `start`. | State | Meaning | | - | - | | `UPLOADING` | Created. Upload the file, then start it. | | `QUEUED` | Started. The video’s length is checked, then it waits. | | `PROCESSING` | The video is being analysed. | | `FINISHED` | Results and playback are ready. | | `FAILED` | The analysis could not start or finish. `error.message` says why. | | `CANCELLED` | The analysis was stopped. | `error.message` is Mediaseer’s own sentence, never the processing platform’s text. It names the cause when Mediaseer knows it, such as a video over the [length limit](https://mediaseer.ai/docs/limits/#file-size-and-video-length) or a start that never ran; otherwise it says only that the encoding failed or no longer exists. Don’t branch on its wording. While an analysis is `QUEUED`, Mediaseer reads the whole video to measure its length before it is processed. A video longer than the length limit ends `FAILED` then, and its start doesn’t count. The length measured then is final: it is the one counted in the period’s analysed minutes once the analysis finishes. Ask for the analysis until its state is final: `FINISHED`, `FAILED` or `CANCELLED`. An analysis can reach a final state without you observing `PROCESSING`. The [wait guide](https://mediaseer.ai/docs/guides/wait/) shows how. ## Slots Creating an analysis takes an [analysis slot](https://mediaseer.ai/docs/limits/#analysis-slots). - `UPLOADING` holds its slot until the [upload window](https://mediaseer.ai/docs/limits/#how-long-links-last) expires. After that it cannot be started and stays in your list until deleted. - `QUEUED`, `PROCESSING` and `FINISHED` hold a slot until deleted. - `FAILED` and `CANCELLED` free their slot and remain in the list until deleted. ## Starting Starting a `QUEUED` or `PROCESSING` analysis again returns it without starting another run. The [limits page](https://mediaseer.ai/docs/limits/#when-create-and-start-refuse) lists create and start refusals. Retrying a start after `502` `UPSTREAM_ERROR` is safe. After an uncertain answer, check the analysis’s state. A start confirmed not to have run no longer counts against your starts for that day. ## Stop and delete - Stop an `UPLOADING` analysis to remove it from your account and free its slot. - Stop a `QUEUED` or `PROCESSING` analysis to mark it `CANCELLED` and free its slot. Processing may still be stopping after the response. The start still counts against your daily starts. - Stopping a final analysis returns `409` `INVALID_STATE`. Delete works in any state and removes the analysis from your account. File and processing-record cleanup is described on the [data page](https://mediaseer.ai/docs/data/). If deletion returns `502`, retrying is safe. An in-progress analysis then stays `CANCELLED`; other analyses keep their state. ## Clip jobs A clip job cuts the video of a `FINISHED` analysis into clips. Creating one answers right away with the job in `SUBMITTING`. It becomes `PROCESSING` once its clips are being made, or `FAILED`, with the reason in `error`, when it could not be started. The clips of a `READY` job can be edited in the web app, while the job’s `editable` is `true`. Once an edit has finished, the clip’s `editedAt` says when, and `getClipEpisodeMedia` with `version=EDITED` returns the URLs of its newest edit; without `version` it returns the clip as it was made. Deleting a clip job works in any state and removes the job and its clips from your account at once. A job whose clips are still being made is stopped, also one deleted while `SUBMITTING`. Deleting an analysis deletes its clip jobs too. Cleanup at the clip service is described on the [data page](https://mediaseer.ai/docs/data/#clips). --- title: Limits and costs description: "Analysis slots, daily starts, video limits, storage, analysed minutes, clips and link lifetimes." url: "https://mediaseer.ai/docs/limits/" --- # Limits and costs Starting an analysis is paid work. Uploading and reading results do not start an analysis. These are the current limits; they may change before launch. ## Optional analytics availability Analytics permission does not mean collection is available. Provider Free-plan caps, event retention and inactivity cleanup are separate from your analysis quotas; they remain activation requirements, without an exact deletion-time promise. Disabling analytics does not reduce product access. See [analytics settings](https://mediaseer.ai/docs/guides/analytics/). ## Analysis slots An account has 10 analysis slots. Creating an analysis takes one. [Usage](https://mediaseer.ai/docs/api/operations/getusage/) reports used, remaining and total slots. The [lifecycle page](https://mediaseer.ai/docs/lifecycle/#slots) explains when a slot is freed. ## File size and video length A file can be at most 2 GiB (2147483648 bytes), and a video at most 30 minutes long (1800 seconds). `limits` in usage reports both. After the start, while the analysis is `QUEUED`, the whole video is read to measure its length. An analysis of a longer video ends `FAILED`, without results, before it is processed, and so does one that can’t be read as a video. So does a video without a video track, and one longer than the [minutes left](https://mediaseer.ai/docs/limits/#minutes-and-clips) in the period. Its start doesn’t count, and no minutes are counted. The web app reads the length before the upload when the browser can, and refuses a longer video there. ## Starts per day Your account can start 5 analyses per UTC day. This allowance is not reported by usage today. When it is used up, try again on the next UTC day. Stopping or deleting does not refund a start. A start confirmed not to have run no longer counts against your starts for that day. ## Storage `storage.usedBytes` in [usage](https://mediaseer.ai/docs/api/operations/getusage/) is the storage your source videos and clips take, in bytes: `storage.sourceBytes`, what your source videos (your analyses) take, plus `storage.clipBytes`, what your clips take. `storage.limitBytes` is the storage your plan includes for source videos; it is absent when your plan has no storage limit. Clips have no storage limit and never count against it. `plan` names your plan. - An analysis counts the size declared for its upload from creation on. An `UPLOADING` one counts nothing once its [upload window](https://mediaseer.ai/docs/limits/#how-long-links-last) has passed. - Once an analysis is `FINISHED`, it counts the files it keeps instead: the original video when it is kept for clips, the playback copy and the analysis results. They are measured when the platform reports that it finished, or when the analysis itself is read (not the list); until then it counts the declared size. - A clip job counts its clips and posters once they have been measured. That happens when the ready job itself is read (its status or its clips, as the app does when it shows them), not the list of jobs. A ready job that is only listed is measured by a background check that runs several times an hour. - A `FAILED` or `CANCELLED` analysis counts nothing, and so does a clip job that failed. When your plan has a storage limit, creating an analysis is refused (`429` `QUOTA_EXCEEDED`, `storage`) when the size declared for its upload does not fit into what `storage.sourceBytes` leaves of the limit. Creating a clip job is never refused for storage. `storage.sourceBytes` can end up over the limit: a finished analysis counts what it keeps once it is measured, which can be more than the size declared for its upload. To make room, delete analyses you no longer need; deleting clip jobs makes no room, as clips do not count. A successful delete of an analysis or a clip job takes its storage out of `storage.usedBytes` right away. When the files themselves are gone is on the [data page](https://mediaseer.ai/docs/data/). The app, the [CLI](https://mediaseer.ai/docs/cli/) and the [MCP server](https://mediaseer.ai/docs/mcp/) show the figure in decimal units with at most one decimal: MB, or GB once it reaches a full GB. The CLI’s `--json` output and the MCP server’s structured result carry the bytes. With a limit, the app, the CLI’s text output and the MCP server’s text show the source videos’ storage against the limit and warn once they use 80% of it, and show the clips’ storage without a limit. ## Minutes and clips Your plan can limit two things per period: analysed minutes and clips. [Usage](https://mediaseer.ai/docs/api/operations/getusage/) reports both, the limits your plan sets for them and when the period ends. The app’s billing page shows the same. - `minutes.usedSeconds` is what you analysed this period, in seconds: the length of the uploaded video of each finished analysis, per second, rounded up. Only `FINISHED` analyses count; a running, failed or cancelled one counts nothing. - `clips.used` is the finished clips of this period. Deleted clips still count, so deleting clip jobs gives none back; nor does deleting an analysis give its minutes back. - `minutes.limitSeconds` and `clips.limit` are your plan’s limits. Each is absent when your plan has no such limit: then nothing is refused for it, and nothing warns. - `period.end` is when the period ends and both start again from zero. Nothing left over carries into the next period. On a paid plan, the period is your billing period, split into months for a yearly price; otherwise it runs monthly from the day (UTC) you signed up. It runs from midnight UTC to midnight UTC; in a month without its starting day, it starts on the month’s last day. At a limit there is a hard stop until `period.end`: - Starting an analysis is refused (`429` `QUOTA_EXCEEDED`, `minutes`) once the minutes are used up. Start it again after the reset, within its [upload window](https://mediaseer.ai/docs/limits/#how-long-links-last); that window can end before the reset, and stopping the analysis frees its slot. - An analysis of a video longer than the minutes left ends `FAILED` as soon as its length is known, without results and with the error “The video is longer than the minutes left in this period.” It counts no minutes. While your other analyses are `QUEUED` or `PROCESSING`, their videos’ lengths, measured when they were checked and rounded up to whole seconds, are already held of what is left, though `minutes.usedSeconds` counts them only once they finish: so two videos that each fit can’t both be analysed when together they don’t. - Creating a clip job is refused (`429` `QUOTA_EXCEEDED`, `clips`) once the clips are used up. A job’s clips count once it is `READY`, and one job can make several, so jobs created before the limit was reached can take `clips.used` over it. The app, the [CLI](https://mediaseer.ai/docs/cli/)’s text output and the [MCP server](https://mediaseer.ai/docs/mcp/)’s text show both against their limits and when they reset, and warn once one reaches 80% of its limit. The first time it does in a period, your account’s email address also gets one email for that limit, once you have confirmed it. Before an upload, the app reads the video’s length when the browser can, and refuses a video longer than the minutes left; that check is only a hint, the API decides. ## When create and start refuse | Answer | Applies to | What to do | | - | - | - | | `403` `EMAIL_NOT_VERIFIED` | Create and start, when [email confirmation](https://mediaseer.ai/docs/auth/#confirmed-email) is required | Confirm your email in the app. | | `429` `QUOTA_EXCEEDED`, `jobs` | Create | Delete an analysis to free a slot. | | `429` `QUOTA_EXCEEDED`, `sizeBytes` | Create and start | Use a smaller file. | | `429` `QUOTA_EXCEEDED`, `dailyStarts` | Create and start | Try again on the next UTC day. | | `429` `QUOTA_EXCEEDED`, `storage` | Create | Delete analyses you no longer need. | | `429` `QUOTA_EXCEEDED`, `minutes` | Start | Start again after the [reset](https://mediaseer.ai/docs/limits/#minutes-and-clips) at `period.end`. | | `409` `UPLOAD_INCOMPLETE` | Start | Finish uploading, then start again. | | `409` `INVALID_STATE` | Start | A final analysis cannot restart. For an expired upload window, create a new analysis. | For `QUOTA_EXCEEDED`, `details[].field` identifies the limit. Follow the response’s guidance for another refusal. ## How long links last - An upload URL works for 6 days (`upload.expiresAt`). - You can start an analysis within 7 days of creation, including after its upload URL expires if the upload completed. After that, create a new analysis. - A [playback URL](https://mediaseer.ai/docs/api/operations/getvodanalysisstream/) works for 10 minutes (`expiresAt`). Request another when it expires; video segments the player already has keep playing. --- title: Plans and billing description: "Compare plan limits and prices, and read your subscription status." url: "https://mediaseer.ai/docs/billing/" --- # Plans and billing ## Compare plans Use [`mediaseer plans`](https://mediaseer.ai/docs/cli/) or the [`list_plans` tool](https://mediaseer.ai/docs/mcp/) to see plan limits and available prices. Integrations can use the [plans endpoint](https://mediaseer.ai/docs/api/operations/listplans/) with an API key. A price gives the currency, the amount in its smallest unit, and the billing interval. A plan without a price has no purchase offer. This includes Free and plans that are not available to buy in the current environment. A missing limit means the plan does not set that limit. ## Check your subscription `mediaseer usage`, `get_usage`, and the [usage endpoint](https://mediaseer.ai/docs/api/operations/getusage/) show the current plan and its [limits](https://mediaseer.ai/docs/limits/). When a subscription exists, the `subscription` field shows its status and any renewal, cancellation or scheduled plan change reported by the payment provider. An absent subscription does not mean a past purchase failed; an ended subscription is no longer shown. Your current plan stays in `plan`. A scheduled change appears separately under `subscription.change` until it takes effect. A scheduled cancellation shows when the subscription ends instead of when it renews. ## Manage billing Buying, changing or cancelling a plan, undoing a scheduled change, and managing cards or invoices require a signed-in web app session when billing is available. The CLI, MCP tools and API keys are read-only for billing; while a plan has a price, the text output of `mediaseer usage` and `mediaseer plans` ends with a link to the app’s Billing page, where it is done. Plan details can take a moment to update after a change; read usage again to see which plan applies. --- title: Accounts and auth description: "Create an API key, authenticate requests and manage your account." url: "https://mediaseer.ai/docs/auth/" --- # Accounts and auth ## Analytics permission Account analytics permission belongs to the account owner. Browser recording additionally requires website permission; API keys cannot grant consent, erase analytics or link identities. Shared-key activity belongs to its owning account, without identifying the human using it. [Analytics settings](https://mediaseer.ai/docs/guides/analytics/) explains the separate controls. ## Authentication methods Mediaseer’s public REST API uses an account API key. Browser sign-in is for the web app. ## API keys ### Create credentials Create a key on the [API keys page](https://mediaseer.ai/app/api-keys). It is shown once. ### Making requests Your code sends the key in the `X-Api-Key` header for analyses, results, playback requests and [usage](https://mediaseer.ai/docs/api/operations/getusage/). The [CLI](https://mediaseer.ai/docs/cli/) and the [MCP server](https://mediaseer.ai/docs/mcp/) of the npm package `mediaseer` read it from the environment variable `MEDIASEER_API_KEY` and send it for you. The [API reference](https://mediaseer.ai/docs/api/) lists the operations and schemas. Download its public [OpenAPI specification](https://mediaseer.ai/docs/openapi.yaml) to generate a client. For playback, give the player the `playlistUrl` returned by [getVodAnalysisStream](https://mediaseer.ai/docs/api/operations/getvodanalysisstream/) unchanged. ### Handling authentication errors A missing, wrong or revoked key gets `401` `UNAUTHENTICATED`. ### Key expiry and revocation All keys for an account share its quota. Keys have no scopes and do not expire. Revoke a key in the app when it is no longer needed. The [API keys guide](https://mediaseer.ai/docs/guides/api-keys/) shows how to check and replace one. ## Your account [Register in the app](https://mediaseer.ai/app/register), then create keys on the [API keys page](https://mediaseer.ai/app/api-keys) and manage your account on the [Account page](https://mediaseer.ai/app/account). The app also manages password changes. An API key cannot manage your account. Revoke a key on the API keys page when it is no longer needed or may have been exposed. The [API keys guide](https://mediaseer.ai/docs/guides/api-keys/) shows how to replace a key without leaving a caller using the old one. ## Confirmed email New accounts receive an email confirmation link. The app can send a replacement. Creating and starting an analysis need a confirmed address: until then, both answer `403` `EMAIL_NOT_VERIFIED`, and a create makes nothing. --- title: Your data description: "Retention of uploads, results and account data, and what deletion removes." url: "https://mediaseer.ai/docs/data/" --- # Your data Deletion can be asynchronous or best effort. Becoming eligible for deletion does not mean the data is already gone. ## Optional analytics [Analytics settings](https://mediaseer.ai/docs/guides/analytics/) separates withdrawal from erasure. Erasing analytics does not delete your product account, analyses or media. Acceptance stops the retired identities; provider deletion can remain pending. Retained browser ownership proofs allow anonymous erasure and status, but losing app-origin storage can lose that access. A fresh identity never cancels an older pending deletion. Preference expiry is separate from proof retention and provider event retention. Minimal first-success history is separately gated and is not enabled by opting in. Its design preserves known or unknown history after analysis deletion and clears it on analytics erasure; privacy approval remains required. ## Uploads and results | Data | Retention and deletion | | - | - | | Uploaded file | On successful analysis, supported files are retained with the results for clip generation. Other files are deleted best effort. Failed and cancelled analyses keep the upload until deletion or its retention period. | | Upload storage | Every upload becomes eligible for deletion 7 days after upload completion. Storage deletes eligible files asynchronously; there is no guaranteed deletion deadline. Deleted uploads are not retained for recovery. | | Results and retained original | Stay with the analysis, including partial results of failed or cancelled runs. Deleting the analysis requests their deletion. If the request returns `502`, retry it. Processing that is still stopping, or a copy of the original still in progress, can write a file after the deletion: for a cancelled or failed analysis, or one with a retained original, the outputs are deleted once more, automatically, after its processing has ended. Deleted outputs remain recoverable for 7 days. Remaining output files have no automatic deletion deadline. | The original is retained for `mp4`, `mov`, `mkv`, `m4v`, `avi` and `webm` uploads. Older analyses may not have a retained original. Stopping an upload or deleting an analysis also requests deletion of its uploaded file, best effort. ## Clips | Data | Retention and deletion | | - | - | | Clips | Deleting a clip job, or its analysis, removes its clips, and the edits made of them in the web app, from your account at once and requests their deletion at the clip service: right away for a finished job, after it has stopped for one still in progress. Deletion is best effort: clips whose deletion fails can remain at the clip service, unreachable from your account, without an automatic deletion deadline. | | Clip job records | Hidden when the job is deleted, and removed once the clip service confirms the deletion of its clips. A job deleted before its clips were started keeps a hidden record. | ## Processing records | Data | Retention and deletion | | - | - | | Processing-service record | May contain analysis results and storage references. Deletion is best effort. Deleting the analysis requests the record’s deletion, and so does a refused start that created one. When the processing service doesn’t confirm a deletion, it is retried automatically until it does; there is no guaranteed deletion deadline. | ## Account and analysis records | Data | Retention and deletion | | - | - | | Analysis metadata | Removed when deletion completes. Unstarted, failed and cancelled analyses otherwise stay in your account until you delete them. | | Daily usage counters | Remain after analysis and clip job deletion. | | Account and sign-in data | Remain: the app and API do not currently offer account deletion. | | Database backups | Daily backups retain deleted records until 7 newer backups have been taken. | | Transaction logs | Deleted records remain for up to 3 days. | These database backup and transaction-log retention periods are enforced by the database service. --- title: API reference url: "https://mediaseer.ai/docs/api/" --- # API reference > Send your API key in the `X-Api-Key` header. See [Accounts and auth](https://mediaseer.ai/docs/auth/). ## Mediaseer API 0.1.0 Upload videos, start analyses and read their scenes, highlights and ad opportunities. Authenticate with an API key in the `X-Api-Key` header. - Resources belong to the caller. A resource owned by another user is reported as `404`, never as `403`. - HTTP error responses use the `Error` schema. Platform errors are passed through neither there nor in an analysis’s `error`. - Mediaseer resource IDs are opaque strings. Scene IDs come from the analysis results. - Timestamps are RFC 3339 in UTC. - Playback is the one exception to header auth: the player fetches the playlist with a short-lived ticket in the URL (see `getVodAnalysisStream`), because media elements send no headers. Information - License: Proprietary - OpenAPI version: `3.0.3` ## Operations - GET [/vod-analysis](https://mediaseer.ai/docs/api/operations/listvodanalyses/) - POST [/vod-analysis](https://mediaseer.ai/docs/api/operations/createvodanalysis/) - GET [/vod-analysis/{id}](https://mediaseer.ai/docs/api/operations/getvodanalysis/) - DELETE [/vod-analysis/{id}](https://mediaseer.ai/docs/api/operations/deletevodanalysis/) - POST [/vod-analysis/{id}/start](https://mediaseer.ai/docs/api/operations/startvodanalysis/) - POST [/vod-analysis/{id}/stop](https://mediaseer.ai/docs/api/operations/stopvodanalysis/) - GET [/vod-analysis/{id}/results](https://mediaseer.ai/docs/api/operations/getvodanalysisresults/) - GET [/vod-analysis/{id}/stream](https://mediaseer.ai/docs/api/operations/getvodanalysisstream/) - GET [/vod-analysis/{id}/clip-jobs](https://mediaseer.ai/docs/api/operations/listclipjobs/) - POST [/vod-analysis/{id}/clip-jobs](https://mediaseer.ai/docs/api/operations/createclipjob/) - GET [/clip-jobs/{id}](https://mediaseer.ai/docs/api/operations/getclipjob/) - DELETE [/clip-jobs/{id}](https://mediaseer.ai/docs/api/operations/deleteclipjob/) - GET [/clip-jobs/{id}/episodes/{episode}/media](https://mediaseer.ai/docs/api/operations/getclipepisodemedia/) - GET [/usage](https://mediaseer.ai/docs/api/operations/getusage/) - GET [/plans](https://mediaseer.ai/docs/api/operations/listplans/) ## Authentication ### apiKeyAuth API key created on the Account page of the app. **Security scheme type:** apiKey **Header parameter name:** X-Api-Key --- title: VOD analysis url: "https://mediaseer.ai/docs/api/operations/tags/vod-analysis/" --- # VOD analysis ## vod-analysis Upload a video and run AI scene analysis on it. One resource = one upload = one analysis. ## Operations - GET [/vod-analysis](https://mediaseer.ai/docs/api/operations/listvodanalyses/) - POST [/vod-analysis](https://mediaseer.ai/docs/api/operations/createvodanalysis/) - GET [/vod-analysis/{id}](https://mediaseer.ai/docs/api/operations/getvodanalysis/) - DELETE [/vod-analysis/{id}](https://mediaseer.ai/docs/api/operations/deletevodanalysis/) - POST [/vod-analysis/{id}/start](https://mediaseer.ai/docs/api/operations/startvodanalysis/) - POST [/vod-analysis/{id}/stop](https://mediaseer.ai/docs/api/operations/stopvodanalysis/) - GET [/vod-analysis/{id}/results](https://mediaseer.ai/docs/api/operations/getvodanalysisresults/) - GET [/vod-analysis/{id}/stream](https://mediaseer.ai/docs/api/operations/getvodanalysisstream/) --- operationId: listVodAnalyses title: List my VOD analyses url: "https://mediaseer.ai/docs/api/operations/listvodanalyses/" --- # List my VOD analyses `GET /vod-analysis` URL: `api.mediaseer.ai/api/v1/vod-analysis` Newest first. A minimal projection; use `getVodAnalysis` for the full resource. ## Authorizations - **[apiKeyAuth](https://mediaseer.ai/docs/api/#apikeyauth)** ## Parameters ### Query Parameters - `limit` integer: Maximum number of items to return, newest first. The response can contain fewer items. `default: 20`, `>= 1`, `<= 100` - `offset` integer: Number of items to skip, starting from the newest. Use the same limit when fetching later pages. `0` ## Responses ### 200 OK Media type: application/json object - `items` Array\<object>, required: A summary of one analysis. `title`, `description`, `sceneCount`, `keywords` and `durationSeconds` come from the analysis results and are absent until it is `FINISHED` (`title` may be present earlier if given at create). object - `id` string, required - `state` string, required - `UPLOADING`: created, waiting for the client to upload and call `start` - `QUEUED`: started; the video’s length is checked, then it waits to be processed - `PROCESSING`: encoding and analysis running - `FINISHED`: results available - `FAILED`: could not start or finish, or the video was too long; see `error` - `CANCELLED`: stopped by you or the processing service Allowed values: `UPLOADING`, `QUEUED`, `PROCESSING`, `FINISHED`, `FAILED`, `CANCELLED` - `fileName` string, required: Name of the uploaded file. - `createdAt` string, format: date-time, required - `title` string: Given at create, else inferred by the analysis. - `description` string: Summary of the whole video, from the analysis. - `sceneCount` integer - `keywords` Array\<string> - `durationSeconds` number, format: double - `total` integer, required: Total number of resources of the caller, regardless of paging. - `limit` integer, required - `offset` integer, required #### Example ```json { "items": [ { "id": "7f3c2a1e-0b4d-4c7e-9a52-1d2e3f4a5b6c", "state": "UPLOADING", "fileName": "episode-01.mp4", "title": "Los Angeles 1947", "description": "A noir mystery set in Los Angeles in 1947.", "sceneCount": 9, "keywords": [ "Los Angeles", "1947", "mystery" ], "durationSeconds": 719.02 } ] } ``` ### 401 Missing, invalid or expired credentials (`UNAUTHENTICATED`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### default Unexpected error Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` --- operationId: createVodAnalysis title: Create a VOD analysis and open an upload session url: "https://mediaseer.ai/docs/api/operations/createvodanalysis/" --- # Create a VOD analysis and open an upload session > Each analysis you create takes one of your account's analysis slots. The numbers are on the [limits page](https://mediaseer.ai/docs/limits/). `POST /vod-analysis` URL: `api.mediaseer.ai/api/v1/vod-analysis` Checks the caller’s quota and the declared file size, creates the resource in state `UPLOADING` and returns a resumable upload session URL for Google Cloud Storage. The client uploads the file straight to that URL (chunked, resumable) and then calls `start`. Uploads never pass through this API. Not idempotent: repeating an accepted request creates another analysis and uses another slot. After a timeout or lost response, inspect `listVodAnalyses` before deciding to create another. There is no idempotency-key header to deduplicate creation requests. See <https://mediaseer.ai/docs/guides/retries/> for retry and reconciliation guidance. A confirmed email may be required: otherwise `403` (`EMAIL_NOT_VERIFIED`) and nothing is created. [Quota recovery policy](https://mediaseer.ai/docs/guides/retries/#quota-refusals) ## Authorizations - **[apiKeyAuth](https://mediaseer.ai/docs/api/#apikeyauth)** ## Request Body required Media type: application/json object - `fileName` string, required: Name of the file the client is about to upload. Shown until a title exists. `>= 1 characters`, `<= 255 characters` ### Example ```plaintext episode-01.mp4 ``` - `sizeBytes` integer, format: int64, required: Declared file size, checked against the size limit before an upload session is issued. `>= 1` ### Example ```json 734003200 ``` - `contentType` string: MIME type the client will send: a `video/*` type. Omit it when the type is unknown. `<= 100 characters` ### Example ```plaintext video/mp4 ``` - `title` string: Optional title. Without it, the analysis’s inferred title is used once known, and `fileName` until then. `<= 255 characters` ## Responses ### 201 Created. Upload to `upload.url`, then call `start`. Media type: application/json object - `analysis` required object - `id` string, required - `state` string, required - `UPLOADING`: created, waiting for the client to upload and call `start` - `QUEUED`: started; the video’s length is checked, then it waits to be processed - `PROCESSING`: encoding and analysis running - `FINISHED`: results available - `FAILED`: could not start or finish, or the video was too long; see `error` - `CANCELLED`: stopped by you or the processing service Allowed values: `UPLOADING`, `QUEUED`, `PROCESSING`, `FINISHED`, `FAILED`, `CANCELLED` - `fileName` string, required: Name of the uploaded file. - `createdAt` string, format: date-time, required - `title` string: Given at create, else inferred by the analysis. - `description` string: Summary of the whole video, from the analysis. - `sceneCount` integer - `keywords` Array\<string> - `durationSeconds` number, format: double - `updatedAt` string, format: date-time, required - `sizeBytes` integer, format: int64: Size of the uploaded object; known from `start` on. - `startedAt` string, format: date-time: When `start` was accepted. - `finishedAt` string, format: date-time: When the resource reached a terminal state. - `error`: Why the analysis failed. Only set in state `FAILED`. object - `message` string, required: A sentence for people, in Mediaseer’s own words, never the processing platform’s text. It names the cause when Mediaseer knows it, such as a video longer than the length limit or a start that never ran; otherwise it says only that the encoding failed or no longer exists. Don’t branch on its wording. - `clips`: Whether clips can be created from this analysis, and if not, why. Treat an absent `clips` as not available. object - `available` boolean, required: Whether clips can be created from the analysis now. - `reason` string: Why not. Set exactly while `available` is `false`. Allowed values: `UNSUPPORTED_FILE_TYPE`, `NOT_FINISHED`, `TOO_LONG`, `CREATED_BEFORE_CLIPS`, `SOURCE_NOT_KEPT` - `upload` required: A Google Cloud Storage resumable upload session. Upload the file with `PUT` requests to `url` (whole file, or chunks with `Content-Range`); the session supports resuming after a network drop. No credentials are needed; the URL is the credential. object - `url` string, format: uri, required - `expiresAt` string, format: date-time, required: Deadline for uploading to this URL. A completed upload can still be started within the analysis’s upload window. #### Example ```json { "analysis": { "id": "7f3c2a1e-0b4d-4c7e-9a52-1d2e3f4a5b6c", "state": "UPLOADING", "fileName": "episode-01.mp4", "title": "Los Angeles 1947", "description": "A noir mystery set in Los Angeles in 1947.", "sceneCount": 9, "keywords": [ "Los Angeles", "1947", "mystery" ], "durationSeconds": 719.02, "sizeBytes": 734003200, "error": { "message": "The encoding failed." }, "clips": { "reason": "UNSUPPORTED_FILE_TYPE" } }, "upload": { "url": "https://storage.googleapis.com/upload/storage/v1/b/example-uploads/o?uploadType=resumable&upload_id=example" } } ``` ### 400 The request is malformed or fails validation (`VALIDATION`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 401 Missing, invalid or expired credentials (`UNAUTHENTICATED`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 403 The credentials are valid but this action is not allowed (`FORBIDDEN`), or a confirmed email is required to create or start an analysis (`EMAIL_NOT_VERIFIED`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 429 A limit was hit (`QUOTA_EXCEEDED`). `details[].field` can name your analysis slots (`jobs`), file size (`sizeBytes`), your plan’s storage for source videos (`storage`, when creating an analysis), your plan’s analysed minutes (`minutes`, when starting an analysis) or daily starts (`dailyStarts`). - `jobs`: delete an analysis you no longer need to free a slot. - `sizeBytes`: use a smaller file; retrying the same oversized upload does not help. - `storage`: the file’s size does not fit into what your source videos (`storage.sourceBytes` in `getUsage`) leave of `storage.limitBytes`. Clips do not count. Delete analyses you no longer need; a successful delete frees their storage at once. - `minutes`: no analysed minutes are left in this period (`minutes` in `getUsage`). They start again from 0 at `period.end`; deleting an analysis does not give them back. - `dailyStarts`: wait until the next UTC day. Stopping or deleting an analysis does not refund a daily start. Follow the response’s guidance for another refusal. These quota refusals do not include a `Retry-After` header; do not repeatedly retry an unchanged request. See <https://mediaseer.ai/docs/guides/retries/#quota-refusals> for recovery guidance. Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### default Unexpected error Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` --- operationId: getVodAnalysis title: Get a VOD analysis url: "https://mediaseer.ai/docs/api/operations/getvodanalysis/" --- # Get a VOD analysis `GET /vod-analysis/{id}` URL: `api.mediaseer.ai/api/v1/vod-analysis/{id}` The full resource without the analysis results (see `getVodAnalysisResults`). After starting an analysis, poll this operation until `state` is `FINISHED`, `FAILED` or `CANCELLED`. Only `FINISHED` has results; use `getVodAnalysisResults` to read them. ## Authorizations - **[apiKeyAuth](https://mediaseer.ai/docs/api/#apikeyauth)** ## Parameters ### Path Parameters - `id` string, required: The analysis’s opaque `id`, returned by `createVodAnalysis` or `listVodAnalyses`. ## Responses ### 200 OK Media type: application/json object - `id` string, required - `state` string, required - `UPLOADING`: created, waiting for the client to upload and call `start` - `QUEUED`: started; the video’s length is checked, then it waits to be processed - `PROCESSING`: encoding and analysis running - `FINISHED`: results available - `FAILED`: could not start or finish, or the video was too long; see `error` - `CANCELLED`: stopped by you or the processing service Allowed values: `UPLOADING`, `QUEUED`, `PROCESSING`, `FINISHED`, `FAILED`, `CANCELLED` - `fileName` string, required: Name of the uploaded file. - `createdAt` string, format: date-time, required - `title` string: Given at create, else inferred by the analysis. - `description` string: Summary of the whole video, from the analysis. - `sceneCount` integer - `keywords` Array\<string> - `durationSeconds` number, format: double - `updatedAt` string, format: date-time, required - `sizeBytes` integer, format: int64: Size of the uploaded object; known from `start` on. - `startedAt` string, format: date-time: When `start` was accepted. - `finishedAt` string, format: date-time: When the resource reached a terminal state. - `error`: Why the analysis failed. Only set in state `FAILED`. object - `message` string, required: A sentence for people, in Mediaseer’s own words, never the processing platform’s text. It names the cause when Mediaseer knows it, such as a video longer than the length limit or a start that never ran; otherwise it says only that the encoding failed or no longer exists. Don’t branch on its wording. - `clips`: Whether clips can be created from this analysis, and if not, why. Treat an absent `clips` as not available. object - `available` boolean, required: Whether clips can be created from the analysis now. - `reason` string: Why not. Set exactly while `available` is `false`. Allowed values: `UNSUPPORTED_FILE_TYPE`, `NOT_FINISHED`, `TOO_LONG`, `CREATED_BEFORE_CLIPS`, `SOURCE_NOT_KEPT` #### Example ```json { "id": "7f3c2a1e-0b4d-4c7e-9a52-1d2e3f4a5b6c", "state": "UPLOADING", "fileName": "episode-01.mp4", "title": "Los Angeles 1947", "description": "A noir mystery set in Los Angeles in 1947.", "sceneCount": 9, "keywords": [ "Los Angeles", "1947", "mystery" ], "durationSeconds": 719.02, "sizeBytes": 734003200, "error": { "message": "The encoding failed." }, "clips": { "reason": "UNSUPPORTED_FILE_TYPE" } } ``` ### 401 Missing, invalid or expired credentials (`UNAUTHENTICATED`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 404 No such resource for this caller (`NOT_FOUND`). Other users’ resources look the same. Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### default Unexpected error Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` --- operationId: deleteVodAnalysis title: Delete a VOD analysis url: "https://mediaseer.ai/docs/api/operations/deletevodanalysis/" --- # Delete a VOD analysis `DELETE /vod-analysis/{id}` URL: `api.mediaseer.ai/api/v1/vod-analysis/{id}` Removes the analysis from your account, in any state. An analysis in progress is stopped first. File and processing-record cleanup is best effort; see <https://mediaseer.ai/docs/data/>. A `502` (`UPSTREAM_ERROR`) can be retried safely. ## Authorizations - **[apiKeyAuth](https://mediaseer.ai/docs/api/#apikeyauth)** ## Parameters ### Path Parameters - `id` string, required: The analysis’s opaque `id`, returned by `createVodAnalysis` or `listVodAnalyses`. ## Responses ### 204 Deleted ### 401 Missing, invalid or expired credentials (`UNAUTHENTICATED`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 404 No such resource for this caller (`NOT_FOUND`). Other users’ resources look the same. Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### default Unexpected error Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` --- operationId: startVodAnalysis title: Start the analysis after the upload finished url: "https://mediaseer.ai/docs/api/operations/startvodanalysis/" --- # Start the analysis after the upload finished > Starting an analysis is a paid start. Stopping or deleting the analysis does not give it back. The numbers are on the [limits page](https://mediaseer.ai/docs/limits/). `POST /vod-analysis/{id}/start` URL: `api.mediaseer.ai/api/v1/vod-analysis/{id}/start` Verifies that the uploaded object exists in storage, records its size and starts the encoding with scene analysis. Moves the resource from `UPLOADING` to `QUEUED`. Refused (`429`, field `minutes`) when no analysed minutes are left in this period; a video longer than the minutes left ends `FAILED` once its length is known (`minutes` in `getUsage`). While `QUEUED`, the whole video is read to check its length before the encoding starts. A file that can’t be read as a video, one without a video track, and a video longer than the length limit or the minutes left end `FAILED` with a reason in `error.message`; such a start doesn’t count towards the daily starts, and no minutes are counted. Idempotent: calling it again while `QUEUED` or `PROCESSING` returns the current resource without starting anything. In a terminal state it returns `409`, as does an `UPLOADING` resource whose upload window (7 days from creation) has passed: create a new one instead. A `502` (`UPSTREAM_ERROR`) can be retried safely. Check the analysis’s state after an uncertain answer. See <https://mediaseer.ai/docs/guides/retries/> for retry and reconciliation guidance. [Quota recovery policy](https://mediaseer.ai/docs/guides/retries/#quota-refusals) ## Authorizations - **[apiKeyAuth](https://mediaseer.ai/docs/api/#apikeyauth)** ## Parameters ### Path Parameters - `id` string, required: The analysis’s opaque `id`, returned by `createVodAnalysis` or `listVodAnalyses`. ## Responses ### 202 Accepted. The resource is `QUEUED` (or already further along). Poll `getVodAnalysis` (`GET /vod-analysis/{id}`) with this resource’s `id` until `state` is `FINISHED`, `FAILED` or `CANCELLED`. The `Location` header is a same-origin status-resource URI reference; resolve it against the request URL. Acceptance does not mean that results are ready. Media type: application/json object - `id` string, required - `state` string, required - `UPLOADING`: created, waiting for the client to upload and call `start` - `QUEUED`: started; the video’s length is checked, then it waits to be processed - `PROCESSING`: encoding and analysis running - `FINISHED`: results available - `FAILED`: could not start or finish, or the video was too long; see `error` - `CANCELLED`: stopped by you or the processing service Allowed values: `UPLOADING`, `QUEUED`, `PROCESSING`, `FINISHED`, `FAILED`, `CANCELLED` - `fileName` string, required: Name of the uploaded file. - `createdAt` string, format: date-time, required - `title` string: Given at create, else inferred by the analysis. - `description` string: Summary of the whole video, from the analysis. - `sceneCount` integer - `keywords` Array\<string> - `durationSeconds` number, format: double - `updatedAt` string, format: date-time, required - `sizeBytes` integer, format: int64: Size of the uploaded object; known from `start` on. - `startedAt` string, format: date-time: When `start` was accepted. - `finishedAt` string, format: date-time: When the resource reached a terminal state. - `error`: Why the analysis failed. Only set in state `FAILED`. object - `message` string, required: A sentence for people, in Mediaseer’s own words, never the processing platform’s text. It names the cause when Mediaseer knows it, such as a video longer than the length limit or a start that never ran; otherwise it says only that the encoding failed or no longer exists. Don’t branch on its wording. - `clips`: Whether clips can be created from this analysis, and if not, why. Treat an absent `clips` as not available. object - `available` boolean, required: Whether clips can be created from the analysis now. - `reason` string: Why not. Set exactly while `available` is `false`. Allowed values: `UNSUPPORTED_FILE_TYPE`, `NOT_FINISHED`, `TOO_LONG`, `CREATED_BEFORE_CLIPS`, `SOURCE_NOT_KEPT` #### Example ```json { "id": "7f3c2a1e-0b4d-4c7e-9a52-1d2e3f4a5b6c", "state": "UPLOADING", "fileName": "episode-01.mp4", "title": "Los Angeles 1947", "description": "A noir mystery set in Los Angeles in 1947.", "sceneCount": 9, "keywords": [ "Los Angeles", "1947", "mystery" ], "durationSeconds": 719.02, "sizeBytes": 734003200, "error": { "message": "The encoding failed." }, "clips": { "reason": "UNSUPPORTED_FILE_TYPE" } } ``` #### Headers - `Location` string, format: uri-reference: Status resource for this analysis, also returned on an idempotent accepted start. ##### Example ```plaintext /api/v1/vod-analysis/747eab8d-d788-4abd-ae9e-144b930df539 ``` ### 401 Missing, invalid or expired credentials (`UNAUTHENTICATED`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 403 The credentials are valid but this action is not allowed (`FORBIDDEN`), or a confirmed email is required to create or start an analysis (`EMAIL_NOT_VERIFIED`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 404 No such resource for this caller (`NOT_FOUND`). Other users’ resources look the same. Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 409 Not startable. `UPLOAD_INCOMPLETE`: no object was found in storage yet; the analysis stays `UPLOADING`, and a start after the upload has finished can succeed. `INVALID_STATE`: the resource is in a terminal state, or its upload window has passed. Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 429 A limit was hit (`QUOTA_EXCEEDED`). `details[].field` can name your analysis slots (`jobs`), file size (`sizeBytes`), your plan’s storage for source videos (`storage`, when creating an analysis), your plan’s analysed minutes (`minutes`, when starting an analysis) or daily starts (`dailyStarts`). - `jobs`: delete an analysis you no longer need to free a slot. - `sizeBytes`: use a smaller file; retrying the same oversized upload does not help. - `storage`: the file’s size does not fit into what your source videos (`storage.sourceBytes` in `getUsage`) leave of `storage.limitBytes`. Clips do not count. Delete analyses you no longer need; a successful delete frees their storage at once. - `minutes`: no analysed minutes are left in this period (`minutes` in `getUsage`). They start again from 0 at `period.end`; deleting an analysis does not give them back. - `dailyStarts`: wait until the next UTC day. Stopping or deleting an analysis does not refund a daily start. Follow the response’s guidance for another refusal. These quota refusals do not include a `Retry-After` header; do not repeatedly retry an unchanged request. See <https://mediaseer.ai/docs/guides/retries/#quota-refusals> for recovery guidance. Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### default Unexpected error Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` --- operationId: stopVodAnalysis title: Stop an analysis in progress url: "https://mediaseer.ai/docs/api/operations/stopvodanalysis/" --- # Stop an analysis in progress `POST /vod-analysis/{id}/stop` URL: `api.mediaseer.ai/api/v1/vod-analysis/{id}/stop` - `UPLOADING`: the upload is abandoned; the resource and any partial object are deleted and the response is `204`. - `QUEUED` or `PROCESSING`: cancellation is requested and the resource moves to `CANCELLED`. Processing may still be stopping after the response. - Terminal states: `409`. File cleanup is best effort; see <https://mediaseer.ai/docs/data/>. After a timeout or lost response, read `getVodAnalysis` before retrying. A retry can return `404` after an upload was abandoned, or `409` after cancellation already took effect. See <https://mediaseer.ai/docs/guides/retries/> for retry and reconciliation guidance. ## Authorizations - **[apiKeyAuth](https://mediaseer.ai/docs/api/#apikeyauth)** ## Parameters ### Path Parameters - `id` string, required: The analysis’s opaque `id`, returned by `createVodAnalysis` or `listVodAnalyses`. ## Responses ### 200 Stopped. The resource is `CANCELLED`. Media type: application/json object - `id` string, required - `state` string, required - `UPLOADING`: created, waiting for the client to upload and call `start` - `QUEUED`: started; the video’s length is checked, then it waits to be processed - `PROCESSING`: encoding and analysis running - `FINISHED`: results available - `FAILED`: could not start or finish, or the video was too long; see `error` - `CANCELLED`: stopped by you or the processing service Allowed values: `UPLOADING`, `QUEUED`, `PROCESSING`, `FINISHED`, `FAILED`, `CANCELLED` - `fileName` string, required: Name of the uploaded file. - `createdAt` string, format: date-time, required - `title` string: Given at create, else inferred by the analysis. - `description` string: Summary of the whole video, from the analysis. - `sceneCount` integer - `keywords` Array\<string> - `durationSeconds` number, format: double - `updatedAt` string, format: date-time, required - `sizeBytes` integer, format: int64: Size of the uploaded object; known from `start` on. - `startedAt` string, format: date-time: When `start` was accepted. - `finishedAt` string, format: date-time: When the resource reached a terminal state. - `error`: Why the analysis failed. Only set in state `FAILED`. object - `message` string, required: A sentence for people, in Mediaseer’s own words, never the processing platform’s text. It names the cause when Mediaseer knows it, such as a video longer than the length limit or a start that never ran; otherwise it says only that the encoding failed or no longer exists. Don’t branch on its wording. - `clips`: Whether clips can be created from this analysis, and if not, why. Treat an absent `clips` as not available. object - `available` boolean, required: Whether clips can be created from the analysis now. - `reason` string: Why not. Set exactly while `available` is `false`. Allowed values: `UNSUPPORTED_FILE_TYPE`, `NOT_FINISHED`, `TOO_LONG`, `CREATED_BEFORE_CLIPS`, `SOURCE_NOT_KEPT` #### Example ```json { "id": "7f3c2a1e-0b4d-4c7e-9a52-1d2e3f4a5b6c", "state": "UPLOADING", "fileName": "episode-01.mp4", "title": "Los Angeles 1947", "description": "A noir mystery set in Los Angeles in 1947.", "sceneCount": 9, "keywords": [ "Los Angeles", "1947", "mystery" ], "durationSeconds": 719.02, "sizeBytes": 734003200, "error": { "message": "The encoding failed." }, "clips": { "reason": "UNSUPPORTED_FILE_TYPE" } } ``` ### 204 The upload was abandoned and the resource deleted. ### 401 Missing, invalid or expired credentials (`UNAUTHENTICATED`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 404 No such resource for this caller (`NOT_FOUND`). Other users’ resources look the same. Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 409 The resource is in a state that does not allow this operation (`INVALID_STATE`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### default Unexpected error Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` --- operationId: getVodAnalysisResults title: Get the scene analysis results url: "https://mediaseer.ai/docs/api/operations/getvodanalysisresults/" --- # Get the scene analysis results `GET /vod-analysis/{id}/results` URL: `api.mediaseer.ai/api/v1/vod-analysis/{id}/results` Only available once the resource is `FINISHED`. Returns the video-level and scene-level analysis. A field without a value is left out, never null: the value was not available, an optional list was empty, or the value belongs to an enum this API does not know yet. Required lists are empty instead, and an optional text can be an empty string. In a shot’s `shotAdvisories`, an unknown value removes the whole object, because a partial list of advisories would read as “nothing found”. ## Authorizations - **[apiKeyAuth](https://mediaseer.ai/docs/api/#apikeyauth)** ## Parameters ### Path Parameters - `id` string, required: The analysis’s opaque `id`, returned by `createVodAnalysis` or `listVodAnalyses`. ### Query Parameters - `language` string: Not supported today: no translated results exist, and any value is answered with `400` `VALIDATION`. ## Responses ### 200 OK Media type: application/json object - `outputLanguageCodes` Array\<string>, required: Languages of translated results available through Mediaseer. This list is currently always empty. - `analysis` required: The analysis of the video, generated by Bitmovin AI Scene Analysis. object - `scenes` Array\<object>, required: The scenes of the video with available results, each with its start and end time. object - `id` string: Opaque identifier assigned to the scene within this analysis result. It can change across analyses of the same video. - `title` string: Short AI-generated title for the scene. - `startInSeconds` number, format: double: Start of the scene in seconds from the beginning of the video. - `endInSeconds` number, format: double: End of the scene in seconds from the beginning of the video. - `content`: Structured description of the scene’s characters, objects, settings and narrative dynamics. Individual findings can be unavailable. object - `characters` Array\<object>, required: People and characters in the scene. Empty when there are none, or when the analysis did not produce the list. object - `name` string: Name assigned to the character when identified. It can be absent, empty or reported as unknown, even when a summary names the person. - `playedBy` string: Name of the performer credited for the identified character role when the role maps to a single performer. Can be absent or empty when unresolved. - `description` string: What the character does in the scene. Absent when not determined. - `characterAppearance`: Description of the character’s visible appearance. Individual attributes can be empty or unknown. object - `summary` string: Short description of the character’s visible appearance. Can be empty when unavailable. - `gender` string: Apparent gender in free text, such as `male`, `female` or `unknown`. Can be empty when unavailable. - `approximateAge` string: The approximate age range of the character. `UNKNOWN` when an age band could not be estimated or does not apply. Absent if no supported age band was returned. Allowed values: `CHILD`, `TEEN`, `TWENTIES`, `THIRTIES`, `FORTIES`, `FIFTIES`, `SIXTIES_PLUS`, `UNKNOWN` - `hairColor` string: Hair color in free text. The original analysis often uses uppercase labels such as `DARK`, `RED` or `GRAY`. Values can be empty or use unknown wording. - `hairStyle` string: Hairstyle in free text, such as `short` or `curly`. Can be empty or use unknown wording. - `hairFullness` string: Hair fullness in free text, such as `full`, `thinning` or `bald`. Can be empty or use unknown wording. - `facialHair` string: Facial hair in free text, such as `clean-shaven`, `stubble` or `beard`. Can be empty when no description is available. - `physicalBuild` string: Build in free text, such as `average`, `athletic` or `lean`. Can be empty when unavailable. - `distinguishingFeatures` string: Distinctive visible features in free text, such as glasses or a scar. An empty string or wording such as `none` means no feature was described. - `clothing` string: What the character wears, in free text. Can be empty when no description is available. - `objects` Array\<object>, required: Selected notable objects described in the scene. Empty when none were returned or when object findings were unavailable. object - `description` string: Description of the object. Absent when not determined. - `category` string: Kind of object in free text, such as `Furniture`, `Vehicle` or `Weapon`. Not from a fixed list, so spelling and case vary. Absent when not determined. - `settings` Array\<object>, required: Places and conditions described in the scene. A scene can have multiple settings. Empty when none were returned or when settings were unavailable. object - `location`: Place described for the setting. The description need not identify a real geographic location. object - `name` string: Short descriptive name of the place, such as `Basketball Arena`. Can be empty when unavailable. - `description` string: Free-text description of the place. Can be empty when unavailable. - `timeOfDay` string: Time of day in free text, such as `morning` or `night`. Wording and case can vary, including for unknown values. - `atmosphere`: Inferred mood, lighting and weather of the setting. Individual descriptions can be empty or unknown. object - `mood` string: Mood or tone of the setting, in free text. Can be empty when unavailable. - `lighting` string: Lighting of the setting, in free text, such as `dim` or `bright studio lighting`. Can be empty when unavailable. - `weather` string: Weather or indoor conditions, in free text. Can be empty or use unknown wording. - `dynamics`: Assessment of the scene’s narrative tension and pacing. Individual values can be `UNKNOWN` when unavailable. object - `tension` string: The detected tension of the scene based on content analysis. `UNKNOWN` when the analysis could not determine tension. Absent if no supported value was returned. Allowed values: `EXTREME`, `HIGH`, `MODERATE`, `LOW`, `UNKNOWN` - `pacing` string: The detected pacing of the scene based on content analysis. `UNKNOWN` when the analysis could not determine pacing. Absent if no supported value was returned. Allowed values: `SLOW`, `MEASURED`, `BRISK`, `FRANTIC`, `UNKNOWN` - `summary` string: Concise AI-generated summary of the scene. - `verboseSummary` string: Detailed AI-generated description of the scene, with more context than the summary. - `sensitiveTopics` Array\<string>, required: Sensitive topics in the scene, as short phrases such as `violence` or `war`. Empty when none were found, or when the analysis did not produce the list. - `keywords` Array\<string>, required: Free-text keywords for the scene. Empty when no terms were produced. - `iab`: IAB taxonomy classifications of the scene’s subject matter, relevant advertising categories and sensitive topics. Classification lists can be empty when no taxonomy result is available. object - `contentVersion` string: Version of the IAB Content Taxonomy used by `contentTaxonomies` and `sensitiveTopicTaxonomies`, such as `3.1`. - `adProductVersion` string: Version of the IAB Ad Product Taxonomy used by `adOpportunityTaxonomies`, such as `2.0`. - `contentTaxonomies` Array\<string>, required: IAB Content Taxonomy IDs describing the scene’s subject matter. Empty when no IDs were returned, including when the taxonomy result was unavailable. - `adOpportunityTaxonomies` Array\<string>, required: IAB Ad Product Taxonomy IDs for advertising categories relevant to the scene. Empty when no IDs were returned, including when the taxonomy result was unavailable. - `sensitiveTopicTaxonomies` Array\<string>, required: Sensitive topics in the scene, as IAB Content Taxonomy ids (not names). Empty when none were found, or when the analysis did not produce the list. - `type` string: The detected type of scene based on content analysis. `UNKNOWN` when the analysis cannot determine the scene type. Absent if no supported type was returned. Allowed values: `LOGO_IDENT`, `OPENING_CREDITS`, `RECAP`, `PREVIEW_THIS_TITLE`, `PROMOTION_OTHER_TITLE`, `BREAK_BUMPER`, `END_CREDITS`, `ADS`, `MAIN_CONTENT`, `UNKNOWN` - `shots` Array\<object>: A detailed breakdown of individual camera shots within this scene, providing granular analysis of visual content and subjects. Can be empty or absent when no shot results are available. The list can omit shots, and a listed shot can cross a scene boundary or fall outside the associated scene’s interval. object - `startInSeconds` number, format: double, required: The start time of the shot in seconds from the beginning of the video - `endInSeconds` number, format: double, required: The end time of the shot in seconds from the beginning of the video - `detailedDescription` string: A comprehensive textual description of the visual content, action, and context within this shot. Absent when not determined. - `keywords` Array\<string>: A list of relevant keywords and tags that describe the content, themes, or notable elements in this shot. Can be empty or absent when no keywords were returned, including when shot-detail analysis was unavailable. - `mainSubjects` Array\<object>: Selected physical subjects described in the shot. Positions refer to a sampled frame. Can be empty or absent when no subjects were returned, including when shot-detail analysis was unavailable. object - `classification` string, required: Category of the subject, usually an Open Images V7 class name such as `Person` or `Vehicle`. Other text values can occur. - `description` string, required: A detailed textual description of the subject’s appearance and characteristics - `appearanceTimeInSeconds` number, format: double, required: Time in seconds from the start of the shot to the subject’s sampled appearance. - `centerX` number, format: double, required: Horizontal centre as a percentage from the left edge (0–100). - `centerY` number, format: double, required: Vertical centre as a percentage from the top edge (0–100). - `box2d` Array\<integer>: Bounding box at the subject’s sampled appearance, in `[ymin, xmin, ymax, xmax]` order. Integer coordinates use a 0–1000 scale with a top-left origin, normalized independently against the full frame height and width. Empty when no box is available in the source result. Absent when the source omits the field. The centre coordinates remain usable when no box is available. - `shotAdvisories`: Content advisory detection results for this shot, such as tobacco or vaping imagery. Absent when no advisory assessment is available or the result contains an unsupported advisory value. If the model declined assessment and a blocked result was returned, its status is `BLOCKED`. object - `status` string, required: Whether and how the shot was assessed for content advisories Allowed values: `ANALYZED`, `BLOCKED` - `advisories` Array\<object>, required: Advisories reported for this shot. Use the `status` to distinguish assessed shots from blocked shots. object - `category` string, required: Kind of imagery reported or conservatively assumed. Allowed values: `TOBACCO`, `VAPE` - `confidence` string, required: Confidence tier based on the visual evidence for a reported finding, or `UNKNOWN` when blocked. Allowed values: `HIGH`, `MEDIUM`, `LOW`, `UNKNOWN` - `reason` string: A short explanation of what was seen in the shot. Can also explain why a blocked shot was flagged for review. Absent when no reason is available. - `adOpportunityInformation`: Suitability of the end of this scene for an ad break. Default values can be returned when the scene was not assessed. This field does not report a placed ad. object - `reason` string: The reason why the scene was rated with a certain score. Can be empty when no explanation is available. - `score` number, format: double: Score from 0.0 to 1.0 rating the ad placement suitability at the end of a scene based on content analysis. Higher values indicate greater suitability. A score of `0.5` can also be returned when the scene was not assessed. `<= 1` - `duration` number, format: double: Duration of the analyzed video in seconds, based on the detected shot timeline. - `description` string, required: AI-generated summary of the video as a whole. Can be empty when no asset summary is available. - `title` string: Inferred title for the analysed content as a whole. Absent or empty when not available. - `keywords` Array\<string>, required: Free-text keywords for the video as a whole. Empty when no terms were produced, including when the asset summary is unavailable. - `ratings` Array\<object>, required: AI-estimated content ratings for the video, with one entry per supported region and rating system when asset summarization succeeds. Empty when no ratings were produced. object - `region` string: Region label for the estimate, such as `US`, `UK` or `EU`. - `system` string: Name of the movie or TV rating system used for the estimate, such as `MPAA (Motion Picture Association of America) Ratings` or `TV Parental Guidelines`. - `rating` string: AI-estimated classification within the indicated system, such as `PG-13` or `TV-14`. Can be empty when no classification was provided. - `sensitiveTopics` Array\<string>, required: Free-text sensitive topics inferred for the video as a whole. They can differ from the combined scene topics. Empty when no asset-level topics were produced, including when the asset summary is unavailable. - `iabSensitiveTopicTaxonomies` Array\<string>, required: Distinct IAB Content Taxonomy IDs drawn from the scenes’ sensitive-topic annotations. Empty when no IDs were collected or when the aggregate is unavailable. - `inputLanguageCodes` Array\<string>: Language codes identified for spoken dialogue or narration in the source video, such as `en`. Identification excludes theme-song vocals, lyrics, music and written text. Empty or absent when no codes were returned, including for input without audio. - `credits`: Selected cast, crew and song credits and the copyright year, extracted from readable on-screen credit text. Credits can be empty when no readable credits were available or extraction produced no result. object - `persons` Array\<object>: Selected cast and crew extracted from on-screen credits. Credits are deduplicated by name within each department. Empty or absent when no people were returned. object - `name` string: Name extracted for the credited person. Capitalization can be normalized. - `role` string: Credited role. For acting credits, this is the character played when known, or a generic credit such as `Cast`. The value can be empty when unavailable. - `department` string: The detected department of a person. `UNKNOWN` when the department could not be determined. Absent if no supported department was returned. Allowed values: `ACTING`, `ANIMATION`, `CASTING`, `CINEMATOGRAPHY`, `COSTUME_DESIGN`, `DIRECTING`, `FILM_EDITING`, `MAKEUP_AND_HAIRSTYLING`, `MUSIC`, `PRODUCTION`, `PRODUCTION_DESIGN`, `SOUND`, `VISUAL_EFFECTS`, `WRITING`, `UNKNOWN` - `songs` Array\<object>: Songs identified in on-screen credits, such as opening, ending or insert songs. Empty or absent when no songs were returned. object - `name` string: Song title extracted from on-screen credits. Can be empty when unavailable. - `artist` string: Performer identified for the song in the on-screen credits. Can be empty when unavailable. - `copyright` string: Production copyright year extracted from on-screen credits, as text, such as `2016`. Empty when unavailable in the source result. Absent when the source omits the field. This is extracted analysis output and does not establish ownership, licensing or permission to use the video. - `metadata` required: Information about the analysis that produced this result: the software version and a disclaimer. object - `version` string: Version of the analysis software that generated the result. A local build without a recorded version uses `0.0.0`. - `disclaimer` string: Attribution identifying the result as AI-generated, such as `Generated by Bitmovin AI`. #### Example ```json { "outputLanguageCodes": [], "analysis": { "scenes": [ { "content": { "characters": [ { "characterAppearance": { "approximateAge": "CHILD" } } ], "dynamics": { "tension": "EXTREME", "pacing": "SLOW" } }, "type": "LOGO_IDENT", "shots": [ { "shotAdvisories": { "status": "ANALYZED", "advisories": [ { "category": "TOBACCO", "confidence": "HIGH" } ] } } ] } ], "credits": { "persons": [ { "department": "ACTING" } ] } } } ``` ### 401 Missing, invalid or expired credentials (`UNAUTHENTICATED`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 404 No such resource for this caller (`NOT_FOUND`). Other users’ resources look the same. Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 409 The resource is in a state that does not allow this operation (`INVALID_STATE`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### default Unexpected error Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` --- operationId: getVodAnalysisStream title: Get a playable URL for the encoded video url: "https://mediaseer.ai/docs/api/operations/getvodanalysisstream/" --- # Get a playable URL for the encoded video `GET /vod-analysis/{id}/stream` URL: `api.mediaseer.ai/api/v1/vod-analysis/{id}/stream` Only available once the resource is `FINISHED`. Returns the URL of the playlist endpoint with a short-lived, per-resource ticket embedded in it. Hand `playlistUrl` to the player as-is: a media element sends no headers, so the ticket in the URL is the credential. The ticket grants playback of this one resource until `expiresAt`; nothing else. Call again for a fresh one when it expires. ## Authorizations - **[apiKeyAuth](https://mediaseer.ai/docs/api/#apikeyauth)** ## Parameters ### Path Parameters - `id` string, required: The analysis’s opaque `id`, returned by `createVodAnalysis` or `listVodAnalyses`. ## Responses ### 200 OK Media type: application/json object - `playlistUrl` string, format: uri, required: Absolute playback URL. Give it to the player unchanged. - `expiresAt` string, format: date-time, required: When the ticket stops opening the playlists. Segments already listed keep playing. #### Example ```json { "playlistUrl": "https://api.example.com/api/v1/vod-analysis/7f3c2a1e/playlist.m3u8?ticket=eyJhbGciOi" } ``` ### 401 Missing, invalid or expired credentials (`UNAUTHENTICATED`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 404 No such resource for this caller (`NOT_FOUND`). Other users’ resources look the same. Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 409 The resource is in a state that does not allow this operation (`INVALID_STATE`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### default Unexpected error Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` --- title: Clips url: "https://mediaseer.ai/docs/api/operations/tags/clips/" --- # Clips ## clips Cut the video of a finished analysis into vertical (9:16) clips. ## Operations - GET [/vod-analysis/{id}/clip-jobs](https://mediaseer.ai/docs/api/operations/listclipjobs/) - POST [/vod-analysis/{id}/clip-jobs](https://mediaseer.ai/docs/api/operations/createclipjob/) - GET [/clip-jobs/{id}](https://mediaseer.ai/docs/api/operations/getclipjob/) - DELETE [/clip-jobs/{id}](https://mediaseer.ai/docs/api/operations/deleteclipjob/) - GET [/clip-jobs/{id}/episodes/{episode}/media](https://mediaseer.ai/docs/api/operations/getclipepisodemedia/) --- operationId: listClipJobs title: List the clip jobs of an analysis url: "https://mediaseer.ai/docs/api/operations/listclipjobs/" --- # List the clip jobs of an analysis `GET /vod-analysis/{id}/clip-jobs` URL: `api.mediaseer.ai/api/v1/vod-analysis/{id}/clip-jobs` Newest first. Deleted jobs are not listed. Like `getClipJob`, reading brings the jobs’ states up to date. ## Authorizations - **[apiKeyAuth](https://mediaseer.ai/docs/api/#apikeyauth)** ## Parameters ### Path Parameters - `id` string, required: The analysis’s opaque `id`, returned by `createVodAnalysis` or `listVodAnalyses`. ### Query Parameters - `limit` integer: Maximum number of items to return, newest first. The response can contain fewer items. `default: 20`, `>= 1`, `<= 100` - `offset` integer: Number of items to skip, starting from the newest. Use the same limit when fetching later pages. `0` ## Responses ### 200 OK Media type: application/json object - `items` Array\<object>, required: The jobs of this page, newest first. One request to cut an analysis’s video into clips, and its outcome. object - `id` string, required: Identifier of the clip job. - `analysisId` string, required: The `id` of the analysis whose video the clips are cut from. - `state` string, required: Where the job is. Brought up to date when the job is read. Allowed values: `SUBMITTING`, `PROCESSING`, `READY`, `FAILED` - `mode` string, required: What the job makes. Allowed values: `FULL_VERTICAL_CROP`, `PROMPTED_CLIPS`, `MICRODRAMA` - `prompt` string: The prompt given at create. Only set with `PROMPTED_CLIPS`. - `options` required: The options the job uses, defaults included. object - `subtitles` boolean: Burn subtitles of what is said into the clips. `default: true` - `createdAt` string, format: date-time, required: When the job was created. - `updatedAt` string, format: date-time, required: When the job last changed. - `finishedAt` string, format: date-time: When the job became `READY` or `FAILED`. - `error`: Why the job failed. Only set in state `FAILED`. object - `code` string, required: The reason, for clients to branch on. Allowed values: `SOURCE_REJECTED`, `UNAVAILABLE`, `BUSY`, `PIPELINE_FAILED`, `LAUNCH_FAILED`, `OUTCOME_UNKNOWN` - `message` string, required: The reason in words, safe to show to the user. - `episodes` Array\<object>: The clips, in order; their number is the episode count. Only set in state `READY`, and then with at least one clip. One clip of a `READY` job. object - `number` integer, required: Position of the clip in the job, counted from 1 without gaps. The `episode` of `getClipEpisodeMedia`. `>= 1` - `title` string: Title the clip service gave the clip. Absent when it gave none. - `editedAt` string, format: date-time: When the newest edit of the clip finished in the web app’s editor; get it with `getClipEpisodeMedia` and `version=EDITED`. Brought up to date when the job is read. Absent while the clip has no finished edit. - `editable` boolean: Whether the web app can open the job’s clips in its editor now: the job is `READY` and this environment offers the editor. Clips are edited only in the web app. Treat an absent `editable` as `false`. - `total` integer, required: Total number of the analysis’s clip jobs, regardless of paging. - `limit` integer, required: The `limit` this page was read with. - `offset` integer, required: The `offset` this page was read with. #### Example ```json { "items": [ { "id": "0b9e4d2c-5a1f-4e8b-b3c7-2f6a9d1e8c40", "analysisId": "7f3c2a1e-0b4d-4c7e-9a52-1d2e3f4a5b6c", "state": "SUBMITTING", "mode": "FULL_VERTICAL_CROP", "prompt": "The three funniest moments", "options": { "subtitles": true }, "error": { "code": "SOURCE_REJECTED", "message": "This video can't be used for clips." }, "episodes": [ { "number": 1, "title": "The storm hits the harbour" } ] } ] } ``` ### 400 The request is malformed or fails validation (`VALIDATION`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 401 Missing, invalid or expired credentials (`UNAUTHENTICATED`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 404 No such resource for this caller (`NOT_FOUND`). Other users’ resources look the same. Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### default Unexpected error Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` --- operationId: createClipJob title: Create clips from a finished analysis url: "https://mediaseer.ai/docs/api/operations/createclipjob/" --- # Create clips from a finished analysis `POST /vod-analysis/{id}/clip-jobs` URL: `api.mediaseer.ai/api/v1/vod-analysis/{id}/clip-jobs` Starts cutting the analysis’s video into vertical (9:16) clips and returns the new job at once, in state `SUBMITTING`. Handing the video over can take minutes; poll `getClipJob` until the job is `READY` or `FAILED`. Clips can only be created while the analysis’s `clips.available` is `true`; otherwise `409` and nothing is created. While `emailVerificationRequired` is `true`, the caller’s email must be confirmed, as for creating an analysis: otherwise `403` (`EMAIL_NOT_VERIFIED`) and nothing is created. Every job counts towards the caller’s daily clip limits (`429`), also one that fails or is deleted later. The clips a job makes count towards the plan’s clips per period (`clips` in `getUsage`) once it is `READY`. Not idempotent: repeating an accepted request creates another job and consumes quota again. After a timeout or lost response, inspect `listClipJobs` for this analysis before deciding to create another job. There is no idempotency-key header to deduplicate creation requests. An explicit `503` (`CLIPS_UNAVAILABLE`) creates nothing and can be retried later. See <https://mediaseer.ai/docs/guides/retries/> for retry and reconciliation guidance. [Quota recovery policy](https://mediaseer.ai/docs/guides/retries/#quota-refusals) ## Authorizations - **[apiKeyAuth](https://mediaseer.ai/docs/api/#apikeyauth)** ## Parameters ### Path Parameters - `id` string, required: The analysis’s opaque `id`, returned by `createVodAnalysis` or `listVodAnalyses`. ## Request Body required Media type: application/json object - `mode` string, required: What to make. Allowed values: `FULL_VERTICAL_CROP`, `PROMPTED_CLIPS`, `MICRODRAMA` - `prompt` string: What the clips should show, in the user’s words. Required with `PROMPTED_CLIPS`, refused with any other mode, and refused when it is only whitespace (`VALIDATION`). `>= 1 characters`, `<= 1000 characters` ### Example ```plaintext The three funniest moments ``` - `options`: Settings for the clips. Leaving out an option, or `options` as a whole, means its default. object - `subtitles` boolean: Burn subtitles of what is said into the clips. `default: true` ## Responses ### 201 Created. The job is `SUBMITTING`. Media type: application/json One request to cut an analysis’s video into clips, and its outcome. object - `id` string, required: Identifier of the clip job. - `analysisId` string, required: The `id` of the analysis whose video the clips are cut from. - `state` string, required: Where the job is. Brought up to date when the job is read. Allowed values: `SUBMITTING`, `PROCESSING`, `READY`, `FAILED` - `mode` string, required: What the job makes. Allowed values: `FULL_VERTICAL_CROP`, `PROMPTED_CLIPS`, `MICRODRAMA` - `prompt` string: The prompt given at create. Only set with `PROMPTED_CLIPS`. - `options` required: The options the job uses, defaults included. object - `subtitles` boolean: Burn subtitles of what is said into the clips. `default: true` - `createdAt` string, format: date-time, required: When the job was created. - `updatedAt` string, format: date-time, required: When the job last changed. - `finishedAt` string, format: date-time: When the job became `READY` or `FAILED`. - `error`: Why the job failed. Only set in state `FAILED`. object - `code` string, required: The reason, for clients to branch on. Allowed values: `SOURCE_REJECTED`, `UNAVAILABLE`, `BUSY`, `PIPELINE_FAILED`, `LAUNCH_FAILED`, `OUTCOME_UNKNOWN` - `message` string, required: The reason in words, safe to show to the user. - `episodes` Array\<object>: The clips, in order; their number is the episode count. Only set in state `READY`, and then with at least one clip. One clip of a `READY` job. object - `number` integer, required: Position of the clip in the job, counted from 1 without gaps. The `episode` of `getClipEpisodeMedia`. `>= 1` - `title` string: Title the clip service gave the clip. Absent when it gave none. - `editedAt` string, format: date-time: When the newest edit of the clip finished in the web app’s editor; get it with `getClipEpisodeMedia` and `version=EDITED`. Brought up to date when the job is read. Absent while the clip has no finished edit. - `editable` boolean: Whether the web app can open the job’s clips in its editor now: the job is `READY` and this environment offers the editor. Clips are edited only in the web app. Treat an absent `editable` as `false`. #### Example ```json { "id": "0b9e4d2c-5a1f-4e8b-b3c7-2f6a9d1e8c40", "analysisId": "7f3c2a1e-0b4d-4c7e-9a52-1d2e3f4a5b6c", "state": "SUBMITTING", "mode": "FULL_VERTICAL_CROP", "prompt": "The three funniest moments", "options": { "subtitles": true }, "error": { "code": "SOURCE_REJECTED", "message": "This video can't be used for clips." }, "episodes": [ { "number": 1, "title": "The storm hits the harbour" } ] } ``` ### 400 The request is malformed or fails validation (`VALIDATION`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 401 Missing, invalid or expired credentials (`UNAUTHENTICATED`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 403 Confirming the email is required, and the caller’s email is not confirmed yet (`EMAIL_NOT_VERIFIED`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 404 No such resource for this caller (`NOT_FOUND`). Other users’ resources look the same. Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 409 No clips can be created from this analysis (`INVALID_STATE`): its `clips.available` is `false`, and `clips.reason` says why. Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 429 A clip limit was hit (`QUOTA_EXCEEDED`). `details[].field` can name `clips` (the clips your plan includes in this period), `activeClipJobs` (the caller’s jobs `SUBMITTING` or `PROCESSING` at once) or `dailyClipJobs` (the jobs the caller created this UTC day). Every job created counts towards the daily limit, also when it fails or is deleted. Storage never refuses a clip job: clips have no storage limit. - `clips`: the clips of this period are used up (`clips` in `getUsage`). They start again from 0 at `period.end`; deleting clip jobs does not give them back. - `activeClipJobs`: wait for an existing job to finish, reading `getClipJob` to refresh its state, or delete an unwanted job to free its active slot. - `dailyClipJobs`: wait until the next UTC day; deleting or failing a job does not refund it. Follow the response’s guidance for another refusal. These quota refusals do not include a `Retry-After` header; do not repeatedly retry an unchanged request. See <https://mediaseer.ai/docs/guides/retries/#quota-refusals> for recovery guidance. Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 501 This environment offers no clips (`CLIPS_NOT_CONFIGURED`): its backend has no access to the clip service. Trying again does not help. Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 503 Creating clips is temporarily unavailable (`CLIPS_UNAVAILABLE`). Nothing was created; try again later. Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### default Unexpected error Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` --- operationId: getClipJob title: Get a clip job url: "https://mediaseer.ai/docs/api/operations/getclipjob/" --- # Get a clip job `GET /clip-jobs/{id}` URL: `api.mediaseer.ai/api/v1/clip-jobs/{id}` Reading the job brings its state up to date, so poll this while the job is `SUBMITTING` or `PROCESSING`. A deleted job is `404`. ## Authorizations - **[apiKeyAuth](https://mediaseer.ai/docs/api/#apikeyauth)** ## Parameters ### Path Parameters - `id` string, required: The clip job’s `id`. ## Responses ### 200 OK Media type: application/json One request to cut an analysis’s video into clips, and its outcome. object - `id` string, required: Identifier of the clip job. - `analysisId` string, required: The `id` of the analysis whose video the clips are cut from. - `state` string, required: Where the job is. Brought up to date when the job is read. Allowed values: `SUBMITTING`, `PROCESSING`, `READY`, `FAILED` - `mode` string, required: What the job makes. Allowed values: `FULL_VERTICAL_CROP`, `PROMPTED_CLIPS`, `MICRODRAMA` - `prompt` string: The prompt given at create. Only set with `PROMPTED_CLIPS`. - `options` required: The options the job uses, defaults included. object - `subtitles` boolean: Burn subtitles of what is said into the clips. `default: true` - `createdAt` string, format: date-time, required: When the job was created. - `updatedAt` string, format: date-time, required: When the job last changed. - `finishedAt` string, format: date-time: When the job became `READY` or `FAILED`. - `error`: Why the job failed. Only set in state `FAILED`. object - `code` string, required: The reason, for clients to branch on. Allowed values: `SOURCE_REJECTED`, `UNAVAILABLE`, `BUSY`, `PIPELINE_FAILED`, `LAUNCH_FAILED`, `OUTCOME_UNKNOWN` - `message` string, required: The reason in words, safe to show to the user. - `episodes` Array\<object>: The clips, in order; their number is the episode count. Only set in state `READY`, and then with at least one clip. One clip of a `READY` job. object - `number` integer, required: Position of the clip in the job, counted from 1 without gaps. The `episode` of `getClipEpisodeMedia`. `>= 1` - `title` string: Title the clip service gave the clip. Absent when it gave none. - `editedAt` string, format: date-time: When the newest edit of the clip finished in the web app’s editor; get it with `getClipEpisodeMedia` and `version=EDITED`. Brought up to date when the job is read. Absent while the clip has no finished edit. - `editable` boolean: Whether the web app can open the job’s clips in its editor now: the job is `READY` and this environment offers the editor. Clips are edited only in the web app. Treat an absent `editable` as `false`. #### Example ```json { "id": "0b9e4d2c-5a1f-4e8b-b3c7-2f6a9d1e8c40", "analysisId": "7f3c2a1e-0b4d-4c7e-9a52-1d2e3f4a5b6c", "state": "SUBMITTING", "mode": "FULL_VERTICAL_CROP", "prompt": "The three funniest moments", "options": { "subtitles": true }, "error": { "code": "SOURCE_REJECTED", "message": "This video can't be used for clips." }, "episodes": [ { "number": 1, "title": "The storm hits the harbour" } ] } ``` ### 401 Missing, invalid or expired credentials (`UNAUTHENTICATED`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 404 No such resource for this caller (`NOT_FOUND`). Other users’ resources look the same. Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### default Unexpected error Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` --- operationId: deleteClipJob title: Delete a clip job url: "https://mediaseer.ai/docs/api/operations/deleteclipjob/" --- # Delete a clip job `DELETE /clip-jobs/{id}` URL: `api.mediaseer.ai/api/v1/clip-jobs/{id}` Allowed in any state; a job whose clips are still being made is stopped. The job and its clips are gone from this API at once. Their copies at the clip service are removed afterwards, as far as that service allows. Deleting gives nothing back against the clip limits. ## Authorizations - **[apiKeyAuth](https://mediaseer.ai/docs/api/#apikeyauth)** ## Parameters ### Path Parameters - `id` string, required: The clip job’s `id`. ## Responses ### 204 Deleted ### 401 Missing, invalid or expired credentials (`UNAUTHENTICATED`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 404 No such resource for this caller (`NOT_FOUND`). Other users’ resources look the same. Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### default Unexpected error Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` --- operationId: getClipEpisodeMedia title: Get the URLs to watch and download a clip url: "https://mediaseer.ai/docs/api/operations/getclipepisodemedia/" --- # Get the URLs to watch and download a clip `GET /clip-jobs/{id}/episodes/{episode}/media` URL: `api.mediaseer.ai/api/v1/clip-jobs/{id}/episodes/{episode}/media` Only available once the job is `READY`. Returns short-lived signed URLs for the clip, its poster and its download as JSON, not as a redirect: a `<video>` element and a download link send no `Authorization` header, so they use these URLs as they are. Every call returns fresh URLs. Call it before playing, and again once they expire (`expiresAt`), for example when a seek fails. ## Authorizations - **[apiKeyAuth](https://mediaseer.ai/docs/api/#apikeyauth)** ## Parameters ### Path Parameters - `id` string, required: The clip job’s `id`. - `episode` integer, required: The clip’s `number` within the job, from 1. `>= 1` ### Query Parameters - `version` string - `ORIGINAL`: the clip as the clip service made it - `EDITED`: the newest finished edit of the clip Allowed values: `ORIGINAL`, `EDITED` Which version of the clip. Leaving it out means `ORIGINAL`. With `EDITED`, the URLs are those of the newest finished edit of the clip in the web app’s editor, and the clip’s `editedAt` is brought up to date; a clip without a finished edit is a `404` (`NOT_FOUND`). ## Responses ### 200 OK Media type: application/json Signed URLs for one clip. They need no credentials: the URL is the credential, so don’t log or share it. object - `episodeUrl` string, format: uri, required: The clip as MP4, for the `src` of a `<video>` element. It supports range requests, so the video can seek. - `posterUrl` string, format: uri: A still of the clip, for the video’s `poster`. Absent when the clip has none. Posters are made on a best-effort basis, so even a given one can fail to load; show the video without it then. - `downloadUrl` string, format: uri, required: The same clip served as a file download (`Content-Disposition: attachment`), for a download link. - `expiresAt` string, format: date-time, required: When the URLs stop working. Each request is checked, so a playback that started earlier can fail after this, at its next seek: get new URLs and continue from the same position. #### Example ```json { "episodeUrl": "https://storage.googleapis.com/clips/0b9e4d2c/episode_001.mp4?X-Goog-Signature=3f9a", "posterUrl": "https://storage.googleapis.com/clips/0b9e4d2c/episode_001.webp?X-Goog-Signature=7c2e", "downloadUrl": "https://storage.googleapis.com/clips/0b9e4d2c/episode_001.mp4?response-content-disposition=attachment&X-Goog-Signature=9d41" } ``` ### 400 The request is malformed or fails validation (`VALIDATION`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 401 Missing, invalid or expired credentials (`UNAUTHENTICATED`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 404 No such clip job, or the job has no clip with this number (`NOT_FOUND`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 409 The resource is in a state that does not allow this operation (`INVALID_STATE`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### 501 This environment offers no clips (`CLIPS_NOT_CONFIGURED`): its backend has no access to the clip service. Trying again does not help. Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### default Unexpected error Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` --- title: Usage url: "https://mediaseer.ai/docs/api/operations/tags/usage/" --- # Usage ## usage Quota, storage and limits for the caller. ## Operations - GET [/usage](https://mediaseer.ai/docs/api/operations/getusage/) --- operationId: getUsage title: "Quota, storage and limits for the caller" url: "https://mediaseer.ai/docs/api/operations/getusage/" --- # Quota, storage and limits for the caller `GET /usage` URL: `api.mediaseer.ai/api/v1/usage` Your analysis slots, the storage your source videos and clips take, the size and duration limits per video, and the video analysed and the clips made in your current period with your plan’s limits on them. ## Authorizations - **[apiKeyAuth](https://mediaseer.ai/docs/api/#apikeyauth)** ## Responses ### 200 OK Media type: application/json object - `jobs` required: Your analysis slots. Creating an analysis takes a slot; `CANCELLED` and `FAILED` free it. An `UPLOADING` analysis holds its slot for 7 days from creation. object - `used` integer, required - `limit` integer, required - `remaining` integer, required - `limits` required object - `maxFileSizeBytes` integer, format: int64, required - `maxDurationSeconds` integer, required: The longest video an analysis may have, in seconds. After the start, the whole video is read to measure its length. An analysis of a longer video ends `FAILED`, without results, before it is processed, and so does one that can’t be read as a video. Its start doesn’t count. - `storage` required: The storage your source videos and clips take. Your plan limits only the source videos (`sourceBytes`); clips have no limit, and are counted so you can see what they take. A source video counts the size declared for its upload, and once its analysis has finished and been measured, the files it keeps; a failed or cancelled analysis, and an upload whose upload window has passed, count nothing. A clip job counts its clips and posters once they have been measured, which happens when the ready job itself (not the list) is read, or for a job that is only listed, by a background check that runs several times an hour. A successful delete frees the storage of an analysis or clip job at once. object - `usedBytes` integer, format: int64, required: All the storage you use, `sourceBytes` plus `clipBytes`. - `sourceBytes` integer, format: int64, required: The storage your source videos take, what `limitBytes` applies to. - `clipBytes` integer, format: int64, required: The storage your clips take. It has no limit. - `limitBytes` integer, format: int64: The storage your plan includes for source videos, which `sourceBytes` is held to; clips do not count. Absent when there is no limit. Creating an analysis is refused (`QUOTA_EXCEEDED`, field `storage`) when its declared size does not fit into what `sourceBytes` leaves. `sourceBytes` can still end up above the limit: a finished analysis counts the files it keeps, which can be more than its declared size. - `plan` required: The plan your account is on. It sets `storage.limitBytes`, the storage for your source videos, `minutes.limitSeconds` and `clips.limit`, the video you can analyse and the clips you can make per period (none of these for test accounts), and can lower `limits`. object - `id` string, required: The plan’s identifier, a lower-case slug. New plans may be added. - `name` string, required: The plan’s name, for display. - `period` required: The period `minutes` and `clips` are counted in. On a paid plan, the period is your billing period, split into months for a yearly price; otherwise it runs monthly from the day (UTC) you signed up. Signed up on the 29th, 30th or 31st, a month without that day has its period start on its last day. Both ends are midnight UTC; usage resets at `end`, which is the next period’s `start`. object - `start` string, format: date-time, required: When the current period began. - `end` string, format: date-time, required: When the current period ends and `minutes` and `clips` start again from 0. - `minutes` required: The video you analysed in the current period. Each finished analysis counts its video’s length, rounded up to a whole second, on the day (UTC) it finished. A failed or cancelled analysis counts nothing, and deleting an analysis does not give its seconds back. object - `usedSeconds` integer, format: int64, required: The seconds of video analysed in this period. - `limitSeconds` integer, format: int64: The seconds of video your plan includes per period. Absent when there is no limit. Starting an analysis is refused (`QUOTA_EXCEEDED`, field `minutes`) when none are left. An analysis whose video is longer than what is left ends `FAILED` with the message “The video is longer than the minutes left in this period.” as soon as its length is known, and counts nothing, so finished analyses never take `usedSeconds` above the limit; it is above it only when your limit was lowered or newly set during the period. Analyses still `QUEUED` or `PROCESSING` already hold their videos’ lengths of what is left, rounded up to whole seconds, though `usedSeconds` counts them only once they finish. - `clips` required: The clips you made in the current period. A clip job counts its clips once it is `READY`, on the day (UTC) it got there. A failed job counts nothing, and deleting a clip job does not give its clips back. object - `used` integer, required: The clips made in this period. - `limit` integer: The clips your plan includes per period. Absent when there is no limit. Creating a clip job is refused (`QUOTA_EXCEEDED`, field `clips`) once `used` has reached it. A job’s clips count only once it is `READY`, and one job can make several, so jobs created before the limit was reached can take `used` above it. - `subscription` object - `status` string, required - `ACTIVE`: paid, the plan applies - `TRIALING`: in a free trial, the plan applies - `PAST_DUE`: the last payment failed and is being retried; the plan still applies - `UNPAID`: the payment retries ran out; you are on the free plan until it is paid - `INCOMPLETE`: the first payment has not gone through yet; the plan applies once it has - `PAUSED`: paused; you are on the free plan while it is New values may be added. Allowed values: `ACTIVE`, `TRIALING`, `PAST_DUE`, `UNPAID`, `INCOMPLETE`, `PAUSED` - `renewsAt` string, format: date-time: When the current billing period ends and the plan is renewed and charged again. Absent when the subscription is set to end (`cancelAt`), and while it doesn’t pay for the plan (`UNPAID`, `INCOMPLETE`, `PAUSED`). - `cancelAt` string, format: date-time: When the subscription ends, as it is set to. While it pays, you keep your plan until then; you are on the free plan after it. Absent when it renews. - `change`: A move to another plan at `at`, set from the web app. In `getUsage`, a change set for later (a smaller plan, or the end of a cancelled subscription), absent when none is set. object - `plan` required: The plan your account is on. It sets `storage.limitBytes`, the storage for your source videos, `minutes.limitSeconds` and `clips.limit`, the video you can analyse and the clips you can make per period (none of these for test accounts), and can lower `limits`. object - `id` string, required: The plan’s identifier, a lower-case slug. New plans may be added. - `name` string, required: The plan’s name, for display. - `at` string, format: date-time, required: When you move to `plan`: the end of the current billing period (for a cancellation, an earlier end set already). A larger plan applies right away, when it is chosen. #### Example ```json { "jobs": { "used": 3, "limit": 10, "remaining": 7 }, "limits": { "maxFileSizeBytes": 2147483648, "maxDurationSeconds": 1800 }, "storage": { "usedBytes": 3600000000, "sourceBytes": 3200000000, "clipBytes": 400000000, "limitBytes": 5000000000 }, "plan": { "id": "free", "name": "Free" }, "period": { "start": "2026-11-03T00:00:00Z", "end": "2026-12-03T00:00:00Z" }, "minutes": { "usedSeconds": 1260, "limitSeconds": 3600 }, "clips": { "used": 4, "limit": 20 }, "subscription": { "status": "ACTIVE", "renewsAt": "2026-12-03T10:15:00Z", "cancelAt": "2026-12-03T10:15:00Z", "change": { "plan": { "id": "free", "name": "Free" }, "at": "2026-12-03T10:15:00Z" } } } ``` ### 401 Missing, invalid or expired credentials (`UNAUTHENTICATED`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### default Unexpected error Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` --- title: Billing url: "https://mediaseer.ai/docs/api/operations/tags/billing/" --- # Billing ## billing Plan limits and available prices. ## Operations - GET [/plans](https://mediaseer.ai/docs/api/operations/listplans/) --- operationId: listPlans title: The plans and their limits url: "https://mediaseer.ai/docs/api/operations/listplans/" --- # The plans and their limits `GET /plans` URL: `api.mediaseer.ai/api/v1/plans` Every plan with the limits it sets, as `getUsage` reports them for the plan you are on, and for a plan you can buy, its price. Your current plan is `plan.id` in `getUsage`. ## Authorizations - **[apiKeyAuth](https://mediaseer.ai/docs/api/#apikeyauth)** ## Responses ### 200 OK Media type: application/json object - `items` Array\<object>, required: Every plan, by `id`. A plan and the limits it sets. A limit that is absent is not set by the plan. Test accounts have none of the plan’s limits on storage, minutes and clips. object - `id` string, required: The plan’s identifier, as `plan.id` in `getUsage`. New plans may be added. - `name` string, required: The plan’s name, for display. - `limits` required object - `maxFileSizeBytes` integer, format: int64, required - `maxDurationSeconds` integer, required: The longest video an analysis may have, in seconds. After the start, the whole video is read to measure its length. An analysis of a longer video ends `FAILED`, without results, before it is processed, and so does one that can’t be read as a video. Its start doesn’t count. - `storageLimitBytes` integer, format: int64: The storage for source videos, as `storage.limitBytes` in `getUsage`. - `minutesLimitSeconds` integer, format: int64: The seconds of video you can analyse per period, as `minutes.limitSeconds` in `getUsage`. - `clipsLimit` integer: The clips you can make per period, as `clips.limit` in `getUsage`. - `price`: What the plan costs. Present only for a plan you can buy now, in the web app; absent for a free plan, and for any plan while buying is not available. object - `amount` integer, format: int64, required: The price per interval in the currency’s smallest unit (cents for EUR). - `currency` string, required: ISO 4217 currency code. `/^[A-Z]{3}$/` - `interval` string, required: How often the price is charged. New values may be added. Allowed values: `MONTH`, `YEAR` #### Example ```json { "items": [ { "id": "creator", "name": "Creator", "limits": { "maxFileSizeBytes": 2147483648, "maxDurationSeconds": 1800 }, "storageLimitBytes": 50000000000, "minutesLimitSeconds": 36000, "clipsLimit": 100, "price": { "amount": 1900, "currency": "EUR", "interval": "MONTH" } } ] } ``` ### 401 Missing, invalid or expired credentials (`UNAUTHENTICATED`). Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` ### default Unexpected error Media type: application/json object - `code` string, required: Stable machine-readable code. Clients branch on this, never on `message`. Allowed values: `VALIDATION`, `UNAUTHENTICATED`, `INVALID_TOKEN`, `FORBIDDEN`, `EMAIL_NOT_VERIFIED`, `NOT_FOUND`, `INVALID_STATE`, `UPLOAD_INCOMPLETE`, `QUOTA_EXCEEDED`, `RATE_LIMITED`, `UPSTREAM_ERROR`, `CLIPS_NOT_CONFIGURED`, `CLIPS_UNAVAILABLE`, `INTERNAL` - `message` string, required: Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail’s reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. - `details` Array\<object>: Optional field-level or limit-level detail. object - `field` string: The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. - `message` string, required #### Example ```json { "code": "VALIDATION", "message": "The file is larger than the limit of 2147483648 bytes.", "details": [ { "field": "sizeBytes", "message": "must be at most 2147483648" } ] } ``` --- schema: AdOpportunity title: AdOpportunity url: "https://mediaseer.ai/docs/api/schemas/adopportunity/" --- # AdOpportunity | Field | Description | | - | - | | `reason` string, optional | The reason why the scene was rated with a certain score. Can be empty when no explanation is available. | | `score` number (double), optional | Score from 0.0 to 1.0 rating the ad placement suitability at the end of a scene based on content analysis. Higher values indicate greater suitability. A score of `0.5` can also be returned when the scene was not assessed. | --- schema: AdvisoryAnalysisStatus title: AdvisoryAnalysisStatus url: "https://mediaseer.ai/docs/api/schemas/advisoryanalysisstatus/" --- # AdvisoryAnalysisStatus | Value | Description | | - | - | | `ANALYZED` | Advisory assessment completed, including shots cleared by the scene pre-filter | | `BLOCKED` | The model declined to assess the shot. A conservative `TOBACCO` advisory with `UNKNOWN` confidence marks it for manual review | --- schema: AdvisoryCategory title: AdvisoryCategory url: "https://mediaseer.ai/docs/api/schemas/advisorycategory/" --- # AdvisoryCategory | Value | Description | | - | - | | `TOBACCO` | Tobacco imagery such as smoking, cigarettes, cigars, pipes, or tobacco products | | `VAPE` | Vaping imagery such as e-cigarettes, vape pens, or their use | --- schema: AdvisoryConfidence title: AdvisoryConfidence url: "https://mediaseer.ai/docs/api/schemas/advisoryconfidence/" --- # AdvisoryConfidence | Value | Description | | - | - | | `HIGH` | The finding rests on the product itself, or on tobacco packaging, an ashtray or legible tobacco branding or signage, visible in the shot | | `MEDIUM` | The finding rests on a plume or trail of smoke or vapor rising from a person, not on the product itself | | `LOW` | The model flagged the shot on a cue it could not resolve, for example a small, dark or fleeting object, and another reading of it is possible. Detection is tuned to flag uncertain cases rather than miss them, so advisories below HIGH confidence are expected | | `UNKNOWN` | No verdict was available because the model declined to assess the shot. For a `BLOCKED` shot, the advisory flags the shot for manual review | --- schema: AgeRange title: AgeRange url: "https://mediaseer.ai/docs/api/schemas/agerange/" --- # AgeRange | Value | Description | | - | - | | `CHILD` | Character appears to be a child | | `TEEN` | Character appears to be a teen | | `TWENTIES` | Character appears to be in their 20s | | `THIRTIES` | Character appears to be in their 30s | | `FORTIES` | Character appears to be in their 40s | | `FIFTIES` | Character appears to be in their 50s | | `SIXTIES_PLUS` | Character appears to be 60 or older | | `UNKNOWN` | Fallback when age range cannot be determined | --- schema: BillingInterval title: BillingInterval description: How often the price is charged. New values may be added. url: "https://mediaseer.ai/docs/api/schemas/billinginterval/" --- # BillingInterval How often the price is charged. New values may be added. | Value | Description | | - | - | | `MONTH` | | | `YEAR` | | --- schema: CharacterAppearance title: CharacterAppearance url: "https://mediaseer.ai/docs/api/schemas/characterappearance/" --- # CharacterAppearance | Field | Description | | - | - | | `summary` string, optional | Short description of the character's visible appearance. Can be empty when unavailable. | | `gender` string, optional | Apparent gender in free text, such as `male`, `female` or `unknown`. Can be empty when unavailable. | | `approximateAge` [AgeRange](https://mediaseer.ai/docs/api/schemas/agerange/), optional | The approximate age range of the character. `UNKNOWN` when an age band could not be estimated or does not apply. Absent if no supported age band was returned. | | `hairColor` string, optional | Hair color in free text. The original analysis often uses uppercase labels such as `DARK`, `RED` or `GRAY`. Values can be empty or use unknown wording. | | `hairStyle` string, optional | Hairstyle in free text, such as `short` or `curly`. Can be empty or use unknown wording. | | `hairFullness` string, optional | Hair fullness in free text, such as `full`, `thinning` or `bald`. Can be empty or use unknown wording. | | `facialHair` string, optional | Facial hair in free text, such as `clean-shaven`, `stubble` or `beard`. Can be empty when no description is available. | | `physicalBuild` string, optional | Build in free text, such as `average`, `athletic` or `lean`. Can be empty when unavailable. | | `distinguishingFeatures` string, optional | Distinctive visible features in free text, such as glasses or a scar. An empty string or wording such as `none` means no feature was described. | | `clothing` string, optional | What the character wears, in free text. Can be empty when no description is available. | Uses [`AgeRange`](https://mediaseer.ai/docs/api/schemas/agerange/). --- schema: ClipAvailability title: ClipAvailability description: Whether clips can be created from an analysis. url: "https://mediaseer.ai/docs/api/schemas/clipavailability/" --- # ClipAvailability Whether clips can be created from an analysis. | Field | Description | | - | - | | `available` boolean, required | Whether clips can be created from the analysis now. | | `reason` [ClipUnavailableReason](https://mediaseer.ai/docs/api/schemas/clipunavailablereason/), optional | Why not. Set exactly while `available` is `false`. | Uses [`ClipUnavailableReason`](https://mediaseer.ai/docs/api/schemas/clipunavailablereason/). --- schema: ClipEpisode title: ClipEpisode description: One clip of a READY job. url: "https://mediaseer.ai/docs/api/schemas/clipepisode/" --- # ClipEpisode One clip of a `READY` job. | Field | Description | | - | - | | `number` integer, required | Position of the clip in the job, counted from 1 without gaps. The `episode` of `getClipEpisodeMedia`. | | `title` string, optional | Title the clip service gave the clip. Absent when it gave none. | | `editedAt` string (date-time), optional | When the newest edit of the clip finished in the web app's editor; get it with `getClipEpisodeMedia` and `version=EDITED`. Brought up to date when the job is read. Absent while the clip has no finished edit. | --- schema: ClipEpisodeMedia title: ClipEpisodeMedia description: "Signed URLs for one clip. They need no credentials: the URL is the credential, so don't log or share it." url: "https://mediaseer.ai/docs/api/schemas/clipepisodemedia/" --- # ClipEpisodeMedia Signed URLs for one clip. They need no credentials: the URL is the credential, so don't log or share it. | Field | Description | | - | - | | `episodeUrl` string (uri), required | The clip as MP4, for the `src` of a `<video>` element. It supports range requests, so the video can seek. | | `posterUrl` string (uri), optional | A still of the clip, for the video's `poster`. Absent when the clip has none. Posters are made on a best-effort basis, so even a given one can fail to load; show the video without it then. | | `downloadUrl` string (uri), required | The same clip served as a file download (`Content-Disposition: attachment`), for a download link. | | `expiresAt` string (date-time), required | When the URLs stop working. Each request is checked, so a playback that started earlier can fail after this, at its next seek: get new URLs and continue from the same position. | --- schema: ClipJob title: ClipJob description: "One request to cut an analysis's video into clips, and its outcome." url: "https://mediaseer.ai/docs/api/schemas/clipjob/" --- # ClipJob One request to cut an analysis's video into clips, and its outcome. | Field | Description | | - | - | | `id` string, required | Identifier of the clip job. | | `analysisId` string, required | The `id` of the analysis whose video the clips are cut from. | | `state` [ClipJobState](https://mediaseer.ai/docs/api/schemas/clipjobstate/), required | Where the job is. Brought up to date when the job is read. | | `mode` [ClipMode](https://mediaseer.ai/docs/api/schemas/clipmode/), required | What the job makes. | | `prompt` string, optional | The prompt given at create. Only set with `PROMPTED_CLIPS`. | | `options` [ClipOptions](https://mediaseer.ai/docs/api/schemas/clipoptions/), required | The options the job uses, defaults included. | | `createdAt` string (date-time), required | When the job was created. | | `updatedAt` string (date-time), required | When the job last changed. | | `finishedAt` string (date-time), optional | When the job became `READY` or `FAILED`. | | `error` [ClipJobError](https://mediaseer.ai/docs/api/schemas/clipjoberror/), optional | Why the job failed. Only set in state `FAILED`. | | `episodes` array of [ClipEpisode](https://mediaseer.ai/docs/api/schemas/clipepisode/), optional | The clips, in order; their number is the episode count. Only set in state `READY`, and then with at least one clip. | | `editable` boolean, optional | Whether the web app can open the job's clips in its editor now: the job is `READY` and this environment offers the editor. Clips are edited only in the web app. Treat an absent `editable` as `false`. | Uses [`ClipJobState`](https://mediaseer.ai/docs/api/schemas/clipjobstate/), [`ClipMode`](https://mediaseer.ai/docs/api/schemas/clipmode/), [`ClipOptions`](https://mediaseer.ai/docs/api/schemas/clipoptions/), [`ClipJobError`](https://mediaseer.ai/docs/api/schemas/clipjoberror/), [`ClipEpisode`](https://mediaseer.ai/docs/api/schemas/clipepisode/). --- schema: ClipJobError title: ClipJobError description: Why the job failed. Only set in state FAILED. url: "https://mediaseer.ai/docs/api/schemas/clipjoberror/" --- # ClipJobError Why the job failed. Only set in state `FAILED`. | Field | Description | | - | - | | `code` [ClipJobErrorCode](https://mediaseer.ai/docs/api/schemas/clipjoberrorcode/), required | The reason, for clients to branch on. | | `message` string, required | The reason in words, safe to show to the user. | Uses [`ClipJobErrorCode`](https://mediaseer.ai/docs/api/schemas/clipjoberrorcode/). --- schema: ClipJobErrorCode title: ClipJobErrorCode description: "Why a clip job failed. Clients branch on this, never on message. - SOURCE_REJECTED: the clip service can't use this video. Another job for it fails the same way. - UNAVAILABLE: creating clips was temporarily unavailable. Try again later. - BUSY: the clip service was busy. Try again in a few minutes. - PIPELINE_FAILED: making the clips failed; message is the clip service's reason. - LAUNCH_FAILED: the job could not be started. Try again. - OUTCOME_UNKNOWN: the job got no clear answer from the clip service and was given up. Try again. More codes can be added. A client shows message for a code it does not know." url: "https://mediaseer.ai/docs/api/schemas/clipjoberrorcode/" --- # ClipJobErrorCode Why a clip job failed. Clients branch on this, never on `message`. - `SOURCE_REJECTED`: the clip service can't use this video. Another job for it fails the same way. - `UNAVAILABLE`: creating clips was temporarily unavailable. Try again later. - `BUSY`: the clip service was busy. Try again in a few minutes. - `PIPELINE_FAILED`: making the clips failed; `message` is the clip service's reason. - `LAUNCH_FAILED`: the job could not be started. Try again. - `OUTCOME_UNKNOWN`: the job got no clear answer from the clip service and was given up. Try again. More codes can be added. A client shows `message` for a code it does not know. | Value | Description | | - | - | | `SOURCE_REJECTED` | | | `UNAVAILABLE` | | | `BUSY` | | | `PIPELINE_FAILED` | | | `LAUNCH_FAILED` | | | `OUTCOME_UNKNOWN` | | --- schema: ClipJobPage title: ClipJobPage url: "https://mediaseer.ai/docs/api/schemas/clipjobpage/" --- # ClipJobPage | Field | Description | | - | - | | `items` array of [ClipJob](https://mediaseer.ai/docs/api/schemas/clipjob/), required | The jobs of this page, newest first. | | `total` integer, required | Total number of the analysis's clip jobs, regardless of paging. | | `limit` integer, required | The `limit` this page was read with. | | `offset` integer, required | The `offset` this page was read with. | Uses [`ClipJob`](https://mediaseer.ai/docs/api/schemas/clipjob/). --- schema: ClipJobState title: ClipJobState description: "- SUBMITTING: created; the video is being handed over to the clip service, which can take minutes for a long video - PROCESSING: the clips are being made - READY: the clips are done; see episodes - FAILED: no clips were made; see error" url: "https://mediaseer.ai/docs/api/schemas/clipjobstate/" --- # ClipJobState - `SUBMITTING`: created; the video is being handed over to the clip service, which can take minutes for a long video - `PROCESSING`: the clips are being made - `READY`: the clips are done; see `episodes` - `FAILED`: no clips were made; see `error` | Value | Description | | - | - | | `SUBMITTING` | | | `PROCESSING` | | | `READY` | | | `FAILED` | | --- schema: ClipMode title: ClipMode description: "What the clip service makes of the video. Every mode makes vertical (9:16) clips. - FULL_VERTICAL_CROP: the whole video, cropped to vertical - PROMPTED_CLIPS: clips of the moments the prompt asks for - MICRODRAMA: short episodes that tell the video's story" url: "https://mediaseer.ai/docs/api/schemas/clipmode/" --- # ClipMode What the clip service makes of the video. Every mode makes vertical (9:16) clips. - `FULL_VERTICAL_CROP`: the whole video, cropped to vertical - `PROMPTED_CLIPS`: clips of the moments the `prompt` asks for - `MICRODRAMA`: short episodes that tell the video's story | Value | Description | | - | - | | `FULL_VERTICAL_CROP` | | | `PROMPTED_CLIPS` | | | `MICRODRAMA` | | --- schema: ClipOptions title: ClipOptions description: "How the clips are made. More options can be added; each comes with a default, so a request without it keeps working as before. This API ignores an option it does not know. In a response, every option shows the value the job uses." url: "https://mediaseer.ai/docs/api/schemas/clipoptions/" --- # ClipOptions How the clips are made. More options can be added; each comes with a default, so a request without it keeps working as before. This API ignores an option it does not know. In a response, every option shows the value the job uses. | Field | Description | | - | - | | `subtitles` boolean, optional | Burn subtitles of what is said into the clips. | --- schema: ClipsQuota title: ClipsQuota description: "The clips you made in the current period. A clip job counts its clips once it is READY, on the day (UTC) it got there. A failed job counts nothing, and deleting a clip job does not give its clips back." url: "https://mediaseer.ai/docs/api/schemas/clipsquota/" --- # ClipsQuota The clips you made in the current period. A clip job counts its clips once it is `READY`, on the day (UTC) it got there. A failed job counts nothing, and deleting a clip job does not give its clips back. | Field | Description | | - | - | | `used` integer, required | The clips made in this period. | | `limit` integer, optional | The clips your plan includes per period. Absent when there is no limit. Creating a clip job is refused (`QUOTA_EXCEEDED`, field `clips`) once `used` has reached it. A job's clips count only once it is `READY`, and one job can make several, so jobs created before the limit was reached can take `used` above it. | --- schema: ClipUnavailableReason title: ClipUnavailableReason description: "Why no clips can be created from an analysis. When several apply, the first in this list: - UNSUPPORTED_FILE_TYPE: clips can't be made from the uploaded file's type. Judged by the extension of fileName; supported are mp4, mov, mkv, m4v, avi and webm. - NOT_FINISHED: the analysis is not FINISHED. - TOO_LONG: the video is longer than the longest video an analysis may have (limits.maxDurationSeconds in getUsage). - CREATED_BEFORE_CLIPS: the analysis is older than clips, and its original upload is gone. Upload the video again to create clips. - SOURCE_NOT_KEPT: the original upload is not kept with the analysis yet. Reading the analysis again retries. More reasons can be added. A client treats a reason it does not know like any other: clips are not available." url: "https://mediaseer.ai/docs/api/schemas/clipunavailablereason/" --- # ClipUnavailableReason Why no clips can be created from an analysis. When several apply, the first in this list: - `UNSUPPORTED_FILE_TYPE`: clips can't be made from the uploaded file's type. Judged by the extension of `fileName`; supported are `mp4`, `mov`, `mkv`, `m4v`, `avi` and `webm`. - `NOT_FINISHED`: the analysis is not `FINISHED`. - `TOO_LONG`: the video is longer than the longest video an analysis may have (`limits.maxDurationSeconds` in `getUsage`). - `CREATED_BEFORE_CLIPS`: the analysis is older than clips, and its original upload is gone. Upload the video again to create clips. - `SOURCE_NOT_KEPT`: the original upload is not kept with the analysis yet. Reading the analysis again retries. More reasons can be added. A client treats a reason it does not know like any other: clips are not available. | Value | Description | | - | - | | `UNSUPPORTED_FILE_TYPE` | | | `NOT_FINISHED` | | | `TOO_LONG` | | | `CREATED_BEFORE_CLIPS` | | | `SOURCE_NOT_KEPT` | | --- schema: ClipVersion title: ClipVersion description: "- ORIGINAL: the clip as the clip service made it - EDITED: the newest finished edit of the clip" url: "https://mediaseer.ai/docs/api/schemas/clipversion/" --- # ClipVersion - `ORIGINAL`: the clip as the clip service made it - `EDITED`: the newest finished edit of the clip | Value | Description | | - | - | | `ORIGINAL` | | | `EDITED` | | --- schema: ContentAdvisory title: ContentAdvisory url: "https://mediaseer.ai/docs/api/schemas/contentadvisory/" --- # ContentAdvisory | Field | Description | | - | - | | `category` [AdvisoryCategory](https://mediaseer.ai/docs/api/schemas/advisorycategory/), required | Kind of imagery reported or conservatively assumed. | | `confidence` [AdvisoryConfidence](https://mediaseer.ai/docs/api/schemas/advisoryconfidence/), required | Confidence tier based on the visual evidence for a reported finding, or `UNKNOWN` when blocked. | | `reason` string, optional | A short explanation of what was seen in the shot. Can also explain why a blocked shot was flagged for review. Absent when no reason is available. | Uses [`AdvisoryCategory`](https://mediaseer.ai/docs/api/schemas/advisorycategory/), [`AdvisoryConfidence`](https://mediaseer.ai/docs/api/schemas/advisoryconfidence/). --- schema: CreateClipJobRequest title: CreateClipJobRequest url: "https://mediaseer.ai/docs/api/schemas/createclipjobrequest/" --- # CreateClipJobRequest | Field | Description | | - | - | | `mode` [ClipMode](https://mediaseer.ai/docs/api/schemas/clipmode/), required | What to make. | | `prompt` string, optional | What the clips should show, in the user's words. Required with `PROMPTED_CLIPS`, refused with any other mode, and refused when it is only whitespace (`VALIDATION`). | | `options` [ClipOptions](https://mediaseer.ai/docs/api/schemas/clipoptions/), optional | Settings for the clips. Leaving out an option, or `options` as a whole, means its default. | Uses [`ClipMode`](https://mediaseer.ai/docs/api/schemas/clipmode/), [`ClipOptions`](https://mediaseer.ai/docs/api/schemas/clipoptions/). --- schema: CreateVodAnalysisRequest title: CreateVodAnalysisRequest url: "https://mediaseer.ai/docs/api/schemas/createvodanalysisrequest/" --- # CreateVodAnalysisRequest | Field | Description | | - | - | | `fileName` string, required | Name of the file the client is about to upload. Shown until a title exists. | | `sizeBytes` integer (int64), required | Declared file size, checked against the size limit before an upload session is issued. | | `contentType` string, optional | MIME type the client will send: a `video/*` type. Omit it when the type is unknown. | | `title` string, optional | Optional title. Without it, the analysis's inferred title is used once known, and `fileName` until then. | --- schema: CreateVodAnalysisResponse title: CreateVodAnalysisResponse url: "https://mediaseer.ai/docs/api/schemas/createvodanalysisresponse/" --- # CreateVodAnalysisResponse | Field | Description | | - | - | | `analysis` [VodAnalysis](https://mediaseer.ai/docs/api/schemas/vodanalysis/), required | | | `upload` [UploadSession](https://mediaseer.ai/docs/api/schemas/uploadsession/), required | | Uses [`VodAnalysis`](https://mediaseer.ai/docs/api/schemas/vodanalysis/), [`UploadSession`](https://mediaseer.ai/docs/api/schemas/uploadsession/). --- schema: Credits title: Credits url: "https://mediaseer.ai/docs/api/schemas/credits/" --- # Credits | Field | Description | | - | - | | `persons` array of [Person](https://mediaseer.ai/docs/api/schemas/person/), optional | Selected cast and crew extracted from on-screen credits. Credits are deduplicated by name within each department. Empty or absent when no people were returned. | | `songs` array of [Song](https://mediaseer.ai/docs/api/schemas/song/), optional | Songs identified in on-screen credits, such as opening, ending or insert songs. Empty or absent when no songs were returned. | | `copyright` string, optional | Production copyright year extracted from on-screen credits, as text, such as `2016`. Empty when unavailable in the source result. Absent when the source omits the field. This is extracted analysis output and does not establish ownership, licensing or permission to use the video. | Uses [`Person`](https://mediaseer.ai/docs/api/schemas/person/), [`Song`](https://mediaseer.ai/docs/api/schemas/song/). --- schema: Department title: Department url: "https://mediaseer.ai/docs/api/schemas/department/" --- # Department | Value | Description | | - | - | | `ACTING` | Cast members and their portrayed characters | | `ANIMATION` | Chief Animation Director, Animation Director, Character Designer, Color Design | | `CASTING` | Casting Director | | `CINEMATOGRAPHY` | Director of Photography | | `COSTUME_DESIGN` | Costume Designer | | `DIRECTING` | Director | | `FILM_EDITING` | Film Editor | | `MAKEUP_AND_HAIRSTYLING` | Department head Makeup Artist and Hair Stylist | | `MUSIC` | Film score Composer | | `PRODUCTION` | Producers and Executive Producers | | `PRODUCTION_DESIGN` | Production Designer | | `SOUND` | Primary Sound Designer or Sound Mixer | | `VISUAL_EFFECTS` | Visual Effects Supervisor | | `WRITING` | Screenplay, Created By, or Story By credits | | `UNKNOWN` | Fallback when department cannot be determined | --- schema: Error title: Error url: "https://mediaseer.ai/docs/api/schemas/error/" --- # Error | Field | Description | | - | - | | `code` [ErrorCode](https://mediaseer.ai/docs/api/schemas/errorcode/), required | | | `message` string, required | Human-readable, safe to show to the user. For `VALIDATION` with a single detail, it states that detail's reason, naming the field where the reason needs it; with several, it is generic and `details` lists them. | | `details` array of [ErrorDetail](https://mediaseer.ai/docs/api/schemas/errordetail/), optional | Optional field-level or limit-level detail. | Uses [`ErrorCode`](https://mediaseer.ai/docs/api/schemas/errorcode/), [`ErrorDetail`](https://mediaseer.ai/docs/api/schemas/errordetail/). --- schema: ErrorCode title: ErrorCode description: "Stable machine-readable code. Clients branch on this, never on message." url: "https://mediaseer.ai/docs/api/schemas/errorcode/" --- # ErrorCode Stable machine-readable code. Clients branch on this, never on `message`. | Value | Description | | - | - | | `VALIDATION` | | | `UNAUTHENTICATED` | | | `INVALID_TOKEN` | | | `FORBIDDEN` | | | `EMAIL_NOT_VERIFIED` | | | `NOT_FOUND` | | | `INVALID_STATE` | | | `UPLOAD_INCOMPLETE` | | | `QUOTA_EXCEEDED` | | | `RATE_LIMITED` | | | `UPSTREAM_ERROR` | | | `CLIPS_NOT_CONFIGURED` | | | `CLIPS_UNAVAILABLE` | | | `INTERNAL` | | --- schema: ErrorDetail title: ErrorDetail url: "https://mediaseer.ai/docs/api/schemas/errordetail/" --- # ErrorDetail | Field | Description | | - | - | | `field` string, optional | The request field the detail refers to, if any; for `QUOTA_EXCEEDED`, the limit that was hit. | | `message` string, required | | --- schema: IabTaxonomy title: IabTaxonomy url: "https://mediaseer.ai/docs/api/schemas/iabtaxonomy/" --- # IabTaxonomy | Field | Description | | - | - | | `contentVersion` string, optional | Version of the IAB Content Taxonomy used by `contentTaxonomies` and `sensitiveTopicTaxonomies`, such as `3.1`. | | `adProductVersion` string, optional | Version of the IAB Ad Product Taxonomy used by `adOpportunityTaxonomies`, such as `2.0`. | | `contentTaxonomies` array of string, required | IAB Content Taxonomy IDs describing the scene's subject matter. Empty when no IDs were returned, including when the taxonomy result was unavailable. | | `adOpportunityTaxonomies` array of string, required | IAB Ad Product Taxonomy IDs for advertising categories relevant to the scene. Empty when no IDs were returned, including when the taxonomy result was unavailable. | | `sensitiveTopicTaxonomies` array of string, required | Sensitive topics in the scene, as IAB Content Taxonomy ids (not names). Empty when none were found, or when the analysis did not produce the list. | --- schema: JobQuota title: JobQuota description: "Your analysis slots. Creating an analysis takes a slot; CANCELLED and FAILED free it. An UPLOADING analysis holds its slot for 7 days from creation." url: "https://mediaseer.ai/docs/api/schemas/jobquota/" --- # JobQuota Your analysis slots. Creating an analysis takes a slot; `CANCELLED` and `FAILED` free it. An `UPLOADING` analysis holds its slot for 7 days from creation. | Field | Description | | - | - | | `used` integer, required | | | `limit` integer, required | | | `remaining` integer, required | | --- schema: Limits title: Limits url: "https://mediaseer.ai/docs/api/schemas/limits/" --- # Limits | Field | Description | | - | - | | `maxFileSizeBytes` integer (int64), required | | | `maxDurationSeconds` integer, required | The longest video an analysis may have, in seconds. After the start, the whole video is read to measure its length. An analysis of a longer video ends `FAILED`, without results, before it is processed, and so does one that can't be read as a video. Its start doesn't count. | --- schema: MainSubject title: MainSubject url: "https://mediaseer.ai/docs/api/schemas/mainsubject/" --- # MainSubject | Field | Description | | - | - | | `classification` string, required | Category of the subject, usually an Open Images V7 class name such as `Person` or `Vehicle`. Other text values can occur. | | `description` string, required | A detailed textual description of the subject's appearance and characteristics | | `appearanceTimeInSeconds` number (double), required | Time in seconds from the start of the shot to the subject's sampled appearance. | | `centerX` number (double), required | Horizontal centre as a percentage from the left edge (0–100). | | `centerY` number (double), required | Vertical centre as a percentage from the top edge (0–100). | | `box2d` array of integer, optional | Bounding box at the subject's sampled appearance, in `[ymin, xmin, ymax, xmax]` order. Integer coordinates use a 0–1000 scale with a top-left origin, normalized independently against the full frame height and width. Empty when no box is available in the source result. Absent when the source omits the field. The centre coordinates remain usable when no box is available. | --- schema: MinutesQuota title: MinutesQuota description: "The video you analysed in the current period. Each finished analysis counts its video's length, rounded up to a whole second, on the day (UTC) it finished. A failed or cancelled analysis counts nothing, and deleting an analysis does not give its seconds back." url: "https://mediaseer.ai/docs/api/schemas/minutesquota/" --- # MinutesQuota The video you analysed in the current period. Each finished analysis counts its video's length, rounded up to a whole second, on the day (UTC) it finished. A failed or cancelled analysis counts nothing, and deleting an analysis does not give its seconds back. | Field | Description | | - | - | | `usedSeconds` integer (int64), required | The seconds of video analysed in this period. | | `limitSeconds` integer (int64), optional | The seconds of video your plan includes per period. Absent when there is no limit. Starting an analysis is refused (`QUOTA_EXCEEDED`, field `minutes`) when none are left. An analysis whose video is longer than what is left ends `FAILED` with the message "The video is longer than the minutes left in this period." as soon as its length is known, and counts nothing, so finished analyses never take `usedSeconds` above the limit; it is above it only when your limit was lowered or newly set during the period. Analyses still `QUEUED` or `PROCESSING` already hold their videos' lengths of what is left, rounded up to whole seconds, though `usedSeconds` counts them only once they finish. | --- schema: Person title: Person url: "https://mediaseer.ai/docs/api/schemas/person/" --- # Person | Field | Description | | - | - | | `name` string, optional | Name extracted for the credited person. Capitalization can be normalized. | | `role` string, optional | Credited role. For acting credits, this is the character played when known, or a generic credit such as `Cast`. The value can be empty when unavailable. | | `department` [Department](https://mediaseer.ai/docs/api/schemas/department/), optional | The detected department of a person. `UNKNOWN` when the department could not be determined. Absent if no supported department was returned. | Uses [`Department`](https://mediaseer.ai/docs/api/schemas/department/). --- schema: Plan title: Plan description: "The plan your account is on. It sets storage.limitBytes, the storage for your source videos, minutes.limitSeconds and clips.limit, the video you can analyse and the clips you can make per period (none of these for test accounts), and can lower limits." url: "https://mediaseer.ai/docs/api/schemas/plan/" --- # Plan The plan your account is on. It sets `storage.limitBytes`, the storage for your source videos, `minutes.limitSeconds` and `clips.limit`, the video you can analyse and the clips you can make per period (none of these for test accounts), and can lower `limits`. | Field | Description | | - | - | | `id` string, required | The plan's identifier, a lower-case slug. New plans may be added. | | `name` string, required | The plan's name, for display. | --- schema: PlanChange title: PlanChange description: "A move to another plan at at, set from the web app. In getUsage, a change set for later (a smaller plan, or the end of a cancelled subscription), absent when none is set." url: "https://mediaseer.ai/docs/api/schemas/planchange/" --- # PlanChange A move to another plan at `at`, set from the web app. In `getUsage`, a change set for later (a smaller plan, or the end of a cancelled subscription), absent when none is set. | Field | Description | | - | - | | `plan` [Plan](https://mediaseer.ai/docs/api/schemas/plan/), required | | | `at` string (date-time), required | When you move to `plan`: the end of the current billing period (for a cancellation, an earlier end set already). A larger plan applies right away, when it is chosen. | Uses [`Plan`](https://mediaseer.ai/docs/api/schemas/plan/). --- schema: PlanList title: PlanList url: "https://mediaseer.ai/docs/api/schemas/planlist/" --- # PlanList | Field | Description | | - | - | | `items` array of [PlanOffer](https://mediaseer.ai/docs/api/schemas/planoffer/), required | Every plan, by `id`. | Uses [`PlanOffer`](https://mediaseer.ai/docs/api/schemas/planoffer/). --- schema: PlanOffer title: PlanOffer description: "A plan and the limits it sets. A limit that is absent is not set by the plan. Test accounts have none of the plan's limits on storage, minutes and clips." url: "https://mediaseer.ai/docs/api/schemas/planoffer/" --- # PlanOffer A plan and the limits it sets. A limit that is absent is not set by the plan. Test accounts have none of the plan's limits on storage, minutes and clips. | Field | Description | | - | - | | `id` string, required | The plan's identifier, as `plan.id` in `getUsage`. New plans may be added. | | `name` string, required | The plan's name, for display. | | `limits` [Limits](https://mediaseer.ai/docs/api/schemas/limits/), required | | | `storageLimitBytes` integer (int64), optional | The storage for source videos, as `storage.limitBytes` in `getUsage`. | | `minutesLimitSeconds` integer (int64), optional | The seconds of video you can analyse per period, as `minutes.limitSeconds` in `getUsage`. | | `clipsLimit` integer, optional | The clips you can make per period, as `clips.limit` in `getUsage`. | | `price` [PlanPrice](https://mediaseer.ai/docs/api/schemas/planprice/), optional | | Uses [`Limits`](https://mediaseer.ai/docs/api/schemas/limits/), [`PlanPrice`](https://mediaseer.ai/docs/api/schemas/planprice/). --- schema: PlanPrice title: PlanPrice description: "What the plan costs. Present only for a plan you can buy now, in the web app; absent for a free plan, and for any plan while buying is not available." url: "https://mediaseer.ai/docs/api/schemas/planprice/" --- # PlanPrice What the plan costs. Present only for a plan you can buy now, in the web app; absent for a free plan, and for any plan while buying is not available. | Field | Description | | - | - | | `amount` integer (int64), required | The price per interval in the currency's smallest unit (cents for EUR). | | `currency` string, required | ISO 4217 currency code. | | `interval` [BillingInterval](https://mediaseer.ai/docs/api/schemas/billinginterval/), required | | Uses [`BillingInterval`](https://mediaseer.ai/docs/api/schemas/billinginterval/). --- schema: Rating title: Rating url: "https://mediaseer.ai/docs/api/schemas/rating/" --- # Rating | Field | Description | | - | - | | `region` string, optional | Region label for the estimate, such as `US`, `UK` or `EU`. | | `system` string, optional | Name of the movie or TV rating system used for the estimate, such as `MPAA (Motion Picture Association of America) Ratings` or `TV Parental Guidelines`. | | `rating` string, optional | AI-estimated classification within the indicated system, such as `PG-13` or `TV-14`. Can be empty when no classification was provided. | --- schema: Scene title: Scene url: "https://mediaseer.ai/docs/api/schemas/scene/" --- # Scene | Field | Description | | - | - | | `id` string, optional | Opaque identifier assigned to the scene within this analysis result. It can change across analyses of the same video. | | `title` string, optional | Short AI-generated title for the scene. | | `startInSeconds` number (double), optional | Start of the scene in seconds from the beginning of the video. | | `endInSeconds` number (double), optional | End of the scene in seconds from the beginning of the video. | | `content` [SceneContent](https://mediaseer.ai/docs/api/schemas/scenecontent/), optional | Structured description of the scene's characters, objects, settings and narrative dynamics. Individual findings can be unavailable. | | `summary` string, optional | Concise AI-generated summary of the scene. | | `verboseSummary` string, optional | Detailed AI-generated description of the scene, with more context than the summary. | | `sensitiveTopics` array of string, required | Sensitive topics in the scene, as short phrases such as `violence` or `war`. Empty when none were found, or when the analysis did not produce the list. | | `keywords` array of string, required | Free-text keywords for the scene. Empty when no terms were produced. | | `iab` [IabTaxonomy](https://mediaseer.ai/docs/api/schemas/iabtaxonomy/), optional | IAB taxonomy classifications of the scene's subject matter, relevant advertising categories and sensitive topics. Classification lists can be empty when no taxonomy result is available. | | `type` [SceneType](https://mediaseer.ai/docs/api/schemas/scenetype/), optional | The detected type of scene based on content analysis. `UNKNOWN` when the analysis cannot determine the scene type. Absent if no supported type was returned. | | `shots` array of [Shot](https://mediaseer.ai/docs/api/schemas/shot/), optional | A detailed breakdown of individual camera shots within this scene, providing granular analysis of visual content and subjects. Can be empty or absent when no shot results are available. The list can omit shots, and a listed shot can cross a scene boundary or fall outside the associated scene's interval. | | `adOpportunityInformation` [AdOpportunity](https://mediaseer.ai/docs/api/schemas/adopportunity/), optional | Suitability of the end of this scene for an ad break. Default values can be returned when the scene was not assessed. This field does not report a placed ad. | Uses [`SceneContent`](https://mediaseer.ai/docs/api/schemas/scenecontent/), [`IabTaxonomy`](https://mediaseer.ai/docs/api/schemas/iabtaxonomy/), [`SceneType`](https://mediaseer.ai/docs/api/schemas/scenetype/), [`Shot`](https://mediaseer.ai/docs/api/schemas/shot/), [`AdOpportunity`](https://mediaseer.ai/docs/api/schemas/adopportunity/). --- schema: SceneAnalysisDetails title: SceneAnalysisDetails url: "https://mediaseer.ai/docs/api/schemas/sceneanalysisdetails/" --- # SceneAnalysisDetails | Field | Description | | - | - | | `scenes` array of [Scene](https://mediaseer.ai/docs/api/schemas/scene/), required | The scenes of the video with available results, each with its start and end time. | | `duration` number (double), optional | Duration of the analyzed video in seconds, based on the detected shot timeline. | | `description` string, required | AI-generated summary of the video as a whole. Can be empty when no asset summary is available. | | `title` string, optional | Inferred title for the analysed content as a whole. Absent or empty when not available. | | `keywords` array of string, required | Free-text keywords for the video as a whole. Empty when no terms were produced, including when the asset summary is unavailable. | | `ratings` array of [Rating](https://mediaseer.ai/docs/api/schemas/rating/), required | AI-estimated content ratings for the video, with one entry per supported region and rating system when asset summarization succeeds. Empty when no ratings were produced. | | `sensitiveTopics` array of string, required | Free-text sensitive topics inferred for the video as a whole. They can differ from the combined scene topics. Empty when no asset-level topics were produced, including when the asset summary is unavailable. | | `iabSensitiveTopicTaxonomies` array of string, required | Distinct IAB Content Taxonomy IDs drawn from the scenes' sensitive-topic annotations. Empty when no IDs were collected or when the aggregate is unavailable. | | `inputLanguageCodes` array of string, optional | Language codes identified for spoken dialogue or narration in the source video, such as `en`. Identification excludes theme-song vocals, lyrics, music and written text. Empty or absent when no codes were returned, including for input without audio. | | `credits` [Credits](https://mediaseer.ai/docs/api/schemas/credits/), optional | Selected cast, crew and song credits and the copyright year, extracted from readable on-screen credit text. Credits can be empty when no readable credits were available or extraction produced no result. | | `metadata` [SceneAnalysisMetadata](https://mediaseer.ai/docs/api/schemas/sceneanalysismetadata/), required | Information about the analysis that produced this result: the software version and a disclaimer. | Uses [`Scene`](https://mediaseer.ai/docs/api/schemas/scene/), [`Rating`](https://mediaseer.ai/docs/api/schemas/rating/), [`Credits`](https://mediaseer.ai/docs/api/schemas/credits/), [`SceneAnalysisMetadata`](https://mediaseer.ai/docs/api/schemas/sceneanalysismetadata/). --- schema: SceneAnalysisMetadata title: SceneAnalysisMetadata url: "https://mediaseer.ai/docs/api/schemas/sceneanalysismetadata/" --- # SceneAnalysisMetadata | Field | Description | | - | - | | `version` string, optional | Version of the analysis software that generated the result. A local build without a recorded version uses `0.0.0`. | | `disclaimer` string, optional | Attribution identifying the result as AI-generated, such as `Generated by Bitmovin AI`. | --- schema: SceneAtmosphere title: SceneAtmosphere url: "https://mediaseer.ai/docs/api/schemas/sceneatmosphere/" --- # SceneAtmosphere | Field | Description | | - | - | | `mood` string, optional | Mood or tone of the setting, in free text. Can be empty when unavailable. | | `lighting` string, optional | Lighting of the setting, in free text, such as `dim` or `bright studio lighting`. Can be empty when unavailable. | | `weather` string, optional | Weather or indoor conditions, in free text. Can be empty or use unknown wording. | --- schema: SceneCharacter title: SceneCharacter url: "https://mediaseer.ai/docs/api/schemas/scenecharacter/" --- # SceneCharacter | Field | Description | | - | - | | `name` string, optional | Name assigned to the character when identified. It can be absent, empty or reported as unknown, even when a summary names the person. | | `playedBy` string, optional | Name of the performer credited for the identified character role when the role maps to a single performer. Can be absent or empty when unresolved. | | `description` string, optional | What the character does in the scene. Absent when not determined. | | `characterAppearance` [CharacterAppearance](https://mediaseer.ai/docs/api/schemas/characterappearance/), optional | Description of the character's visible appearance. Individual attributes can be empty or unknown. | Uses [`CharacterAppearance`](https://mediaseer.ai/docs/api/schemas/characterappearance/). --- schema: SceneContent title: SceneContent url: "https://mediaseer.ai/docs/api/schemas/scenecontent/" --- # SceneContent | Field | Description | | - | - | | `characters` array of [SceneCharacter](https://mediaseer.ai/docs/api/schemas/scenecharacter/), required | People and characters in the scene. Empty when there are none, or when the analysis did not produce the list. | | `objects` array of [SceneObject](https://mediaseer.ai/docs/api/schemas/sceneobject/), required | Selected notable objects described in the scene. Empty when none were returned or when object findings were unavailable. | | `settings` array of [SceneSetting](https://mediaseer.ai/docs/api/schemas/scenesetting/), required | Places and conditions described in the scene. A scene can have multiple settings. Empty when none were returned or when settings were unavailable. | | `dynamics` [SceneDynamics](https://mediaseer.ai/docs/api/schemas/scenedynamics/), optional | Assessment of the scene's narrative tension and pacing. Individual values can be `UNKNOWN` when unavailable. | Uses [`SceneCharacter`](https://mediaseer.ai/docs/api/schemas/scenecharacter/), [`SceneObject`](https://mediaseer.ai/docs/api/schemas/sceneobject/), [`SceneSetting`](https://mediaseer.ai/docs/api/schemas/scenesetting/), [`SceneDynamics`](https://mediaseer.ai/docs/api/schemas/scenedynamics/). --- schema: SceneDynamics title: SceneDynamics url: "https://mediaseer.ai/docs/api/schemas/scenedynamics/" --- # SceneDynamics | Field | Description | | - | - | | `tension` [SceneTension](https://mediaseer.ai/docs/api/schemas/scenetension/), optional | The detected tension of the scene based on content analysis. `UNKNOWN` when the analysis could not determine tension. Absent if no supported value was returned. | | `pacing` [ScenePacing](https://mediaseer.ai/docs/api/schemas/scenepacing/), optional | The detected pacing of the scene based on content analysis. `UNKNOWN` when the analysis could not determine pacing. Absent if no supported value was returned. | Uses [`SceneTension`](https://mediaseer.ai/docs/api/schemas/scenetension/), [`ScenePacing`](https://mediaseer.ai/docs/api/schemas/scenepacing/). --- schema: SceneLocation title: SceneLocation url: "https://mediaseer.ai/docs/api/schemas/scenelocation/" --- # SceneLocation | Field | Description | | - | - | | `name` string, optional | Short descriptive name of the place, such as `Basketball Arena`. Can be empty when unavailable. | | `description` string, optional | Free-text description of the place. Can be empty when unavailable. | --- schema: SceneObject title: SceneObject url: "https://mediaseer.ai/docs/api/schemas/sceneobject/" --- # SceneObject | Field | Description | | - | - | | `description` string, optional | Description of the object. Absent when not determined. | | `category` string, optional | Kind of object in free text, such as `Furniture`, `Vehicle` or `Weapon`. Not from a fixed list, so spelling and case vary. Absent when not determined. | --- schema: ScenePacing title: ScenePacing url: "https://mediaseer.ai/docs/api/schemas/scenepacing/" --- # ScenePacing | Value | Description | | - | - | | `SLOW` | Deliberate, unhurried pace with contemplative moments or establishing shots | | `MEASURED` | Steady, controlled pace typical of dialogue-driven scenes or methodical storytelling | | `BRISK` | Quick, energetic pace found in action sequences or montages | | `FRANTIC` | Rapid, chaotic pace with intense action or panic-driven scenes | | `UNKNOWN` | Unable to determine pacing | --- schema: SceneSetting title: SceneSetting url: "https://mediaseer.ai/docs/api/schemas/scenesetting/" --- # SceneSetting | Field | Description | | - | - | | `location` [SceneLocation](https://mediaseer.ai/docs/api/schemas/scenelocation/), optional | Place described for the setting. The description need not identify a real geographic location. | | `timeOfDay` string, optional | Time of day in free text, such as `morning` or `night`. Wording and case can vary, including for unknown values. | | `atmosphere` [SceneAtmosphere](https://mediaseer.ai/docs/api/schemas/sceneatmosphere/), optional | Inferred mood, lighting and weather of the setting. Individual descriptions can be empty or unknown. | Uses [`SceneLocation`](https://mediaseer.ai/docs/api/schemas/scenelocation/), [`SceneAtmosphere`](https://mediaseer.ai/docs/api/schemas/sceneatmosphere/). --- schema: SceneTension title: SceneTension url: "https://mediaseer.ai/docs/api/schemas/scenetension/" --- # SceneTension | Value | Description | | - | - | | `EXTREME` | Peak suspense or intensity, such as climactic confrontations or life-threatening situations | | `HIGH` | Significant tension with emotionally charged moments, such as arguments or chase scenes | | `MODERATE` | Some tension present, engaging but not overwhelming, such as mild conflict or anticipation | | `LOW` | Minimal tension with calm or relaxed scenes, such as exposition or casual dialogue | | `UNKNOWN` | Unable to determine tension level | --- schema: SceneType title: SceneType url: "https://mediaseer.ai/docs/api/schemas/scenetype/" --- # SceneType | Value | Description | | - | - | | `LOGO_IDENT` | Network, studio, or platform identification bumpers | | `OPENING_CREDITS` | Opening sequence presenting title, credits, or thematic elements without in-world dialogue | | `RECAP` | "Previously on …" montage sequences from prior episodes | | `PREVIEW_THIS_TITLE` | Teaser or preview for this title or its upcoming episode | | `PROMOTION_OTHER_TITLE` | Promotion or trailer for a different title or programming | | `BREAK_BUMPER` | Short bumper marking an act or advertising break | | `END_CREDITS` | Closing credits, acknowledgments, or copyright notices | | `ADS` | Commercial advertisements with promotional intent and call-to-action | | `MAIN_CONTENT` | Main narrative, dialogue, or educational material | | `UNKNOWN` | Fallback when AI confidence is below minimum threshold | --- schema: Shot title: Shot url: "https://mediaseer.ai/docs/api/schemas/shot/" --- # Shot | Field | Description | | - | - | | `startInSeconds` number (double), required | The start time of the shot in seconds from the beginning of the video | | `endInSeconds` number (double), required | The end time of the shot in seconds from the beginning of the video | | `detailedDescription` string, optional | A comprehensive textual description of the visual content, action, and context within this shot. Absent when not determined. | | `keywords` array of string, optional | A list of relevant keywords and tags that describe the content, themes, or notable elements in this shot. Can be empty or absent when no keywords were returned, including when shot-detail analysis was unavailable. | | `mainSubjects` array of [MainSubject](https://mediaseer.ai/docs/api/schemas/mainsubject/), optional | Selected physical subjects described in the shot. Positions refer to a sampled frame. Can be empty or absent when no subjects were returned, including when shot-detail analysis was unavailable. | | `shotAdvisories` [ShotAdvisories](https://mediaseer.ai/docs/api/schemas/shotadvisories/), optional | Content advisory detection results for this shot, such as tobacco or vaping imagery. Absent when no advisory assessment is available or the result contains an unsupported advisory value. If the model declined assessment and a blocked result was returned, its status is `BLOCKED`. | Uses [`MainSubject`](https://mediaseer.ai/docs/api/schemas/mainsubject/), [`ShotAdvisories`](https://mediaseer.ai/docs/api/schemas/shotadvisories/). --- schema: ShotAdvisories title: ShotAdvisories url: "https://mediaseer.ai/docs/api/schemas/shotadvisories/" --- # ShotAdvisories | Field | Description | | - | - | | `status` [AdvisoryAnalysisStatus](https://mediaseer.ai/docs/api/schemas/advisoryanalysisstatus/), required | Whether and how the shot was assessed for content advisories | | `advisories` array of [ContentAdvisory](https://mediaseer.ai/docs/api/schemas/contentadvisory/), required | Advisories reported for this shot. Use the `status` to distinguish assessed shots from blocked shots. | Uses [`AdvisoryAnalysisStatus`](https://mediaseer.ai/docs/api/schemas/advisoryanalysisstatus/), [`ContentAdvisory`](https://mediaseer.ai/docs/api/schemas/contentadvisory/). --- schema: Song title: Song url: "https://mediaseer.ai/docs/api/schemas/song/" --- # Song | Field | Description | | - | - | | `name` string, optional | Song title extracted from on-screen credits. Can be empty when unavailable. | | `artist` string, optional | Performer identified for the song in the on-screen credits. Can be empty when unavailable. | --- schema: StorageQuota title: StorageQuota description: "The storage your source videos and clips take. Your plan limits only the source videos (sourceBytes); clips have no limit, and are counted so you can see what they take. A source video counts the size declared for its upload, and once its analysis has finished and been measured, the files it keeps; a failed or cancelled analysis, and an upload whose upload window has passed, count nothing. A clip job counts its clips and posters once they have been measured, which happens when the ready job itself (not the list) is read, or for a job that is only listed, by a background check that runs several times an hour. A successful delete frees the storage of an analysis or clip job at once." url: "https://mediaseer.ai/docs/api/schemas/storagequota/" --- # StorageQuota The storage your source videos and clips take. Your plan limits only the source videos (`sourceBytes`); clips have no limit, and are counted so you can see what they take. A source video counts the size declared for its upload, and once its analysis has finished and been measured, the files it keeps; a failed or cancelled analysis, and an upload whose upload window has passed, count nothing. A clip job counts its clips and posters once they have been measured, which happens when the ready job itself (not the list) is read, or for a job that is only listed, by a background check that runs several times an hour. A successful delete frees the storage of an analysis or clip job at once. | Field | Description | | - | - | | `usedBytes` integer (int64), required | All the storage you use, `sourceBytes` plus `clipBytes`. | | `sourceBytes` integer (int64), required | The storage your source videos take, what `limitBytes` applies to. | | `clipBytes` integer (int64), required | The storage your clips take. It has no limit. | | `limitBytes` integer (int64), optional | The storage your plan includes for source videos, which `sourceBytes` is held to; clips do not count. Absent when there is no limit. Creating an analysis is refused (`QUOTA_EXCEEDED`, field `storage`) when its declared size does not fit into what `sourceBytes` leaves. `sourceBytes` can still end up above the limit: a finished analysis counts the files it keeps, which can be more than its declared size. | --- schema: StreamInfo title: StreamInfo url: "https://mediaseer.ai/docs/api/schemas/streaminfo/" --- # StreamInfo | Field | Description | | - | - | | `playlistUrl` string (uri), required | Absolute playback URL. Give it to the player unchanged. | | `expiresAt` string (date-time), required | When the ticket stops opening the playlists. Segments already listed keep playing. | --- schema: Subscription title: Subscription description: "The subscription you pay your plan with, as the payment provider last reported it. Absent while you have none, or once it has ended: you are then on the free plan." url: "https://mediaseer.ai/docs/api/schemas/subscription/" --- # Subscription The subscription you pay your plan with, as the payment provider last reported it. Absent while you have none, or once it has ended: you are then on the free plan. | Field | Description | | - | - | | `status` [SubscriptionStatus](https://mediaseer.ai/docs/api/schemas/subscriptionstatus/), required | | | `renewsAt` string (date-time), optional | When the current billing period ends and the plan is renewed and charged again. Absent when the subscription is set to end (`cancelAt`), and while it doesn't pay for the plan (`UNPAID`, `INCOMPLETE`, `PAUSED`). | | `cancelAt` string (date-time), optional | When the subscription ends, as it is set to. While it pays, you keep your plan until then; you are on the free plan after it. Absent when it renews. | | `change` [PlanChange](https://mediaseer.ai/docs/api/schemas/planchange/), optional | | Uses [`SubscriptionStatus`](https://mediaseer.ai/docs/api/schemas/subscriptionstatus/), [`PlanChange`](https://mediaseer.ai/docs/api/schemas/planchange/). --- schema: SubscriptionStatus title: SubscriptionStatus description: "- ACTIVE: paid, the plan applies - TRIALING: in a free trial, the plan applies - PAST_DUE: the last payment failed and is being retried; the plan still applies - UNPAID: the payment retries ran out; you are on the free plan until it is paid - INCOMPLETE: the first payment has not gone through yet; the plan applies once it has - PAUSED: paused; you are on the free plan while it is New values may be added." url: "https://mediaseer.ai/docs/api/schemas/subscriptionstatus/" --- # SubscriptionStatus - `ACTIVE`: paid, the plan applies - `TRIALING`: in a free trial, the plan applies - `PAST_DUE`: the last payment failed and is being retried; the plan still applies - `UNPAID`: the payment retries ran out; you are on the free plan until it is paid - `INCOMPLETE`: the first payment has not gone through yet; the plan applies once it has - `PAUSED`: paused; you are on the free plan while it is New values may be added. | Value | Description | | - | - | | `ACTIVE` | | | `TRIALING` | | | `PAST_DUE` | | | `UNPAID` | | | `INCOMPLETE` | | | `PAUSED` | | --- schema: UploadSession title: UploadSession description: "A Google Cloud Storage resumable upload session. Upload the file with PUT requests to url (whole file, or chunks with Content-Range); the session supports resuming after a network drop. No credentials are needed; the URL is the credential." url: "https://mediaseer.ai/docs/api/schemas/uploadsession/" --- # UploadSession A Google Cloud Storage resumable upload session. Upload the file with `PUT` requests to `url` (whole file, or chunks with `Content-Range`); the session supports resuming after a network drop. No credentials are needed; the URL is the credential. | Field | Description | | - | - | | `url` string (uri), required | | | `expiresAt` string (date-time), required | Deadline for uploading to this URL. A completed upload can still be started within the analysis's upload window. | --- schema: Usage title: Usage url: "https://mediaseer.ai/docs/api/schemas/usage/" --- # Usage | Field | Description | | - | - | | `jobs` [JobQuota](https://mediaseer.ai/docs/api/schemas/jobquota/), required | | | `limits` [Limits](https://mediaseer.ai/docs/api/schemas/limits/), required | | | `storage` [StorageQuota](https://mediaseer.ai/docs/api/schemas/storagequota/), required | | | `plan` [Plan](https://mediaseer.ai/docs/api/schemas/plan/), required | | | `period` [UsagePeriod](https://mediaseer.ai/docs/api/schemas/usageperiod/), required | | | `minutes` [MinutesQuota](https://mediaseer.ai/docs/api/schemas/minutesquota/), required | | | `clips` [ClipsQuota](https://mediaseer.ai/docs/api/schemas/clipsquota/), required | | | `subscription` [Subscription](https://mediaseer.ai/docs/api/schemas/subscription/), optional | | Uses [`JobQuota`](https://mediaseer.ai/docs/api/schemas/jobquota/), [`Limits`](https://mediaseer.ai/docs/api/schemas/limits/), [`StorageQuota`](https://mediaseer.ai/docs/api/schemas/storagequota/), [`Plan`](https://mediaseer.ai/docs/api/schemas/plan/), [`UsagePeriod`](https://mediaseer.ai/docs/api/schemas/usageperiod/), [`MinutesQuota`](https://mediaseer.ai/docs/api/schemas/minutesquota/), [`ClipsQuota`](https://mediaseer.ai/docs/api/schemas/clipsquota/), [`Subscription`](https://mediaseer.ai/docs/api/schemas/subscription/). --- schema: UsagePeriod title: UsagePeriod description: "The period minutes and clips are counted in. On a paid plan, the period is your billing period, split into months for a yearly price; otherwise it runs monthly from the day (UTC) you signed up. Signed up on the 29th, 30th or 31st, a month without that day has its period start on its last day. Both ends are midnight UTC; usage resets at end, which is the next period's start." url: "https://mediaseer.ai/docs/api/schemas/usageperiod/" --- # UsagePeriod The period `minutes` and `clips` are counted in. On a paid plan, the period is your billing period, split into months for a yearly price; otherwise it runs monthly from the day (UTC) you signed up. Signed up on the 29th, 30th or 31st, a month without that day has its period start on its last day. Both ends are midnight UTC; usage resets at `end`, which is the next period's `start`. | Field | Description | | - | - | | `start` string (date-time), required | When the current period began. | | `end` string (date-time), required | When the current period ends and `minutes` and `clips` start again from 0. | --- schema: VodAnalysis title: VodAnalysis url: "https://mediaseer.ai/docs/api/schemas/vodanalysis/" --- # VodAnalysis Includes the fields of [`VodAnalysisSummary`](https://mediaseer.ai/docs/api/schemas/vodanalysissummary/). | Field | Description | | - | - | | `id` string, required | | | `state` [VodAnalysisState](https://mediaseer.ai/docs/api/schemas/vodanalysisstate/), required | | | `fileName` string, required | Name of the uploaded file. | | `createdAt` string (date-time), required | | | `title` string, optional | Given at create, else inferred by the analysis. | | `description` string, optional | Summary of the whole video, from the analysis. | | `sceneCount` integer, optional | | | `keywords` array of string, optional | | | `durationSeconds` number (double), optional | | | `updatedAt` string (date-time), required | | | `sizeBytes` integer (int64), optional | Size of the uploaded object; known from `start` on. | | `startedAt` string (date-time), optional | When `start` was accepted. | | `finishedAt` string (date-time), optional | When the resource reached a terminal state. | | `error` [VodAnalysisError](https://mediaseer.ai/docs/api/schemas/vodanalysiserror/), optional | | | `clips` [ClipAvailability](https://mediaseer.ai/docs/api/schemas/clipavailability/), optional | Whether clips can be created from this analysis, and if not, why. Treat an absent `clips` as not available. | Uses [`VodAnalysisState`](https://mediaseer.ai/docs/api/schemas/vodanalysisstate/), [`VodAnalysisError`](https://mediaseer.ai/docs/api/schemas/vodanalysiserror/), [`ClipAvailability`](https://mediaseer.ai/docs/api/schemas/clipavailability/). --- schema: VodAnalysisError title: VodAnalysisError description: Why the analysis failed. Only set in state FAILED. url: "https://mediaseer.ai/docs/api/schemas/vodanalysiserror/" --- # VodAnalysisError Why the analysis failed. Only set in state `FAILED`. | Field | Description | | - | - | | `message` string, required | A sentence for people, in Mediaseer's own words, never the processing platform's text. It names the cause when Mediaseer knows it, such as a video longer than the length limit or a start that never ran; otherwise it says only that the encoding failed or no longer exists. Don't branch on its wording. | --- schema: VodAnalysisPage title: VodAnalysisPage url: "https://mediaseer.ai/docs/api/schemas/vodanalysispage/" --- # VodAnalysisPage | Field | Description | | - | - | | `items` array of [VodAnalysisSummary](https://mediaseer.ai/docs/api/schemas/vodanalysissummary/), required | | | `total` integer, required | Total number of resources of the caller, regardless of paging. | | `limit` integer, required | | | `offset` integer, required | | Uses [`VodAnalysisSummary`](https://mediaseer.ai/docs/api/schemas/vodanalysissummary/). --- schema: VodAnalysisResults title: VodAnalysisResults url: "https://mediaseer.ai/docs/api/schemas/vodanalysisresults/" --- # VodAnalysisResults | Field | Description | | - | - | | `outputLanguageCodes` array of string, required | Languages of translated results available through Mediaseer. This list is currently always empty. | | `analysis` [SceneAnalysisDetails](https://mediaseer.ai/docs/api/schemas/sceneanalysisdetails/), required | The analysis of the video, generated by Bitmovin AI Scene Analysis. | Uses [`SceneAnalysisDetails`](https://mediaseer.ai/docs/api/schemas/sceneanalysisdetails/). --- schema: VodAnalysisState title: VodAnalysisState description: "- UPLOADING: created, waiting for the client to upload and call start - QUEUED: started; the video's length is checked, then it waits to be processed - PROCESSING: encoding and analysis running - FINISHED: results available - FAILED: could not start or finish, or the video was too long; see error - CANCELLED: stopped by you or the processing service" url: "https://mediaseer.ai/docs/api/schemas/vodanalysisstate/" --- # VodAnalysisState - `UPLOADING`: created, waiting for the client to upload and call `start` - `QUEUED`: started; the video's length is checked, then it waits to be processed - `PROCESSING`: encoding and analysis running - `FINISHED`: results available - `FAILED`: could not start or finish, or the video was too long; see `error` - `CANCELLED`: stopped by you or the processing service | Value | Description | | - | - | | `UPLOADING` | | | `QUEUED` | | | `PROCESSING` | | | `FINISHED` | | | `FAILED` | | | `CANCELLED` | | --- schema: VodAnalysisSummary title: VodAnalysisSummary description: "A summary of one analysis. title, description, sceneCount, keywords and durationSeconds come from the analysis results and are absent until it is FINISHED (title may be present earlier if given at create)." url: "https://mediaseer.ai/docs/api/schemas/vodanalysissummary/" --- # VodAnalysisSummary A summary of one analysis. `title`, `description`, `sceneCount`, `keywords` and `durationSeconds` come from the analysis results and are absent until it is `FINISHED` (`title` may be present earlier if given at create). | Field | Description | | - | - | | `id` string, required | | | `state` [VodAnalysisState](https://mediaseer.ai/docs/api/schemas/vodanalysisstate/), required | | | `fileName` string, required | Name of the uploaded file. | | `createdAt` string (date-time), required | | | `title` string, optional | Given at create, else inferred by the analysis. | | `description` string, optional | Summary of the whole video, from the analysis. | | `sceneCount` integer, optional | | | `keywords` array of string, optional | | | `durationSeconds` number (double), optional | | Uses [`VodAnalysisState`](https://mediaseer.ai/docs/api/schemas/vodanalysisstate/).