ffmpeg-encoder-check
What it does
This skill shows how to list FFmpeg's H.264 encoders and choose the best one for the computer. It is for people encoding video who want to avoid codec problems.
When to use it
- ✓When I need to convert or encode video with FFmpeg.
- ✓When a video job fails with a library version mismatch.
- ✓When my source video already matches the format I want and does not need re-encoding.
Skill link
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/ffmpeg-encoder-check/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Convert my video with FFmpeg. Check which H.264 encoders are installed first, so the job does not fail.”
5 new skills a week. 1 minute to read.
How it works
The AI lists the encoders on the system, compares them with a table of options, and picks stream copy, libx264, a hardware encoder or another available choice.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
FFmpeg Encoder Availability Check
Purpose
Before writing video encoding scripts, always verify which H.264 encoders are available in your FFmpeg installation. This prevents failures from library version mismatches, particularly with libopenh264.
Instructions
Step 1: Probe Available Encoders
Run the following command to check available H.264 encoders:
ffmpeg -encoders 2>/dev/null | grep h264
This shows which H.264 encoders are compiled into your FFmpeg build.
Step 2: Interpret Results
Common encoder options you may see:
| Encoder | Description | Recommendation |
|---|---|---|
libx264 |
Software H.264 encoder | Preferred - widely compatible |
libopenh264 |
OpenH264 software encoder | Use with caution - often has library version mismatches |
h264_nvenc |
NVIDIA hardware encoder | Good if NVIDIA GPU available |
h264_videotoolbox |
macOS hardware encoder | Good on macOS |
h264_vaapi |
Intel VAAPI hardware encoder | Good on Linux with Intel GPU |
h264_qsv |
Intel QuickSync encoder | Good on Windows/Linux with Intel GPU |
Step 3: Choose Encoding Strategy
For same-resolution sources (no re-encoding needed):
# Best option - pass-through without quality loss
ffmpeg -i input.mp4 -c:v copy -c:a copy output.mp4
If libx264 is available:
# Reliable software encoding
ffmpeg -i input.mp4 -c:v libx264 -preset medium -crf 23 -c:a aac output.mp4
If only libopenh264 is available:
# Use with caution - may have library issues
ffmpeg -i input.mp4 -c:v libopenh264 -c:a aac output.mp4
Step 4: Validate Before Batch Processing
Always test your encoding command on a small sample file before processing multiple videos or long footage.
Best Practices
- Default to
-c:v copywhen source and target resolutions match - no quality loss, fastest processing - Prefer libx264 over libopenh264 for software encoding - more stable, better compatibility
- Check encoder availability at script startup, not during execution - fail fast with clear error
- Cache encoder check results if running multiple encoding operations in the same session
- Provide fallback options in automated scripts - try copy first, then libx264, then fail gracefully
Example Script Template
#!/bin/bash
# Check available encoders at startup
ENCODERS=$(ffmpeg -encoders 2>/dev/null | grep h264)
if echo "$ENCODERS" | grep -q "libx264"; then
VIDEO_CODEC="libx264"
echo "Using libx264 encoder"
elif echo "$ENCODERS" | grep -q "libopenh264"; then
VIDEO_CODEC="libopenh264"
echo "Warning: Using libopenh264 (may have compatibility issues)"
else
echo "Error: No H.264 encoder available"
echo "Available encoders:"
echo "$ENCODERS"
exit 1
fi
# For same-resolution sources, prefer copy
if [ "$SOURCE_RESOLUTION" = "$TARGET_RESOLUTION" ]; then
VIDEO_CODEC="copy"
echo "Same resolution detected - using stream copy"
fi
# Encode
ffmpeg -i "$INPUT" -c:v "$VIDEO_CODEC" -c:a aac "$OUTPUT"
Common Errors to Avoid
- Do not assume libx264 is available - FFmpeg builds vary by system
- Do not use libopenh264 without checking - frequent library version mismatch errors
- Do not re-encode unnecessarily - use
-c:v copywhen resolution matches - Do not skip the encoder check - always probe before writing encoding logic
FAQ
Which encoder is the most widely compatible?
The guide says libx264 is preferred and widely compatible.
What do hardware encoders depend on?
They depend on the graphics hardware in the computer, such as NVIDIA, Apple or Intel chips.
Why avoid libopenh264?
The guide says it often has library version mismatches.
Details
Original description by the author
Check FFmpeg encoder availability before video encoding to avoid library mismatches
repo: HKUDS/AgentPilot
Popularity
- GitHub stars
- 7.8k
- Ranking position
- #12886
- License
- MIT
- Updated
- 11/1/2026
Comments
- …
More skills from this repository
agentpilot
7.8kHelps your agent improve a project step by step by preparing a task and running the AgentPilot loop that proposes, tests and scores changes.
openspace
7.8kHelps your agent set up OpenSpace, a tool that stores and fetches agent skills, and connect it to your AI app through MCP.
rsi-arena
7.8kHelps your agent set up and run standard AI benchmark tests, such as AIME and Terminal-Bench, to compare different improvement methods.
experiment-guide
7.8kHelps your agent plan small experiments, read their results and record findings while it investigates how to improve a program.
Similar skills
taste-application
280kHelps your agent create videos in a specific style. It can copy the editing rhythm from a reference video, generate new scenes, adjust colors, and edit everything together with other footage.
taste-distillation
280kLets your agent analyze videos to create a style pack. This includes colors, cutting rhythm, and visual elements that can be reused to create new videos with the same look.
ui-demo
280kHas your agent record polished UI demo videos. Useful for creating tutorials or showing how a web app works.