# YouTube to GIF: 5-Second Video Summary for LinkedIn (`ingeniela/youtube-video-to-gif-summary`) Actor

Turn a YouTube video or any video file into a 5-second GIF (and MP4) that previews the whole video: key moments picked automatically, square or vertical, optional text, under 5 MB. Perfect to promote your videos on LinkedIn, X and email.

- **URL**: https://apify.com/ingeniela/youtube-video-to-gif-summary.md
- **Developed by:** [Ingeniela](https://apify.com/ingeniela) (community)
- **Categories:** Videos, Social media
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $50.00 / 1,000 gif summaries

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/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

## YouTube to GIF: 5-Second Video Summary for LinkedIn, X and Email

You published a video. Now you want people on LinkedIn, X, your newsletter or your website to click it. A 5-second preview that moves gets far more attention than a static thumbnail. This Actor takes your **YouTube link** (or any video file), finds the **key moments across the whole video**, and turns them into a **5-second looping GIF** plus an **MP4** of the same preview, square, portrait or vertical if you like, with your own text on top, and always **under 5 MB**.

![Example: a 20-second video turned into a 5-second square GIF with a text bar](https://api.apify.com/v2/key-value-stores/RXaOr7FspyrQ4JP88/records/youtube-to-gif-example.gif)

*Real output (0.34 MB) from our 20-second sample video. On an 8-minute YouTube video the GIF took 8 moments from 0:50 to 6:32 and weighed 2.9 MB.*

### Tutorial (1 minute)

![Step-by-step tutorial: what to fill in, click Start, the real result and the price](https://api.apify.com/v2/key-value-stores/RXaOr7FspyrQ4JP88/records/youtube-to-gif-tutorial.gif)

*Every number in this tutorial comes from a real run on [this 7-minute YouTube video](https://www.youtube.com/watch?v=NrFlgOT0ycA): 8 moments picked from 0:46 to 6:48, a 0.61 MB square GIF plus an MP4, for $0.05 plus about $0.09 to download the video.*

### What you get (one row per video)

- **GIF** (looping, optimized palette, under your size limit: 5 MB by default) ready to drop into a LinkedIn post, an email or a web page.
- **MP4** of the same preview at 720 px (LinkedIn autoplays MP4 in the feed).
- The timestamps used, the GIF size, width and frame rate.

### How it picks the moments

1. The video is split into equal parts (8 by default), skipping the intro and the outro.
2. In each part, it finds the **biggest visual change**: a scene cut, a new slide or a new shot, where something is happening.
3. It takes the next fraction of a second (8 moments × 0.625 s = 5 s) and joins them into one smooth loop.
4. If the GIF is over the size limit, it automatically lowers the width and frame rate until it fits.

### How to use it

1. Paste your **YouTube links** (or direct MP4/MOV links: Dropbox and Google Drive work).
2. Choose the **shape**: square (1:1) and portrait (4:5) take the most space in the LinkedIn feed.
3. Optional: add a **text** such as `New video: 5 mistakes with retinol ▶`.
4. Click **Start** and download the GIF and the MP4 from the results.

### Input example

```json
{
  "videoUrls": ["https://www.youtube.com/watch?v=YOUR_VIDEO"],
  "gifSeconds": 5,
  "moments": 8,
  "aspect": "square",
  "overlayText": "New video: how I edit in 10 minutes ▶",
  "maxGifMb": 5
}
```

### Pricing

| Event | Price |
|---|---|
| GIF + MP4 summary of one video | $0.05 |

YouTube videos are fetched in low resolution (360p by default, enough for a 640 px GIF) on your Apify account at about US$0.006 per MB (a 10-minute video ≈ $0.10). Direct file links cost nothing extra.

### Good to know

Use it for videos you own or have the right to use, for example to promote your own channel. Private, members-only and age-restricted YouTube videos cannot be fetched; use a direct file link instead.

# Actor input Schema

## `videoUrls` (type: `array`):

Your YouTube video links, or direct links to MP4/MOV files (Dropbox and Google Drive work). One GIF per video.

## `gifSeconds` (type: `integer`):

5 seconds is ideal for LinkedIn and X.

## `moments` (type: `integer`):

How many short moments from across the video (8 moments in 5 s = 0.6 s each).

## `aspect` (type: `string`):

Square or 4:5 take more space in the LinkedIn feed.

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

GIF width. It is reduced automatically to stay under the size limit.

## `fps` (type: `integer`):

12 looks smooth and keeps the file small.

## `maxGifMb` (type: `integer`):

LinkedIn and most email tools work best under 5 MB.

## `overlayText` (type: `string`):

e.g. 'New video: how I grew to 10k ▶'. Shown on a bar at the bottom.

## `hdMp4` (type: `boolean`):

LinkedIn autoplays MP4 in the feed; GIFs are great for email, X and websites.

## `downloadQuality` (type: `string`):

Lower = cheaper. 360p is enough for a 640 px GIF; use 720p for a sharper MP4.

## `scraperMaxCostUsd` (type: `integer`):

Downloading costs about US$0.006 per MB (a 10-min video at 360p ≈ $0.10).

## Actor input object example

```json
{
  "videoUrls": [
    "https://api.apify.com/v2/key-value-stores/lYhzUaQnLmzci34BM/records/sample-captions-en.mp4"
  ],
  "gifSeconds": 5,
  "moments": 8,
  "aspect": "original",
  "width": 640,
  "fps": 12,
  "maxGifMb": 5,
  "hdMp4": true,
  "downloadQuality": "360p",
  "scraperMaxCostUsd": 2
}
```

# Actor output Schema

## `gifs` (type: `string`):

No description

## `files` (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 = {
    "videoUrls": [
        "https://api.apify.com/v2/key-value-stores/lYhzUaQnLmzci34BM/records/sample-captions-en.mp4"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ingeniela/youtube-video-to-gif-summary").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 = { "videoUrls": ["https://api.apify.com/v2/key-value-stores/lYhzUaQnLmzci34BM/records/sample-captions-en.mp4"] }

# Run the Actor and wait for it to finish
run = client.actor("ingeniela/youtube-video-to-gif-summary").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 '{
  "videoUrls": [
    "https://api.apify.com/v2/key-value-stores/lYhzUaQnLmzci34BM/records/sample-captions-en.mp4"
  ]
}' |
apify call ingeniela/youtube-video-to-gif-summary --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ingeniela/youtube-video-to-gif-summary"
        }
    }
}
```

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/8ZZl7TgQo1uH2O5cq/builds/SXapxA2IFCkFmJez2/openapi.json
