ffmpeg

Implements video and audio processing workflows using the libffmpeg C API.

Updated May 22, 2026
One-click install
npx skills add https://github.com/viniciuscs84/sdd-toolkit --skill ffmpeg-viniciuscs84
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ffmpeg
Source: https://github.com/viniciuscs84/sdd-toolkit/tree/main/skills/ffmpeg
Command: npx skills add https://github.com/viniciuscs84/sdd-toolkit --skill ffmpeg-viniciuscs84

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing correct C code against the libffmpeg libraries (libavformat, libavcodec, libswscale) is error-prone, with strict requirements around initialization order, memory management, and error handling that frequently cause crashes and leaks. ## Core Features & Use Cases - Decode-Process-Encode Workflow: Provides complete C code patterns for opening input files, decoding frames, processing them, and re-encoding to H.264 output. - API Reference Patterns: Covers memory management rules, error handling with AVERROR codes, pixel format conversion with sws_scale, and seeking. - CLI Reference: Includes a reference guide for ffmpeg command-line filters, codecs, CRF quality settings, and common operations like thumbnails, GIFs, and picture-in-picture. - Use Case: When building a C application that needs to transcode video files frame-by-frame, use this Skill to get the correct sequence of avformat_open_input, decoder setup, frame loop, and encoder configuration without memory leaks. ## Quick Start Use the ffmpeg skill to write C code that decodes an MP4 file, scales each frame to 1280x720, and re-encodes it as H.264.

Frequently Asked Questions about ffmpeg

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I decode video frames with libavcodec in C?▼

Open the input with avformat_open_input, find the video stream with av_find_best_stream, then create a decoder context with avcodec_alloc_context3 and avcodec_open2. Send packets with avcodec_send_packet and receive decoded frames with avcodec_receive_frame in a loop.

How to convert pixel formats using libswscale?▼

Create a SwsContext with sws_getContext specifying source and destination dimensions and pixel formats, then call sws_scale to convert frame data. Use SWS_BILINEAR as a standard scaling algorithm flag.

Does this skill cover ffmpeg command-line usage?▼

The SKILL.md focuses on the libffmpeg C API, not command-line operations. However, the bundled reference file documents CLI filters, codecs, CRF quality settings, and common commands like thumbnails and GIF creation.

Why does my libavcodec application leak memory?▼

Every av_frame_alloc must be paired with av_frame_free, and every av_packet_alloc with av_packet_free. Additionally, call av_packet_unref after processing each packet to release referenced buffers between iterations.

Is libavcodec thread-safe for parallel decoding?▼

libavcodec is not thread-safe by default. You must configure threading options when calling avcodec_open2 to enable multi-threaded decoding safely.