Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

ffmpeg-cloudflare-containers

БесплатноБез исполняемых скриптовНе проверен

Complete Cloudflare Container FFmpeg system. PROACTIVELY activate for: (1) Cloudflare Containers setup, (2) Native FFmpeg at edge, (3) GPU-accelerated…

JosiahSiegelот JosiahSiegel★ 67 звёзд на GitHub

Об этом скилле

Quick Reference

Component Configuration
Container Class export class FFmpegContainer extends Container
Dockerfile FROM jrottenberg/ffmpeg:7.1-alpine
wrangler.toml containers with class_name and image
Feature Workers (ffmpeg.wasm) Containers (Native)
Size Limit 10MB Unlimited
Performance 10-100x slower Native speed
GPU Support None NVIDIA available
Cold Start Instant 2-3 seconds

When to Use This Skill

Use for edge video processing at scale:

  • Native FFmpeg performance at Cloudflare edge
  • GPU-accelerated transcoding in containers
  • Large file processing (>10MB)
  • Complex FFmpeg pipelines
  • R2 storage integration for video files

FFmpeg in Cloudflare Containers (2025)

Overview

Cloudflare Containers (launched June 2025) enable running FFmpeg natively in a full Linux container environment at the edge. This overcomes all limitations of Workers-based approaches (ffmpeg.wasm size limits, SharedArrayBuffer restrictions).

Key Benefits

Feature Workers (ffmpeg.wasm) Containers (Native)
Binary Size Limited to 10MB Unlimited (disk space)
Performance WebAssembly overhead Native speed
GPU Support None NVIDIA GPUs available
Filesystem Virtual/memory only Full Linux FS
Dependencies Must compile to WASM Any Linux package
Cold Start Instant 2-3 seconds

Getting Started

Prerequisites

# Docker must be running locally
docker info

# Verify wrangler installation
npx wrangler --version

Create Container Project

# Create from template
npm create cloudflare@latest -- --template=cloudflare/templates/containers-template

# Or manually configure existing project

wrangler.toml Configuration

name = "ffmpeg-processor"
main = "src/index.ts"
compatibility_date = "2025-12-19"

# Container configuration
containers
class_name = "FFmpegContainer"
image = "./Dockerfile"
max_instances = 10

# Durable Object binding for container
durable_objects.bindings
name = "FFMPEG_CONTAINER"
class_name = "FFmpegContainer"

# Required migration for SQLite-backed containers
migrations
tag = "v1"
new_sqlite_classes = ["FFmpegContainer"]

Dockerfile for FFmpeg

# Use official FFmpeg image
FROM jrottenberg/ffmpeg:7.1-alpine AS ffmpeg

# Production image
FROM node:22-alpine

# Install FFmpeg from the official image
COPY --from=ffmpeg /usr/local /usr/local

# Install additional dependencies
RUN apk add --no-cache \
    libva \
    libva-utils \
    mesa-va-gallium

# Set up application
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production

COPY . .

# Container must listen on a port
EXPOSE 8080

CMD ["node", "server.js"]

Worker Code

// src/index.ts
import { Container, DurableObject } from "cloudflare:workers";

interface Env {
  FFMPEG_CONTAINER: DurableObjectNamespace<FFmpegContainer>;
}

export class FFmpegContainer extends Container {
  // Default port the container listens on
  defaultPort = 8080;

  // Sleep after 5 minutes of inactivity
  sleepAfter = "5m";

  // Environment variables for container
  envVars = {
    NODE_ENV: "production",
    FFMPEG_PATH: "/usr/local/bin/ffmpeg"
  };

  async onStart() {
    console.log("FFmpeg container started");
  }

  async onStop() {
    console.log("FFmpeg container stopped");
  }

  async onError(error: Error) {
    console.error("Container error:", error);
  }
}

export default {
  async fetch(request: Request, env: Env): Promise<Response> {
    const url = new URL(request.url);

    // Route to container for video processing
    if (url.pathname.startsWith("/process")) {
      // Create unique container instance per job
      const id = env.FFMPEG_CONTAINER.idFromName(crypto.randomUUID());
      const container = env.FFMPEG_CONTAINER.get(id);

      // Forward request to container
      return container.fetch(request);
    }

    // Load balance across containers
    if (url.pathname === "/lb") {
      const id = env.FFMPEG_CONTAINER.newUniqueId();
      const container = env.FFMPEG_CONTAINER.get(id);
      return container.fetch(request);
    }

    return new Response("FFmpeg Container Service", { status: 200 });
  }
};

Container Server (Node.js)

// server.js - Runs inside the container
import express from 'express';
import { spawn } from 'child_process';
import fs from 'fs/promises';
import path from 'path';

const app = express();
app.use(express.raw({ type: '*/*', limit: '100mb' }));

const TEMP_DIR = '/tmp/ffmpeg-work';

app.post('/transcode', async (req, res) => {
  const j
Полный SKILL.md на GitHub

Установить ffmpeg-cloudflare-containers в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл ffmpeg-cloudflare-containers?

Complete Cloudflare Container FFmpeg system. PROACTIVELY activate for: (1) Cloudflare Containers setup, (2) Native FFmpeg at edge, (3) GPU-accelerated containers, (4) Durable Objects integration, (5) R2 storage for video files, (6) Container autoscaling, (7) Streaming large files, (8) Workers + Containers architecture, (9) Live streaming relay at edge, (10) Container vs Workers comparison. Provides: Dockerfile examples, Worker code, container configuration, GPU setup, R2 integration, production patterns. Ensures: Native FFmpeg performance at Cloudflare edge with full GPU support.

Как установить скилл ffmpeg-cloudflare-containers?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл ffmpeg-cloudflare-containers запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить ffmpeg-cloudflare-containers с