# AI Viral Clip Generator – Long Video to Shorts (`lumaxys/ai-viral-clip-generator`) Actor

Turn podcasts, interviews, webinars, and long videos into distinct, non-overlapping 9:16 clips. AI selects strong moments, follows the active speaker, adds or translates subtitles in 10 languages, validates every MP4, and returns SRT, VTT, metadata, and ZIP.

- **URL**: https://apify.com/lumaxys/ai-viral-clip-generator.md
- **Developed by:** [François Fernandez](https://apify.com/lumaxys) (community)
- **Categories:** AI, Automation, Videos
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $80.00 / 1,000 rendered clip minutes

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## AI Viral Clip Generator – Long Video to Shorts

Turn one long video into several distinct vertical clips for TikTok, Instagram Reels, YouTube Shorts, or another vertical-video workflow.

The Actor transcribes the audio, selects self-contained passages, prevents overlapping or duplicate clips, cuts on speech boundaries, reframes each clip to 9:16, optionally translates and publishes subtitles, validates the rendered files, and returns the videos with metadata.

> **Important:** This is an automatic first edit, not a human editorial or linguistic review. Watch every delivered clip before publishing it.

### Which Actor should I use?

- **Create translated subtitle files from audio or video, without rendering a final video:** [Video & Audio to Translated Subtitles](https://apify.com/lumaxys/professional-subtitle-formatter)
- **Check or conservatively correct an existing SRT or VTT file:** [Professional Subtitle QC](https://apify.com/lumaxys/subtitle-qc)
- **Run the complete transcription, translation, subtitle QC, and optional subtitled-video workflow:** [Professional Subtitle Translator & Video Captioner](https://apify.com/lumaxys/media-to-professional-subtitles)
- **Convert an existing subtitle file between SRT, VTT, ASS, and JSON, or adjust its timing:** [Subtitle Converter & Resync](https://apify.com/lumaxys/subtitle-converter-and-resync)
- **Select several distinct moments from a long video and turn them into vertical short videos:** use this Actor.

Each Actor covers a different stage of the media and subtitle workflow, so you only pay for the processing you actually need.

### 1. Read this before your first run

| Question | Answer |
| --- | --- |
| What source can I provide? | One uploaded MP4, MOV, MKV, or WebM, or one direct URL to such a file. |
| Can I paste a YouTube, TikTok, or Instagram page? | No. Platform page URLs are refused. Upload a file you own or provide a direct media-file URL you control. |
| Are the requested clip count and length guaranteed? | No. The Actor returns fewer clips when the source does not contain enough distinct, complete passages. |
| Does **Follow the main face** remove camera shake? | No. It stabilises the virtual crop around a subject; it does not stabilise shake already present in the source footage. |
| Are subtitles compulsory? | No. Burned subtitles, SRT files, and VTT files are three independent options. |
| Can it translate? | Yes, into ten validated output languages. Translation is automatic and unreviewed. |
| What format is rendered? | Vertical 9:16 only, at 720 × 1280 or 1080 × 1920. |
| Does it publish to social networks? | No. It produces files and metadata; you review and publish them yourself. |

The Actor needs a video and an audible speech track. Weak, distorted, overlapping, or music-covered speech can reduce transcription, selection, and active-speaker accuracy.

### 2. Quick start in the Apify Console

1. Open the Actor's **Input** tab.
2. Under **Video file**, click **Upload new files** and select one video. Alternatively, enter one direct media URL under **Direct video URL**. Do not fill both fields.
3. Tick **I own this content or am authorised to transform it**.
4. For a first run, use:
   - 3 clips;
   - 30–60 seconds;
   - 9:16 at 720 × 1280;
   - **Follow the main face**;
   - **Centre crop** if no reliable face is found;
   - original language;
   - `maxCostUsd: 5`.
5. Choose the subtitle result you want using the recipes below, then run.

The restorable example intentionally contains no media. Add your own video before pressing **Start**. Starting with no video performs a free readiness check and therefore produces no clips.

### 3. Choose the exact subtitle result

These options are independent. `burnSubtitles` controls visible text inside the MP4. `generateSrt` and `generateVtt` control separate subtitle files.

| Desired result | `outputLanguage` | `outputLanguageMode` | `burnSubtitles` | `generateSrt` / `generateVtt` |
| --- | --- | --- | --- | --- |
| Video only, no subtitle artifacts | empty | `original` | `false` | both `false` |
| Original-language subtitles | empty | `original` | as desired | as desired |
| Translated subtitles only | choose a target | `translations` | as desired | as desired |
| Original + translation | choose a target | `both` | as desired | as desired |

In `both` mode, two subtitle levels in the video are intentional: the translation is the primary lower track and the original is a smaller secondary track above it. Choose `translations`, not `both`, when you want French-only, Spanish-only, or another single translated language.

Translated-only example:

```json
{
  "outputLanguage": "FR",
  "outputLanguageMode": "translations",
  "burnSubtitles": true,
  "generateSrt": true,
  "generateVtt": false
}
```

Video-only example:

```json
{
  "outputLanguageMode": "original",
  "burnSubtitles": false,
  "generateSrt": false,
  "generateVtt": false
}
```

If subtitles are already burned into the source image, the Actor cannot remove them. Burning a new track on top can look like duplicate subtitles. Embedded text or bitmap subtitle streams are not used as transcription input: this version transcribes the audio.

### 4. Inputs

| Field | Meaning |
| --- | --- |
| `videoFile` | One real file upload. In JSON it is an array containing the URL created by Apify's upload widget. Do not add characters to that URL manually. |
| `videoUrl` | One publicly reachable direct media-file URL. It must return the video bytes, not an HTML page. |
| `confirmContentRights` | Required. Processing does not start until this is `true`. |
| `clipCount` | 1 to 10; default 3. It is a target, not permission to duplicate material. |
| `targetClipDuration` | `15-30`, `30-60`, or `60-90` seconds. The Actor may adjust a boundary to preserve a complete sentence. |
| `platform` | `TikTok`, `Instagram Reels`, `YouTube Shorts`, or `Generic vertical`. This affects suggested metadata only. JSON values are case-sensitive. |
| `sourceLanguage` | Leave empty for automatic detection. If set through JSON, use a language code such as `en`, `fr`, `es`, `de`, `it`, `pt`, `ar`, `zh`, `ja`, or `ko`. |
| `outputLanguage` | Optional translation target: `EN-US`, `ES`, `FR`, `DE`, `IT`, `PT-BR`, `AR`, `ZH-HANS`, `JA`, or `KO`. |
| `outputLanguageMode` | `original`, `translations`, or `both`. A translated mode requires `outputLanguage`. |
| `aspectRatio` | `9:16`. Other ratios are refused rather than silently rendered incorrectly. |
| `resolution` | `720x1280` or `1080x1920`. HD has a higher render price. |
| `cropMode` | `face_tracking`, `center_crop`, or `blurred_background`. |
| `fallbackCropMode` | `center_crop` or `blurred_background`, used when tracking has no reliable subject. |
| `burnSubtitles` | Whether subtitles are visibly rendered into the MP4. |
| `subtitleStyle` | `Clean`, `Bold`, or `Minimal`; relevant only when subtitles are burned. |
| `generateSrt`, `generateVtt` | Whether separate subtitle files are produced. |
| `createZip` | Whether all produced artifacts are also packaged into `ai-viral-clips.zip`. |
| `maxCostUsd` | Internal cost ceiling checked before any paid provider call. Minimum $1. |
| `minimumViralScore` | Optional editorial-score threshold. A high value can reduce the number of delivered clips. |
| `avoidOverlaps` | Keep enabled to prevent overlapping or reused source passages. |
| `maxMediaMinutes` | Refuse longer sources. Default 90 minutes; maximum 180. |

The form supplies the allowed values. When using JSON, copy their spelling and capitalisation exactly. For example, use `"platform": "TikTok"`, not `"tiktok"`.

### 5. How the clips remain different

The analysis model proposes candidate passages from the timed transcript. The Actor then validates the candidates independently of the model:

- source intervals cannot significantly overlap;
- textual duplicates and near-duplicates are rejected;
- neighbouring slices of the same exchange are rejected;
- delivered clips normally keep a 20-second editorial gap;
- cuts are moved to word, phrase, and sentence boundaries where possible;
- if the model concentrates all proposals in one section, a deterministic pass searches other complete transcript regions.

`clipCount: 3` means “find up to three honest clips,” not “produce three files at any cost.” A short or repetitive source may correctly return only one or two clips. Reducing the target duration may reveal more distinct passages; turning off overlap protection is not recommended.

### 6. What the viral score means

The 0–100 score is an editorial estimate based on hook strength, standalone quality, clarity, informative value, curiosity, emotional intensity, pacing, and conclusion, with penalties for context dependency and artificial cuts. The full breakdown is returned with every clip.

It is not a performance prediction or a promise that a clip will go viral.

### 7. Framing and active-speaker tracking

| Mode | Behaviour | Best for |
| --- | --- | --- |
| `face_tracking` | Detects persistent faces, compares visible speech with the audio, follows the likely active speaker, and smooths the virtual camera. | Interviews, podcasts, panels, and talking-head footage. |
| `center_crop` | Uses a fixed vertical crop through the centre of the landscape image. | A subject that remains centred, or a completely static result. |
| `blurred_background` | Preserves the full landscape frame over a blurred vertical background. | Slides, demonstrations, wide group shots, or footage where cropping would remove important content. |

Face tracking does not simply choose the largest face. YuNet detects faces and Light-ASD helps associate visible speech with the audio. The track is then median-filtered, dead-zoned, velocity-limited, and smoothed. A speaker change must remain dominant before the crop switches, and scene cuts are reacquired without a slow pan.

When active-speaker evidence is unavailable, the Actor may retain a stable visual face track. If no face is reliable, it uses `fallbackCropMode`. During B-roll or voice-over, there may be no visible person who corresponds to the voice; in that situation no system can infer the narrator from lip movement.

Profiles, covered mouths, heavy backlight, small faces, overlapping speech, and crowded scenes remain difficult. For footage where every part of the wide frame matters, choose `blurred_background` instead of tracking.

> **Stabilised face tracking** means stabilised crop coordinates. It does not apply a general camera-shake stabiliser to the source video.

### 8. Languages and translation

Leave **Input language** empty unless automatic detection is wrong. The Actor normalises common two-letter and three-letter source codes before translation; you do not need to know the translation provider's internal code format.

Validated output languages:

| Language | Code |
| --- | --- |
| English (US) | `EN-US` |
| Spanish | `ES` |
| French | `FR` |
| German | `DE` |
| Italian | `IT` |
| Portuguese (Brazil) | `PT-BR` |
| Arabic | `AR` |
| Simplified Chinese | `ZH-HANS` |
| Japanese | `JA` |
| Korean | `KO` |

Input detection covers more languages, but only these ten have been validated end to end for translation, wrapping, direction, and rendering. Translation is machine-produced and marked `machine-translated-unreviewed`. When source and target are the same language, including `EN` to `EN-US`, no translation is performed or charged.

### 9. Subtitle behaviour

All ten output languages have validated language profiles. English, French, Spanish, German, Italian, Portuguese, and Arabic avoid awkward line endings on frequent grammatical function words. Simplified Chinese and Japanese use punctuation-aware kinsoku boundaries. Korean prefers spaces and safely falls back to Hangul-syllable boundaries. Arabic uses right-to-left shaping through libass. Unicode grapheme measurement prevents internal cuts in combining marks and emoji sequences.

Subtitles use at most two lines and remain inside a phone-safe region. The reading-speed target is 23 characters per second, with script-specific limits where appropriate. When fast speech makes readability and synchronisation incompatible, synchronisation wins and the subtitle track is labelled `needs_manual_review`; text is not silently removed or desynchronised.

There is no word-by-word karaoke or dynamic highlight style. The transcription provider does not guarantee the word timings required for an honest result.

### 10. Outputs and statuses

One Dataset row is created per selected clip. It includes the source interval, duration, score and breakdown, hook, title, description, hashtags, `selectionMethod`, `cropMethod`, language codes, compliance statuses, warnings, and links to files that actually exist.

The run's Key-Value Store can contain:

- one MP4 and one metadata JSON per delivered clip;
- SRT and VTT tracks only when their toggles are enabled;
- original and translated tracks with language suffixes when both are requested;
- `manifest.json`, including counters, billing reconciliation, warnings, artifact sizes, and SHA-256 checksums;
- `ai-viral-clips.zip` when `createZip` is enabled.

An absent artifact is represented by `null`, never by an empty fake link.

| Status | Meaning |
| --- | --- |
| `success` | Every selected clip was rendered and delivered. |
| `partial_success` | At least one clip was delivered and at least one failed. Inspect each row. |
| `failed` | No clip could be delivered. Inspect `error` and the logs. |
| `needs_manual_review` | A subtitle track exists but violates a linguistic reading constraint, usually because speech is too fast. |

A subtitle warning does not mean the MP4 failed to decode. Technical media validation and linguistic subtitle review are separate facts.

### 11. Pricing

This Actor uses pay-per-event pricing. A started minute is a billed minute.

| Event | Price | Charged when |
| --- | ---: | --- |
| `actor-start` | $0.05 | Once, after input validation and the cost check. |
| `transcribed-minute` | $0.03 | Per source minute, after a usable transcript is produced. |
| `analysed-minute` | $0.02 | Per source minute when the model selects passages. |
| `fallback-analysed-minute` | $0.01 | Per source minute when deterministic selection is used instead. |
| `translated-minute` | $0.04 | Per delivered clip minute, only when translation is produced. |
| `rendered-clip-minute` | $0.08 | Per validated clip minute at 720 × 1280. |
| `rendered-hd-clip-minute` | $0.13 | Per validated clip minute at 1080 × 1920. |

Exactly one of the two analysis event types is used in a run. For each delivered clip, exactly one of the two render event types is used. Failed renders, rejected candidates, and unnecessary translations are not charged.

Example for a one-hour source producing five clips of 30–60 seconds, using model-based analysis:

- 720 × 1280, no translation: **$3.45**;
- 720 × 1280, translated: **$3.65**;
- 1080 × 1920, no translation: **$3.70**;
- 1080 × 1920, translated: **$3.90**.

If deterministic fallback selection is used instead, the analysis portion is charged at the lower fallback rate.

`maxCostUsd` is the Actor's preflight ceiling. Apify's separate **Maximum cost per run** setting must also be high enough. If the Actor estimate exceeds `maxCostUsd`, the run stops with `cost_limit_exceeded` before a paid provider is contacted. If the Apify charge ceiling is exhausted later, the run reports `billing_limit_reached` and keeps already produced artifacts.

### 12. Complete JSON example

For a direct file URL, three distinct clips with French subtitles:

```json
{
  "videoUrl": "https://example.com/interview.mp4",
  "confirmContentRights": true,
  "clipCount": 3,
  "targetClipDuration": "15-30",
  "platform": "TikTok",
  "sourceLanguage": "en",
  "outputLanguage": "FR",
  "outputLanguageMode": "translations",
  "aspectRatio": "9:16",
  "resolution": "720x1280",
  "cropMode": "face_tracking",
  "fallbackCropMode": "center_crop",
  "burnSubtitles": true,
  "subtitleStyle": "Clean",
  "generateSrt": true,
  "generateVtt": true,
  "createZip": true,
  "maxCostUsd": 5,
  "minimumViralScore": 0,
  "avoidOverlaps": true,
  "maxMediaMinutes": 90
}
```

The `videoFile` value generated by the Console is normally an array containing one Apify storage URL. Use the upload widget instead of typing that structure by hand whenever possible.

### 13. Media validation

Every rendered clip is probed again before delivery. Validation checks include the required audio and video streams, dimensions, pixel format, duration, decodable beginning and end, and timestamp consistency. This catches damaged files that can report a plausible duration yet fail when their final frames are decoded.

The MP4 output uses H.264 video, AAC audio, and `yuv420p` for broad social and mobile compatibility. Rendering re-encodes the cut so boundaries remain frame-accurate instead of drifting to the nearest source keyframe.

### 14. Troubleshooting

| Symptom or result | Explanation and action |
| --- | --- |
| The run succeeds in a few seconds but returns no clips | No source was supplied, so the free readiness check ran. Upload a video and start a new run. |
| The upload field is missing | The selected Actor build does not expose this project's `.actor/input_schema.json`. Select the deployed build/version that contains the complete project. |
| `validation_error` | Read the message and correct the named input. JSON enum values are case-sensitive. |
| A direct URL is refused | It is probably a platform page, private page, or redirect rather than a direct media file. Upload the video instead. |
| Fewer clips than requested | The source lacks enough distinct passages under the current duration or score constraints. Try a shorter duration or a longer source. |
| Two subtitle levels appear | `outputLanguageMode` is `both`, or subtitles were already burned into the source. Choose `translations` for translated-only output. |
| No visible subtitles, but SRT/VTT files exist | This is expected when `burnSubtitles` is `false` but `generateSrt` or `generateVtt` is `true`. |
| The wrong person is framed during a conversation | Active-speaker evidence may be ambiguous. Profiles, overlapping speech, and covered mouths are difficult. Try `center_crop` or `blurred_background` for that source. |
| The image shakes | Face tracking filters crop jitter but cannot remove shake present in the original camera footage. |
| `cost_limit_exceeded` | Increase `maxCostUsd`, or reduce source length, clip count, clip duration, or resolution. Nothing was charged. |
| `billing_limit_reached` | Increase Apify's **Maximum cost per run** and start a new run. Already produced files remain available. |
| `configuration_error` | A required provider is not configured on the Actor. Nothing was charged; report it to the Actor owner. |
| Subtitle `needs_manual_review` | Speech was too fast for the configured reading limit. Review or edit the external subtitle before publication. |

### 15. Privacy and third-party processing

The media is downloaded into the run's container and temporary working files are deleted when the run ends. Audio is sent to the transcription provider; the timed transcript is sent to the selection provider; clip text is sent to the translation provider only when translation is requested. Face detection, active-speaker analysis, cropping, subtitle rendering, and media validation run inside the Actor container.

Output files remain in the run's Apify storage according to your Apify storage and retention settings.

### 16. Copyright and content rights

You must own the source or be authorised to transform it. Confirmation is required before any download or paid processing.

The Actor does not download from YouTube, TikTok, Instagram, or similar platform pages, and does not bypass authentication, access controls, or DRM. Download or obtain the source lawfully, then upload the file.

### 17. Known limitations

- Automatic selection, transcription, metadata, and translation require human review before publication.
- A requested clip count is not guaranteed when honest, non-overlapping passages do not exist.
- Active-speaker tracking can fail on profiles, small or obscured faces, overlapping speakers, heavy backlight, and crowded scenes.
- It stabilises the digital crop, not physical camera shake.
- Subtitle streams already embedded in the source are ignored; audio is transcribed. Text already burned into the image cannot be removed.
- Only vertical 9:16 output is rendered in this version.
- Source limits are 500 MB, 90 minutes by default, and 180 minutes maximum. The source must contain both video and audio.
- There is no automatic social publishing, B-roll insertion, voice cloning, face modification, AI-generated imagery, or word-by-word karaoke.

### 18. API call

```bash
curl -X POST "https://api.apify.com/v2/acts/lumaxys~ai-viral-clip-generator/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "videoUrl": "https://example.com/interview.mp4",
    "confirmContentRights": true,
    "clipCount": 3,
    "targetClipDuration": "30-60",
    "platform": "TikTok",
    "resolution": "720x1280",
    "cropMode": "face_tracking",
    "outputLanguageMode": "original",
    "maxCostUsd": 5
  }'
```

Dataset rows and file URLs are available in the run output. The full artifact inventory, validation results, and billing reconciliation are recorded in `manifest.json`.

### Support

Include the Apify run ID and a minimal reproducible input when reporting a problem. Do not include private API tokens or signed media URLs.

# Actor input Schema

## `videoFile` (type: `array`):

Upload the long video you want to turn into clips. MP4, MOV, MKV or WebM, up to 500 MB and 90 minutes. Use this or a direct URL, not both.

## `videoUrl` (type: `string`):

A direct link to a video file, such as https://example.com/interview.mp4. Pages on YouTube, TikTok, Instagram and similar platforms are not supported and are refused with an explanation.

## `confirmContentRights` (type: `boolean`):

Required. Processing does not start until this is ticked.

## `clipCount` (type: `integer`):

How many short clips to produce. Fewer clips may be returned if the source does not contain enough usable passages.

## `targetClipDuration` (type: `string`):

Preferred duration range for each generated clip.

## `platform` (type: `string`):

Only affects the suggested metadata; every clip is rendered the same way.

## `sourceLanguage` (type: `string`):

Leave empty to detect the language automatically. Detection covers far more languages than the output list below.

## `outputLanguage` (type: `string`):

Leave empty to keep the original language. Translation is machine-produced and is not reviewed by a human translator.

## `outputLanguageMode` (type: `string`):

Choosing a translated option requires an output language.

## `aspectRatio` (type: `string`):

This version produces vertical 9:16 clips only. Square and landscape output are not available yet.

## `resolution` (type: `string`):

Output resolution for vertical 9:16 clips.

## `cropMode` (type: `string`):

Face tracking uses on-device detection. When no reliable face is found the fallback below is applied and the clip reports which framing was really used.

## `fallbackCropMode` (type: `string`):

Cropping method used when face tracking cannot produce a reliable result. Centre crop is recommended for a true full-frame vertical clip; blurred background preserves the complete landscape frame.

## `burnSubtitles` (type: `boolean`):

Burn the generated subtitles directly into each video.

## `subtitleStyle` (type: `string`):

Visual style applied to burned-in subtitles.

## `generateSrt` (type: `boolean`):

Generate a separate SRT subtitle file for each delivered clip.

## `generateVtt` (type: `boolean`):

Generate a separate WebVTT subtitle file for each delivered clip.

## `createZip` (type: `boolean`):

Create a ZIP archive containing all delivered files.

## `maxCostUsd` (type: `integer`):

The run stops before contacting any paid service if the estimate exceeds this. The estimate is shown in the result.

## `minimumViralScore` (type: `integer`):

Passages scoring below this are discarded. The score is an editorial estimate, not a prediction of performance.

## `avoidOverlaps` (type: `boolean`):

Prevent selected passages from significantly overlapping each other.

## `maxMediaMinutes` (type: `integer`):

Maximum accepted source-media duration in minutes.

## Actor input object example

```json
{
  "confirmContentRights": false,
  "clipCount": 3,
  "targetClipDuration": "30-60",
  "platform": "TikTok",
  "outputLanguageMode": "original",
  "aspectRatio": "9:16",
  "resolution": "720x1280",
  "cropMode": "face_tracking",
  "fallbackCropMode": "center_crop",
  "burnSubtitles": true,
  "subtitleStyle": "Clean",
  "generateSrt": true,
  "generateVtt": true,
  "createZip": true,
  "maxCostUsd": 5,
  "minimumViralScore": 0,
  "avoidOverlaps": true,
  "maxMediaMinutes": 90
}
```

# Actor output Schema

## `clips` (type: `string`):

Dataset containing one row for each generated clip.

## `summary` (type: `string`):

Complete JSON result and execution summary.

## `files` (type: `string`):

Videos, subtitles, metadata, manifest and optional ZIP archive.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("lumaxys/ai-viral-clip-generator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("lumaxys/ai-viral-clip-generator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call lumaxys/ai-viral-clip-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=lumaxys/ai-viral-clip-generator",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/tcbMBf1uYjni2Evuk/builds/9KjnpYzeyWLsCOrmY/openapi.json
