# Live Stream Clipper — record & clip any live signal (`synthetic.ia/live-stream-clipper`) Actor

Record clips and grab snapshots from a live stream (HLS, RTMP, or YouTube/Twitch via yt-dlp) over HTTP. POST a URL and a duration, get an MP4 or JPG back. Clip from a start point too. Pay per clip.

- **URL**: https://apify.com/synthetic.ia/live-stream-clipper.md
- **Developed by:** [Synthetic](https://apify.com/synthetic.ia) (community)
- **Categories:** Videos, Developer tools
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $60.00 / 1,000 clip recordeds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Live Stream Clipper — record & clip any live signal

Turn a **live stream into clips and stills over HTTP**. Point it at an HLS/RTMP URL — or a YouTube/Twitch page (resolved with yt-dlp) — and record a clip of the last few minutes, clip from a specific point, or grab a snapshot of what's on air right now. No OBS, no downloads, no server.

- 🔴 **Clip a live signal**: record N seconds from the live edge → MP4
- ⏱️ **Clip from a point**: give a `start` time (works on VOD and DVR-enabled live streams), like a YouTube clip
- 📸 **Snapshot**: a single frame of the current live moment → JPG
- ⚡ HTTP API (Standby) + `/async` for long clips
- 💵 Pay per clip

### Endpoints

Base URL (Standby): `https://synthetic-ia--live-stream-clipper.apify.actor` with header `Authorization: Bearer <APIFY_TOKEN>`.

| Endpoint | Body | Does |
|---|---|---|
| `POST /clip` | `{ url, duration?: 1-300, start? }` | Record a clip from the live signal (or from `start`) → MP4 |
| `POST /snapshot` | `{ url, width? }` | Grab the current frame → JPG |
| `POST /async` | `{ operation, …params }` → `{ runId }` | Start a long clip; then `GET /status/<runId>` |
| `GET /status/<runId>` | — | Poll an async job |

`GET /` returns this list as JSON.

### Examples

```bash
## Record 30 seconds of a live HLS stream
curl -X POST ".../clip" -H "Authorization: Bearer $APIFY_TOKEN" \
  -d '{"url":"https://.../live.m3u8","duration":30}'

## Clip from minute 12 of a stream that has a DVR window (like a YouTube clip)
curl -X POST ".../clip" -H "Authorization: Bearer $APIFY_TOKEN" \
  -d '{"url":"https://www.youtube.com/watch?v=…","start":"12:00","duration":20}'

## Snapshot of what's on air now
curl -X POST ".../snapshot" -H "Authorization: Bearer $APIFY_TOKEN" -d '{"url":"https://.../live.m3u8"}'
```

Response: `{ "ok": true, "operation": "clip", "url": "https://…/OUTPUT.mp4", "duration": 30, "resolvedBy": "yt-dlp" }`.

### Supported inputs

Direct **HLS** (`.m3u8`), **DASH** (`.mpd`), **RTMP/RTMPS**, or a **page URL** (YouTube, Twitch, Kick, and everything else yt-dlp supports). The `start` point works on VOD and on live streams that keep a **DVR window**; on a pure live edge with no rewind buffer, clips record from now.

### Limits

- Clip duration **max 300 s**; synchronous recording fits under ~4 min — use `/async` for longer.
- http(s)/rtmp(s) only; private/loopback hosts are blocked.
- No GPU (CPU-only), so recording uses stream copy (no re-encode) — fast and cheap.

### Pricing

**Per clip** from **$0.06**, **per snapshot** from **$0.01** (platform usage included).

### Legal

**You are responsible for having the right to record the stream you provide.** Use it for your own broadcasts, streams you're licensed to record, or content that permits it. Do not use it to infringe copyright or a platform's terms.

# Changelog

This Actor's version history is a separate document: https://apify.com/synthetic.ia/live-stream-clipper/changelog.md

# Actor input Schema

## `operation` (type: `string`):

Record a clip from the live signal, or grab a single frame.

## `url` (type: `string`):

Live stream URL: HLS (.m3u8), DASH (.mpd), RTMP, or a page URL (YouTube/Twitch/…) resolved with yt-dlp.

## `start` (type: `string`):

For clip: start point (seconds or HH:MM:SS). Works on VOD and live streams with a DVR window; on a no-DVR live edge it records from now.

## `duration` (type: `number`):

For clip: how many seconds to record, starting at the start point (or the live edge). Max 300.

## `width` (type: `integer`):

For snapshot: output width; height auto.

## Actor input object example

```json
{
  "operation": "snapshot",
  "url": "https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8",
  "duration": 30,
  "width": 1280
}
```

# Actor output Schema

## `result` (type: `string`):

The recorded clip or snapshot and its URL.

## `log` (type: `string`):

No description

# 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 = {
    "start": "",
    "duration": 30,
    "width": 1280
};

// Run the Actor and wait for it to finish
const run = await client.actor("synthetic.ia/live-stream-clipper").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 = {
    "start": "",
    "duration": 30,
    "width": 1280,
}

# Run the Actor and wait for it to finish
run = client.actor("synthetic.ia/live-stream-clipper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "start": "",
  "duration": 30,
  "width": 1280
}' |
apify call synthetic.ia/live-stream-clipper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,synthetic.ia/live-stream-clipper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/90csybhftT7iExoer/builds/OMUfBCZ3yxdOaji48/openapi.json
