agentleFS
ai-enhanced-engineerai-enhanced-engineer/aiee-skills/skills/ffmpeg-laravel-video/SKILL.md

ffmpeg-laravel-video

Skill4 starsChanged 5 months agoMITView on GitHub

FFmpeg integration with Laravel for video processing. Thumbnail generation, format conversion, video metadata extraction, streaming. Use for video upload features, thumbnail generation, or media processing.

The file

Files
SKILL.md

FFmpeg Video Processing in Laravel

Laravel wrapper for FFmpeg using protonemedia/laravel-ffmpeg.

When to Use

  • Generating video thumbnails
  • Converting video formats
  • Extracting video metadata (duration, resolution, codec)
  • HLS/DASH streaming setup
  • Video watermarking
  • Processing uploaded videos
  • Queue-based video processing

Quick Setup Pattern

Generate Thumbnail:

use ProtoneMedia\LaravelFFMpeg\Support\FFMpeg;

FFMpeg::fromDisk('s3')
    ->open('videos/input.mp4')
    ->getFrameFromSeconds(10)
    ->export()
    ->toDisk('s3')
    ->save('thumbnails/video-thumb.jpg');

Convert Video Format:

FFMpeg::fromDisk('s3')
    ->open('videos/input.mov')
    ->export()
    ->inFormat(new \FFMpeg\Format\Video\X264)
    ->save('videos/output.mp4');

Common Operations

OperationUse CaseMethod
ThumbnailVideo previewgetFrameFromSeconds(10)->save('thumb.jpg')
Format conversionMP4, WebM, AVIinFormat(new X264)->save('output.mp4')
MetadataDuration, resolutiongetDurationInSeconds(), getVideoStream()
HLS streamingAdaptive bitrateexportForHLS()->save('stream.m3u8')
WatermarkBrandingaddFilter('-i', 'logo.png')

Queue Pattern

Queue-based processing recommended: Video processing blocks HTTP requests. Queue jobs enable async processing with timeouts and retries.

// Controller
class VideoController extends Controller
{
    public function upload(Request $request)
    {
        $path = $request->file('video')->store('videos', 's3');
        ProcessVideoJob::dispatch($path);
        return response()->json(['processing' => true]);
    }
}

// Job (basic structure - see examples.md for full implementation)
class ProcessVideoJob implements ShouldQueue
{
    use Queueable;

    public $timeout = 1800; // 30 minutes
    public $tries = 3;

    public function handle()
    {
        FFMpeg::fromDisk('s3')
            ->open($this->videoPath)
            ->getFrameFromSeconds(5)
            ->export()
            ->save('thumbnails/thumb.jpg');
    }
}

Anti-Patterns

Anti-PatternPattern
FFmpeg not foundInstall via Dockerfile (see reference.md) (not installed in Docker)
TimeoutUse queue with timeout = 1800 (synchronous processing)
Memory exhaustedSet PHP memory_limit = 512M (large video processing)
Missing codecInstall ffmpeg package (not ffmpeg-lite) (FFmpeg build incomplete)

See reference.md for installation, HLS streaming, security hardening, format options. See examples.md for complete job implementations, anti-patterns, Docker setup.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.